diff --git a/.gitignore b/.gitignore index 60beb54ce2c..fb519e22e73 100644 --- a/.gitignore +++ b/.gitignore @@ -371,7 +371,7 @@ DocProject/Help/Html2 DocProject/Help/html # Click-Once directory -publish/ +bin/**/publish/ # Publish Web Output *.[Pp]ublish.xml diff --git a/src/generated/Admin/AdminRequestBuilder.cs b/src/generated/Admin/AdminRequestBuilder.cs index 1b59ccfcbcd..b260f8dfa6f 100644 --- a/src/generated/Admin/AdminRequestBuilder.cs +++ b/src/generated/Admin/AdminRequestBuilder.cs @@ -27,12 +27,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get admin"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -51,12 +58,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update admin"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Admin/ServiceAnnouncement/HealthOverviews/HealthOverviewsRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/HealthOverviews/HealthOverviewsRequestBuilder.cs index ca7ad361dde..85f892a704b 100644 --- a/src/generated/Admin/ServiceAnnouncement/HealthOverviews/HealthOverviewsRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/HealthOverviews/HealthOverviewsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of service health information for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of service health information for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/Issues/IssuesRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/Issues/IssuesRequestBuilder.cs index 674858090ea..7c9782d0eb0 100644 --- a/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/Issues/IssuesRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/Issues/IssuesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of issues happened on the service, with detailed information for each issue."; // Create options for all the parameters - command.AddOption(new Option("--servicehealth-id", description: "key: id of serviceHealth")); - command.AddOption(new Option("--body")); + var serviceHealthIdOption = new Option("--servicehealth-id", description: "key: id of serviceHealth"); + serviceHealthIdOption.IsRequired = true; + command.AddOption(serviceHealthIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (serviceHealthId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(serviceHealthId)) requestInfo.PathParameters.Add("serviceHealth_id", serviceHealthId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of issues happened on the service, with detailed information for each issue."; // Create options for all the parameters - command.AddOption(new Option("--servicehealth-id", description: "key: id of serviceHealth")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (serviceHealthId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(serviceHealthId)) requestInfo.PathParameters.Add("serviceHealth_id", serviceHealthId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var serviceHealthIdOption = new Option("--servicehealth-id", description: "key: id of serviceHealth"); + serviceHealthIdOption.IsRequired = true; + command.AddOption(serviceHealthIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (serviceHealthId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/Issues/Item/IncidentReport/IncidentReportRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/Issues/Item/IncidentReport/IncidentReportRequestBuilder.cs index b500e6328c9..1f9ea218620 100644 --- a/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/Issues/Item/IncidentReport/IncidentReportRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/Issues/Item/IncidentReport/IncidentReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function incidentReport"; // Create options for all the parameters - command.AddOption(new Option("--servicehealth-id", description: "key: id of serviceHealth")); - command.AddOption(new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue")); + var serviceHealthIdOption = new Option("--servicehealth-id", description: "key: id of serviceHealth"); + serviceHealthIdOption.IsRequired = true; + command.AddOption(serviceHealthIdOption); + var serviceHealthIssueIdOption = new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue"); + serviceHealthIssueIdOption.IsRequired = true; + command.AddOption(serviceHealthIssueIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (serviceHealthId, serviceHealthIssueId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(serviceHealthId)) requestInfo.PathParameters.Add("serviceHealth_id", serviceHealthId); - if (!String.IsNullOrEmpty(serviceHealthIssueId)) requestInfo.PathParameters.Add("serviceHealthIssue_id", serviceHealthIssueId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/Issues/Item/ServiceHealthIssueRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/Issues/Item/ServiceHealthIssueRequestBuilder.cs index 75fcc719c1c..9605db4a816 100644 --- a/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/Issues/Item/ServiceHealthIssueRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/Issues/Item/ServiceHealthIssueRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of issues happened on the service, with detailed information for each issue."; // Create options for all the parameters - command.AddOption(new Option("--servicehealth-id", description: "key: id of serviceHealth")); - command.AddOption(new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue")); + var serviceHealthIdOption = new Option("--servicehealth-id", description: "key: id of serviceHealth"); + serviceHealthIdOption.IsRequired = true; + command.AddOption(serviceHealthIdOption); + var serviceHealthIssueIdOption = new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue"); + serviceHealthIssueIdOption.IsRequired = true; + command.AddOption(serviceHealthIssueIdOption); command.Handler = CommandHandler.Create(async (serviceHealthId, serviceHealthIssueId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(serviceHealthId)) requestInfo.PathParameters.Add("serviceHealth_id", serviceHealthId); - if (!String.IsNullOrEmpty(serviceHealthIssueId)) requestInfo.PathParameters.Add("serviceHealthIssue_id", serviceHealthIssueId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of issues happened on the service, with detailed information for each issue."; // Create options for all the parameters - command.AddOption(new Option("--servicehealth-id", description: "key: id of serviceHealth")); - command.AddOption(new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (serviceHealthId, serviceHealthIssueId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(serviceHealthId)) requestInfo.PathParameters.Add("serviceHealth_id", serviceHealthId); - if (!String.IsNullOrEmpty(serviceHealthIssueId)) requestInfo.PathParameters.Add("serviceHealthIssue_id", serviceHealthIssueId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var serviceHealthIdOption = new Option("--servicehealth-id", description: "key: id of serviceHealth"); + serviceHealthIdOption.IsRequired = true; + command.AddOption(serviceHealthIdOption); + var serviceHealthIssueIdOption = new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue"); + serviceHealthIssueIdOption.IsRequired = true; + command.AddOption(serviceHealthIssueIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (serviceHealthId, serviceHealthIssueId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of issues happened on the service, with detailed information for each issue."; // Create options for all the parameters - command.AddOption(new Option("--servicehealth-id", description: "key: id of serviceHealth")); - command.AddOption(new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue")); - command.AddOption(new Option("--body")); + var serviceHealthIdOption = new Option("--servicehealth-id", description: "key: id of serviceHealth"); + serviceHealthIdOption.IsRequired = true; + command.AddOption(serviceHealthIdOption); + var serviceHealthIssueIdOption = new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue"); + serviceHealthIssueIdOption.IsRequired = true; + command.AddOption(serviceHealthIssueIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (serviceHealthId, serviceHealthIssueId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(serviceHealthId)) requestInfo.PathParameters.Add("serviceHealth_id", serviceHealthId); - if (!String.IsNullOrEmpty(serviceHealthIssueId)) requestInfo.PathParameters.Add("serviceHealthIssue_id", serviceHealthIssueId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/ServiceHealthRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/ServiceHealthRequestBuilder.cs index 4080e246fc1..d96a13f8d09 100644 --- a/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/ServiceHealthRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/HealthOverviews/Item/ServiceHealthRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of service health information for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--servicehealth-id", description: "key: id of serviceHealth")); + var serviceHealthIdOption = new Option("--servicehealth-id", description: "key: id of serviceHealth"); + serviceHealthIdOption.IsRequired = true; + command.AddOption(serviceHealthIdOption); command.Handler = CommandHandler.Create(async (serviceHealthId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(serviceHealthId)) requestInfo.PathParameters.Add("serviceHealth_id", serviceHealthId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of service health information for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--servicehealth-id", description: "key: id of serviceHealth")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (serviceHealthId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(serviceHealthId)) requestInfo.PathParameters.Add("serviceHealth_id", serviceHealthId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var serviceHealthIdOption = new Option("--servicehealth-id", description: "key: id of serviceHealth"); + serviceHealthIdOption.IsRequired = true; + command.AddOption(serviceHealthIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (serviceHealthId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of service health information for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--servicehealth-id", description: "key: id of serviceHealth")); - command.AddOption(new Option("--body")); + var serviceHealthIdOption = new Option("--servicehealth-id", description: "key: id of serviceHealth"); + serviceHealthIdOption.IsRequired = true; + command.AddOption(serviceHealthIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (serviceHealthId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(serviceHealthId)) requestInfo.PathParameters.Add("serviceHealth_id", serviceHealthId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Admin/ServiceAnnouncement/Issues/IssuesRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Issues/IssuesRequestBuilder.cs index 0a3f1594eab..d58b7d03e2e 100644 --- a/src/generated/Admin/ServiceAnnouncement/Issues/IssuesRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/Issues/IssuesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of service issues for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of service issues for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Admin/ServiceAnnouncement/Issues/Item/IncidentReport/IncidentReportRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Issues/Item/IncidentReport/IncidentReportRequestBuilder.cs index aa996e251d5..7d6291d9920 100644 --- a/src/generated/Admin/ServiceAnnouncement/Issues/Item/IncidentReport/IncidentReportRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/Issues/Item/IncidentReport/IncidentReportRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function incidentReport"; // Create options for all the parameters - command.AddOption(new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue")); + var serviceHealthIssueIdOption = new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue"); + serviceHealthIssueIdOption.IsRequired = true; + command.AddOption(serviceHealthIssueIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (serviceHealthIssueId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(serviceHealthIssueId)) requestInfo.PathParameters.Add("serviceHealthIssue_id", serviceHealthIssueId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Admin/ServiceAnnouncement/Issues/Item/ServiceHealthIssueRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Issues/Item/ServiceHealthIssueRequestBuilder.cs index 9bccf412415..0b6c9dc2cf2 100644 --- a/src/generated/Admin/ServiceAnnouncement/Issues/Item/ServiceHealthIssueRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/Issues/Item/ServiceHealthIssueRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of service issues for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue")); + var serviceHealthIssueIdOption = new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue"); + serviceHealthIssueIdOption.IsRequired = true; + command.AddOption(serviceHealthIssueIdOption); command.Handler = CommandHandler.Create(async (serviceHealthIssueId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(serviceHealthIssueId)) requestInfo.PathParameters.Add("serviceHealthIssue_id", serviceHealthIssueId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of service issues for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (serviceHealthIssueId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(serviceHealthIssueId)) requestInfo.PathParameters.Add("serviceHealthIssue_id", serviceHealthIssueId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var serviceHealthIssueIdOption = new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue"); + serviceHealthIssueIdOption.IsRequired = true; + command.AddOption(serviceHealthIssueIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (serviceHealthIssueId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,14 +80,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of service issues for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue")); - command.AddOption(new Option("--body")); + var serviceHealthIssueIdOption = new Option("--servicehealthissue-id", description: "key: id of serviceHealthIssue"); + serviceHealthIssueIdOption.IsRequired = true; + command.AddOption(serviceHealthIssueIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (serviceHealthIssueId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(serviceHealthIssueId)) requestInfo.PathParameters.Add("serviceHealthIssue_id", serviceHealthIssueId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Admin/ServiceAnnouncement/Messages/Archive/ArchiveRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Messages/Archive/ArchiveRequestBuilder.cs index 2936781e2d5..a5e81db2110 100644 --- a/src/generated/Admin/ServiceAnnouncement/Messages/Archive/ArchiveRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/Messages/Archive/ArchiveRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action archive"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Admin/ServiceAnnouncement/Messages/Favorite/FavoriteRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Messages/Favorite/FavoriteRequestBuilder.cs index e93cab59ca8..7b62c34d790 100644 --- a/src/generated/Admin/ServiceAnnouncement/Messages/Favorite/FavoriteRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/Messages/Favorite/FavoriteRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action favorite"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Admin/ServiceAnnouncement/Messages/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Messages/Item/Attachments/AttachmentsRequestBuilder.cs new file mode 100644 index 00000000000..efeb1c57c0a --- /dev/null +++ b/src/generated/Admin/ServiceAnnouncement/Messages/Item/Attachments/AttachmentsRequestBuilder.cs @@ -0,0 +1,219 @@ +using ApiSdk.Admin.ServiceAnnouncement.Messages.Item.Attachments.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Admin.ServiceAnnouncement.Messages.Item.Attachments { + /// Builds and executes requests for operations under \admin\serviceAnnouncement\messages\{serviceUpdateMessage-id}\attachments + public class AttachmentsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new ServiceAnnouncementAttachmentRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildContentCommand(), + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// Create new navigation property to attachments for admin + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Create new navigation property to attachments for admin"; + // Create options for all the parameters + var serviceUpdateMessageIdOption = new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage"); + serviceUpdateMessageIdOption.IsRequired = true; + command.AddOption(serviceUpdateMessageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (serviceUpdateMessageId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Get attachments from admin + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Get attachments from admin"; + // Create options for all the parameters + var serviceUpdateMessageIdOption = new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage"); + serviceUpdateMessageIdOption.IsRequired = true; + command.AddOption(serviceUpdateMessageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (serviceUpdateMessageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new AttachmentsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AttachmentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/admin/serviceAnnouncement/messages/{serviceUpdateMessage_id}/attachments{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Get attachments from admin + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Create new navigation property to attachments for admin + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(ServiceAnnouncementAttachment body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Get attachments from admin + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Create new navigation property to attachments for admin + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(ServiceAnnouncementAttachment model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Get attachments from admin + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Admin/ServiceAnnouncement/Messages/Item/Attachments/AttachmentsResponse.cs b/src/generated/Admin/ServiceAnnouncement/Messages/Item/Attachments/AttachmentsResponse.cs new file mode 100644 index 00000000000..21d27489907 --- /dev/null +++ b/src/generated/Admin/ServiceAnnouncement/Messages/Item/Attachments/AttachmentsResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Admin.ServiceAnnouncement.Messages.Item.Attachments { + public class AttachmentsResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new attachmentsResponse and sets the default values. + /// + public AttachmentsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as AttachmentsResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as AttachmentsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Admin/ServiceAnnouncement/Messages/Item/Attachments/Item/Content/ContentRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Messages/Item/Attachments/Item/Content/ContentRequestBuilder.cs new file mode 100644 index 00000000000..64ff9e20110 --- /dev/null +++ b/src/generated/Admin/ServiceAnnouncement/Messages/Item/Attachments/Item/Content/ContentRequestBuilder.cs @@ -0,0 +1,150 @@ +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Admin.ServiceAnnouncement.Messages.Item.Attachments.Item.Content { + /// Builds and executes requests for operations under \admin\serviceAnnouncement\messages\{serviceUpdateMessage-id}\attachments\{serviceAnnouncementAttachment-id}\content + public class ContentRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Get media content for the navigation property attachments from admin + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Get media content for the navigation property attachments from admin"; + // Create options for all the parameters + var serviceUpdateMessageIdOption = new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage"); + serviceUpdateMessageIdOption.IsRequired = true; + command.AddOption(serviceUpdateMessageIdOption); + var serviceAnnouncementAttachmentIdOption = new Option("--serviceannouncementattachment-id", description: "key: id of serviceAnnouncementAttachment"); + serviceAnnouncementAttachmentIdOption.IsRequired = true; + command.AddOption(serviceAnnouncementAttachmentIdOption); + command.AddOption(new Option("--output")); + command.Handler = CommandHandler.Create(async (serviceUpdateMessageId, serviceAnnouncementAttachmentId, output) => { + var requestInfo = CreateGetRequestInformation(q => { + }); + var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); + // Print request output. What if the request has no return? + if (output == null) { + using var reader = new StreamReader(result); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + } + else { + using var writeStream = output.OpenWrite(); + await result.CopyToAsync(writeStream); + Console.WriteLine($"Content written to {output.FullName}."); + } + }); + return command; + } + /// + /// Update media content for the navigation property attachments in admin + /// + public Command BuildPutCommand() { + var command = new Command("put"); + command.Description = "Update media content for the navigation property attachments in admin"; + // Create options for all the parameters + var serviceUpdateMessageIdOption = new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage"); + serviceUpdateMessageIdOption.IsRequired = true; + command.AddOption(serviceUpdateMessageIdOption); + var serviceAnnouncementAttachmentIdOption = new Option("--serviceannouncementattachment-id", description: "key: id of serviceAnnouncementAttachment"); + serviceAnnouncementAttachmentIdOption.IsRequired = true; + command.AddOption(serviceAnnouncementAttachmentIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); + command.Handler = CommandHandler.Create(async (serviceUpdateMessageId, serviceAnnouncementAttachmentId, file) => { + using var stream = file.OpenRead(); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new ContentRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public ContentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/admin/serviceAnnouncement/messages/{serviceUpdateMessage_id}/attachments/{serviceAnnouncementAttachment_id}/content"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Get media content for the navigation property attachments from admin + /// Request headers + /// Request options + /// + public RequestInformation CreateGetRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Update media content for the navigation property attachments in admin + /// Binary request body + /// Request headers + /// Request options + /// + public RequestInformation CreatePutRequestInformation(Stream body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PUT, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetStreamContent(body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Get media content for the navigation property attachments from admin + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(h, o); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Update media content for the navigation property attachments in admin + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// Binary request body + /// + public async Task PutAsync(Stream stream, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = stream ?? throw new ArgumentNullException(nameof(stream)); + var requestInfo = CreatePutRequestInformation(stream, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + } +} diff --git a/src/generated/Admin/ServiceAnnouncement/Messages/Item/Attachments/Item/ServiceAnnouncementAttachmentRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Messages/Item/Attachments/Item/ServiceAnnouncementAttachmentRequestBuilder.cs new file mode 100644 index 00000000000..9fb48db5150 --- /dev/null +++ b/src/generated/Admin/ServiceAnnouncement/Messages/Item/Attachments/Item/ServiceAnnouncementAttachmentRequestBuilder.cs @@ -0,0 +1,228 @@ +using ApiSdk.Admin.ServiceAnnouncement.Messages.Item.Attachments.Item.Content; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Admin.ServiceAnnouncement.Messages.Item.Attachments.Item { + /// Builds and executes requests for operations under \admin\serviceAnnouncement\messages\{serviceUpdateMessage-id}\attachments\{serviceAnnouncementAttachment-id} + public class ServiceAnnouncementAttachmentRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public Command BuildContentCommand() { + var command = new Command("content"); + var builder = new ApiSdk.Admin.ServiceAnnouncement.Messages.Item.Attachments.Item.Content.ContentRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildGetCommand()); + command.AddCommand(builder.BuildPutCommand()); + return command; + } + /// + /// Delete navigation property attachments for admin + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Delete navigation property attachments for admin"; + // Create options for all the parameters + var serviceUpdateMessageIdOption = new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage"); + serviceUpdateMessageIdOption.IsRequired = true; + command.AddOption(serviceUpdateMessageIdOption); + var serviceAnnouncementAttachmentIdOption = new Option("--serviceannouncementattachment-id", description: "key: id of serviceAnnouncementAttachment"); + serviceAnnouncementAttachmentIdOption.IsRequired = true; + command.AddOption(serviceAnnouncementAttachmentIdOption); + command.Handler = CommandHandler.Create(async (serviceUpdateMessageId, serviceAnnouncementAttachmentId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Get attachments from admin + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Get attachments from admin"; + // Create options for all the parameters + var serviceUpdateMessageIdOption = new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage"); + serviceUpdateMessageIdOption.IsRequired = true; + command.AddOption(serviceUpdateMessageIdOption); + var serviceAnnouncementAttachmentIdOption = new Option("--serviceannouncementattachment-id", description: "key: id of serviceAnnouncementAttachment"); + serviceAnnouncementAttachmentIdOption.IsRequired = true; + command.AddOption(serviceAnnouncementAttachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (serviceUpdateMessageId, serviceAnnouncementAttachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Update the navigation property attachments in admin + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Update the navigation property attachments in admin"; + // Create options for all the parameters + var serviceUpdateMessageIdOption = new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage"); + serviceUpdateMessageIdOption.IsRequired = true; + command.AddOption(serviceUpdateMessageIdOption); + var serviceAnnouncementAttachmentIdOption = new Option("--serviceannouncementattachment-id", description: "key: id of serviceAnnouncementAttachment"); + serviceAnnouncementAttachmentIdOption.IsRequired = true; + command.AddOption(serviceAnnouncementAttachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (serviceUpdateMessageId, serviceAnnouncementAttachmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new ServiceAnnouncementAttachmentRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public ServiceAnnouncementAttachmentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/admin/serviceAnnouncement/messages/{serviceUpdateMessage_id}/attachments/{serviceAnnouncementAttachment_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Delete navigation property attachments for admin + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Get attachments from admin + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Update the navigation property attachments in admin + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(ServiceAnnouncementAttachment body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Delete navigation property attachments for admin + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Get attachments from admin + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Update the navigation property attachments in admin + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(ServiceAnnouncementAttachment model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Get attachments from admin + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Admin/ServiceAnnouncement/Messages/Item/AttachmentsArchive/AttachmentsArchiveRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Messages/Item/AttachmentsArchive/AttachmentsArchiveRequestBuilder.cs new file mode 100644 index 00000000000..3dcbf09e8d3 --- /dev/null +++ b/src/generated/Admin/ServiceAnnouncement/Messages/Item/AttachmentsArchive/AttachmentsArchiveRequestBuilder.cs @@ -0,0 +1,144 @@ +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Admin.ServiceAnnouncement.Messages.Item.AttachmentsArchive { + /// Builds and executes requests for operations under \admin\serviceAnnouncement\messages\{serviceUpdateMessage-id}\attachmentsArchive + public class AttachmentsArchiveRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Get media content for the navigation property messages from admin + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Get media content for the navigation property messages from admin"; + // Create options for all the parameters + var serviceUpdateMessageIdOption = new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage"); + serviceUpdateMessageIdOption.IsRequired = true; + command.AddOption(serviceUpdateMessageIdOption); + command.AddOption(new Option("--output")); + command.Handler = CommandHandler.Create(async (serviceUpdateMessageId, output) => { + var requestInfo = CreateGetRequestInformation(q => { + }); + var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); + // Print request output. What if the request has no return? + if (output == null) { + using var reader = new StreamReader(result); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + } + else { + using var writeStream = output.OpenWrite(); + await result.CopyToAsync(writeStream); + Console.WriteLine($"Content written to {output.FullName}."); + } + }); + return command; + } + /// + /// Update media content for the navigation property messages in admin + /// + public Command BuildPutCommand() { + var command = new Command("put"); + command.Description = "Update media content for the navigation property messages in admin"; + // Create options for all the parameters + var serviceUpdateMessageIdOption = new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage"); + serviceUpdateMessageIdOption.IsRequired = true; + command.AddOption(serviceUpdateMessageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); + command.Handler = CommandHandler.Create(async (serviceUpdateMessageId, file) => { + using var stream = file.OpenRead(); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new AttachmentsArchiveRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AttachmentsArchiveRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/admin/serviceAnnouncement/messages/{serviceUpdateMessage_id}/attachmentsArchive"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Get media content for the navigation property messages from admin + /// Request headers + /// Request options + /// + public RequestInformation CreateGetRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Update media content for the navigation property messages in admin + /// Binary request body + /// Request headers + /// Request options + /// + public RequestInformation CreatePutRequestInformation(Stream body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PUT, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetStreamContent(body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Get media content for the navigation property messages from admin + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(h, o); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Update media content for the navigation property messages in admin + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// Binary request body + /// + public async Task PutAsync(Stream stream, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = stream ?? throw new ArgumentNullException(nameof(stream)); + var requestInfo = CreatePutRequestInformation(stream, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + } +} diff --git a/src/generated/Admin/ServiceAnnouncement/Messages/Item/ServiceUpdateMessageRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Messages/Item/ServiceUpdateMessageRequestBuilder.cs index 7e57880364c..48887b2fdbf 100644 --- a/src/generated/Admin/ServiceAnnouncement/Messages/Item/ServiceUpdateMessageRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/Messages/Item/ServiceUpdateMessageRequestBuilder.cs @@ -1,3 +1,5 @@ +using ApiSdk.Admin.ServiceAnnouncement.Messages.Item.Attachments; +using ApiSdk.Admin.ServiceAnnouncement.Messages.Item.AttachmentsArchive; using ApiSdk.Models.Microsoft.Graph; using Microsoft.Kiota.Abstractions; using Microsoft.Kiota.Abstractions.Serialization; @@ -19,6 +21,20 @@ public class ServiceUpdateMessageRequestBuilder { private IRequestAdapter RequestAdapter { get; set; } /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } + public Command BuildAttachmentsArchiveCommand() { + var command = new Command("attachments-archive"); + var builder = new ApiSdk.Admin.ServiceAnnouncement.Messages.Item.AttachmentsArchive.AttachmentsArchiveRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildGetCommand()); + command.AddCommand(builder.BuildPutCommand()); + return command; + } + public Command BuildAttachmentsCommand() { + var command = new Command("attachments"); + var builder = new ApiSdk.Admin.ServiceAnnouncement.Messages.Item.Attachments.AttachmentsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } /// /// A collection of service messages for tenant. This property is a contained navigation property, it is nullable and readonly. /// @@ -26,10 +42,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of service messages for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage")); + var serviceUpdateMessageIdOption = new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage"); + serviceUpdateMessageIdOption.IsRequired = true; + command.AddOption(serviceUpdateMessageIdOption); command.Handler = CommandHandler.Create(async (serviceUpdateMessageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(serviceUpdateMessageId)) requestInfo.PathParameters.Add("serviceUpdateMessage_id", serviceUpdateMessageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +61,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of service messages for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (serviceUpdateMessageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(serviceUpdateMessageId)) requestInfo.PathParameters.Add("serviceUpdateMessage_id", serviceUpdateMessageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var serviceUpdateMessageIdOption = new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage"); + serviceUpdateMessageIdOption.IsRequired = true; + command.AddOption(serviceUpdateMessageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (serviceUpdateMessageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +95,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of service messages for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage")); - command.AddOption(new Option("--body")); + var serviceUpdateMessageIdOption = new Option("--serviceupdatemessage-id", description: "key: id of serviceUpdateMessage"); + serviceUpdateMessageIdOption.IsRequired = true; + command.AddOption(serviceUpdateMessageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (serviceUpdateMessageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(serviceUpdateMessageId)) requestInfo.PathParameters.Add("serviceUpdateMessage_id", serviceUpdateMessageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Admin/ServiceAnnouncement/Messages/MarkRead/MarkReadRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Messages/MarkRead/MarkReadRequestBuilder.cs index b8bc6916c03..310c993fe39 100644 --- a/src/generated/Admin/ServiceAnnouncement/Messages/MarkRead/MarkReadRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/Messages/MarkRead/MarkReadRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action markRead"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Admin/ServiceAnnouncement/Messages/MarkUnread/MarkUnreadRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Messages/MarkUnread/MarkUnreadRequestBuilder.cs index 005528f51e0..69e61526494 100644 --- a/src/generated/Admin/ServiceAnnouncement/Messages/MarkUnread/MarkUnreadRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/Messages/MarkUnread/MarkUnreadRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action markUnread"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Admin/ServiceAnnouncement/Messages/MessagesRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Messages/MessagesRequestBuilder.cs index f6abb16c700..1d12b76d127 100644 --- a/src/generated/Admin/ServiceAnnouncement/Messages/MessagesRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/Messages/MessagesRequestBuilder.cs @@ -35,6 +35,8 @@ public Command BuildArchiveCommand() { public List BuildCommand() { var builder = new ServiceUpdateMessageRequestBuilder(PathParameters, RequestAdapter); var commands = new List { + builder.BuildAttachmentsArchiveCommand(), + builder.BuildAttachmentsCommand(), builder.BuildDeleteCommand(), builder.BuildGetCommand(), builder.BuildPatchCommand(), @@ -48,12 +50,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of service messages for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,24 +83,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of service messages for tenant. This property is a contained navigation property, it is nullable and readonly."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Admin/ServiceAnnouncement/Messages/Unarchive/UnarchiveRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Messages/Unarchive/UnarchiveRequestBuilder.cs index 6c6daaf87c0..9b6a5aaa839 100644 --- a/src/generated/Admin/ServiceAnnouncement/Messages/Unarchive/UnarchiveRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/Messages/Unarchive/UnarchiveRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unarchive"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Admin/ServiceAnnouncement/Messages/Unfavorite/UnfavoriteRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/Messages/Unfavorite/UnfavoriteRequestBuilder.cs index 60b84ce7ebe..0ceabf38f38 100644 --- a/src/generated/Admin/ServiceAnnouncement/Messages/Unfavorite/UnfavoriteRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/Messages/Unfavorite/UnfavoriteRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unfavorite"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Admin/ServiceAnnouncement/ServiceAnnouncementRequestBuilder.cs b/src/generated/Admin/ServiceAnnouncement/ServiceAnnouncementRequestBuilder.cs index 217169cc4b1..64e8a8142bd 100644 --- a/src/generated/Admin/ServiceAnnouncement/ServiceAnnouncementRequestBuilder.cs +++ b/src/generated/Admin/ServiceAnnouncement/ServiceAnnouncementRequestBuilder.cs @@ -30,7 +30,8 @@ public Command BuildDeleteCommand() { command.Description = "A container for service communications resources. Read-only."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +45,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A container for service communications resources. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,12 +103,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A container for service communications resources. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs b/src/generated/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs index ff0e10ff175..42836b55a29 100644 --- a/src/generated/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs +++ b/src/generated/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to agreementAcceptances"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,12 +63,18 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from agreementAcceptances"; // Create options for all the parameters - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (search, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - requestInfo.QueryParameters.Add("select", select); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (search, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(search)) q.Search = search; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/AgreementAcceptances/Item/AgreementAcceptanceRequestBuilder.cs b/src/generated/AgreementAcceptances/Item/AgreementAcceptanceRequestBuilder.cs index 228b9ae2f77..a138eb6da02 100644 --- a/src/generated/AgreementAcceptances/Item/AgreementAcceptanceRequestBuilder.cs +++ b/src/generated/AgreementAcceptances/Item/AgreementAcceptanceRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from agreementAcceptances"; // Create options for all the parameters - command.AddOption(new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance")); + var agreementAcceptanceIdOption = new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance"); + agreementAcceptanceIdOption.IsRequired = true; + command.AddOption(agreementAcceptanceIdOption); command.Handler = CommandHandler.Create(async (agreementAcceptanceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(agreementAcceptanceId)) requestInfo.PathParameters.Add("agreementAcceptance_id", agreementAcceptanceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,12 +45,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from agreementAcceptances by key"; // Create options for all the parameters - command.AddOption(new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (agreementAcceptanceId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementAcceptanceId)) requestInfo.PathParameters.Add("agreementAcceptance_id", agreementAcceptanceId); - requestInfo.QueryParameters.Add("select", select); + var agreementAcceptanceIdOption = new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance"); + agreementAcceptanceIdOption.IsRequired = true; + command.AddOption(agreementAcceptanceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (agreementAcceptanceId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,14 +74,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in agreementAcceptances"; // Create options for all the parameters - command.AddOption(new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance")); - command.AddOption(new Option("--body")); + var agreementAcceptanceIdOption = new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance"); + agreementAcceptanceIdOption.IsRequired = true; + command.AddOption(agreementAcceptanceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementAcceptanceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(agreementAcceptanceId)) requestInfo.PathParameters.Add("agreementAcceptance_id", agreementAcceptanceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Agreements/AgreementsRequestBuilder.cs b/src/generated/Agreements/AgreementsRequestBuilder.cs index dab7b559719..060bc27be5d 100644 --- a/src/generated/Agreements/AgreementsRequestBuilder.cs +++ b/src/generated/Agreements/AgreementsRequestBuilder.cs @@ -39,12 +39,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to agreements"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,12 +66,18 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from agreements"; // Create options for all the parameters - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (search, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - requestInfo.QueryParameters.Add("select", select); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (search, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(search)) q.Search = search; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Agreements/Item/Acceptances/AcceptancesRequestBuilder.cs b/src/generated/Agreements/Item/Acceptances/AcceptancesRequestBuilder.cs index 21158558f83..a187c887aa6 100644 --- a/src/generated/Agreements/Item/Acceptances/AcceptancesRequestBuilder.cs +++ b/src/generated/Agreements/Item/Acceptances/AcceptancesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Information about acceptances of this agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--body")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Information about acceptances of this agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (agreementId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (agreementId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Agreements/Item/Acceptances/Item/AgreementAcceptanceRequestBuilder.cs b/src/generated/Agreements/Item/Acceptances/Item/AgreementAcceptanceRequestBuilder.cs index 9cb1f12aa62..cc3913fb396 100644 --- a/src/generated/Agreements/Item/Acceptances/Item/AgreementAcceptanceRequestBuilder.cs +++ b/src/generated/Agreements/Item/Acceptances/Item/AgreementAcceptanceRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Information about acceptances of this agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementAcceptanceIdOption = new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance"); + agreementAcceptanceIdOption.IsRequired = true; + command.AddOption(agreementAcceptanceIdOption); command.Handler = CommandHandler.Create(async (agreementId, agreementAcceptanceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementAcceptanceId)) requestInfo.PathParameters.Add("agreementAcceptance_id", agreementAcceptanceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Information about acceptances of this agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (agreementId, agreementAcceptanceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementAcceptanceId)) requestInfo.PathParameters.Add("agreementAcceptance_id", agreementAcceptanceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementAcceptanceIdOption = new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance"); + agreementAcceptanceIdOption.IsRequired = true; + command.AddOption(agreementAcceptanceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (agreementId, agreementAcceptanceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Information about acceptances of this agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance")); - command.AddOption(new Option("--body")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementAcceptanceIdOption = new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance"); + agreementAcceptanceIdOption.IsRequired = true; + command.AddOption(agreementAcceptanceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementId, agreementAcceptanceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementAcceptanceId)) requestInfo.PathParameters.Add("agreementAcceptance_id", agreementAcceptanceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Agreements/Item/AgreementRequestBuilder.cs b/src/generated/Agreements/Item/AgreementRequestBuilder.cs index 01979d4fad6..0bf7fe0f44d 100644 --- a/src/generated/Agreements/Item/AgreementRequestBuilder.cs +++ b/src/generated/Agreements/Item/AgreementRequestBuilder.cs @@ -36,10 +36,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from agreements"; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); command.Handler = CommandHandler.Create(async (agreementId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -69,12 +71,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from agreements by key"; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (agreementId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - requestInfo.QueryParameters.Add("select", select); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (agreementId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -93,14 +100,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in agreements"; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--body")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Agreements/Item/File/FileRequestBuilder.cs b/src/generated/Agreements/Item/File/FileRequestBuilder.cs index 5b8f09c5569..47185faa591 100644 --- a/src/generated/Agreements/Item/File/FileRequestBuilder.cs +++ b/src/generated/Agreements/Item/File/FileRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Default PDF linked to this agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); command.Handler = CommandHandler.Create(async (agreementId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Default PDF linked to this agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (agreementId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (agreementId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Default PDF linked to this agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--body")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Agreements/Item/File/Localizations/Item/AgreementFileLocalizationRequestBuilder.cs b/src/generated/Agreements/Item/File/Localizations/Item/AgreementFileLocalizationRequestBuilder.cs index a0c84dd4404..712b3f6c000 100644 --- a/src/generated/Agreements/Item/File/Localizations/Item/AgreementFileLocalizationRequestBuilder.cs +++ b/src/generated/Agreements/Item/File/Localizations/Item/AgreementFileLocalizationRequestBuilder.cs @@ -21,18 +21,21 @@ public class AgreementFileLocalizationRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Delete navigation property localizations for agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete navigation property localizations for agreements"; + command.Description = "The localized version of the terms of use agreement files attached to the agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -40,22 +43,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// Get localizations from agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get localizations from agreements"; + command.Description = "The localized version of the terms of use agreement files attached to the agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,22 +80,27 @@ public Command BuildGetCommand() { return command; } /// - /// Update the navigation property localizations in agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the navigation property localizations in agreements"; + command.Description = "The localized version of the terms of use agreement files attached to the agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); - command.AddOption(new Option("--body")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -111,7 +128,7 @@ public AgreementFileLocalizationRequestBuilder(Dictionary pathPa RequestAdapter = requestAdapter; } /// - /// Delete navigation property localizations for agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// Request headers /// Request options /// @@ -126,7 +143,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get localizations from agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// Request headers /// Request options /// Request query parameters @@ -147,7 +164,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Update the navigation property localizations in agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// /// Request headers /// Request options @@ -165,7 +182,7 @@ public RequestInformation CreatePatchRequestInformation(AgreementFileLocalizatio return requestInfo; } /// - /// Delete navigation property localizations for agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -176,7 +193,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get localizations from agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -188,7 +205,7 @@ public async Task GetAsync(Action return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Update the navigation property localizations in agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -200,7 +217,7 @@ public async Task PatchAsync(AgreementFileLocalization model, ActionGet localizations from agreements + /// The localized version of the terms of use agreement files attached to the agreement. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Agreements/Item/File/Localizations/Item/Versions/Item/AgreementFileVersionRequestBuilder.cs b/src/generated/Agreements/Item/File/Localizations/Item/Versions/Item/AgreementFileVersionRequestBuilder.cs index 2dd6ea11eb8..2ec7618233a 100644 --- a/src/generated/Agreements/Item/File/Localizations/Item/Versions/Item/AgreementFileVersionRequestBuilder.cs +++ b/src/generated/Agreements/Item/File/Localizations/Item/Versions/Item/AgreementFileVersionRequestBuilder.cs @@ -20,20 +20,24 @@ public class AgreementFileVersionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Delete navigation property versions for agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete navigation property versions for agreements"; + command.Description = "Read-only. Customized versions of the terms of use agreement in the Azure AD tenant."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); - command.AddOption(new Option("--agreementfileversion-id", description: "key: id of agreementFileVersion")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); + var agreementFileVersionIdOption = new Option("--agreementfileversion-id", description: "key: id of agreementFileVersion"); + agreementFileVersionIdOption.IsRequired = true; + command.AddOption(agreementFileVersionIdOption); command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, agreementFileVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); - if (!String.IsNullOrEmpty(agreementFileVersionId)) requestInfo.PathParameters.Add("agreementFileVersion_id", agreementFileVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,24 +45,34 @@ public Command BuildDeleteCommand() { return command; } /// - /// Get versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get versions from agreements"; + command.Description = "Read-only. Customized versions of the terms of use agreement in the Azure AD tenant."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); - command.AddOption(new Option("--agreementfileversion-id", description: "key: id of agreementFileVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, agreementFileVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); - if (!String.IsNullOrEmpty(agreementFileVersionId)) requestInfo.PathParameters.Add("agreementFileVersion_id", agreementFileVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); + var agreementFileVersionIdOption = new Option("--agreementfileversion-id", description: "key: id of agreementFileVersion"); + agreementFileVersionIdOption.IsRequired = true; + command.AddOption(agreementFileVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, agreementFileVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,24 +85,30 @@ public Command BuildGetCommand() { return command; } /// - /// Update the navigation property versions in agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the navigation property versions in agreements"; + command.Description = "Read-only. Customized versions of the terms of use agreement in the Azure AD tenant."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); - command.AddOption(new Option("--agreementfileversion-id", description: "key: id of agreementFileVersion")); - command.AddOption(new Option("--body")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); + var agreementFileVersionIdOption = new Option("--agreementfileversion-id", description: "key: id of agreementFileVersion"); + agreementFileVersionIdOption.IsRequired = true; + command.AddOption(agreementFileVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, agreementFileVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); - if (!String.IsNullOrEmpty(agreementFileVersionId)) requestInfo.PathParameters.Add("agreementFileVersion_id", agreementFileVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -109,7 +129,7 @@ public AgreementFileVersionRequestBuilder(Dictionary pathParamet RequestAdapter = requestAdapter; } /// - /// Delete navigation property versions for agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Request headers /// Request options /// @@ -124,7 +144,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Request headers /// Request options /// Request query parameters @@ -145,7 +165,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Update the navigation property versions in agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// /// Request headers /// Request options @@ -163,7 +183,7 @@ public RequestInformation CreatePatchRequestInformation(AgreementFileVersion bod return requestInfo; } /// - /// Delete navigation property versions for agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +194,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -186,7 +206,7 @@ public async Task GetAsync(Action q = return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Update the navigation property versions in agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -198,7 +218,7 @@ public async Task PatchAsync(AgreementFileVersion model, ActionGet versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Agreements/Item/File/Localizations/Item/Versions/VersionsRequestBuilder.cs b/src/generated/Agreements/Item/File/Localizations/Item/Versions/VersionsRequestBuilder.cs index 6c3590f9cb4..ba4701ff7d1 100644 --- a/src/generated/Agreements/Item/File/Localizations/Item/Versions/VersionsRequestBuilder.cs +++ b/src/generated/Agreements/Item/File/Localizations/Item/Versions/VersionsRequestBuilder.cs @@ -30,22 +30,27 @@ public List BuildCommand() { return commands; } /// - /// Create new navigation property to versions for agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create new navigation property to versions for agreements"; + command.Description = "Read-only. Customized versions of the terms of use agreement in the Azure AD tenant."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); - command.AddOption(new Option("--body")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,34 +63,56 @@ public Command BuildCreateCommand() { return command; } /// - /// Get versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Get versions from agreements"; + command.Description = "Read-only. Customized versions of the terms of use agreement in the Azure AD tenant."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -111,7 +138,7 @@ public VersionsRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// Get versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Request headers /// Request options /// Request query parameters @@ -132,7 +159,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Create new navigation property to versions for agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// /// Request headers /// Request options @@ -150,7 +177,7 @@ public RequestInformation CreatePostRequestInformation(AgreementFileVersion body return requestInfo; } /// - /// Get versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +189,7 @@ public async Task GetAsync(Action q = defa return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Create new navigation property to versions for agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -174,7 +201,7 @@ public async Task PostAsync(AgreementFileVersion model, Ac var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Get versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Agreements/Item/File/Localizations/LocalizationsRequestBuilder.cs b/src/generated/Agreements/Item/File/Localizations/LocalizationsRequestBuilder.cs index 6d590044730..52899db2982 100644 --- a/src/generated/Agreements/Item/File/Localizations/LocalizationsRequestBuilder.cs +++ b/src/generated/Agreements/Item/File/Localizations/LocalizationsRequestBuilder.cs @@ -31,20 +31,24 @@ public List BuildCommand() { return commands; } /// - /// Create new navigation property to localizations for agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create new navigation property to localizations for agreements"; + command.Description = "The localized version of the terms of use agreement files attached to the agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--body")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,32 +61,53 @@ public Command BuildCreateCommand() { return command; } /// - /// Get localizations from agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Get localizations from agreements"; + command.Description = "The localized version of the terms of use agreement files attached to the agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (agreementId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (agreementId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,7 +133,7 @@ public LocalizationsRequestBuilder(Dictionary pathParameters, IR RequestAdapter = requestAdapter; } /// - /// Get localizations from agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// Request headers /// Request options /// Request query parameters @@ -129,7 +154,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Create new navigation property to localizations for agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// /// Request headers /// Request options @@ -147,7 +172,7 @@ public RequestInformation CreatePostRequestInformation(AgreementFileLocalization return requestInfo; } /// - /// Get localizations from agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -159,7 +184,7 @@ public async Task GetAsync(Action q = return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Create new navigation property to localizations for agreements + /// The localized version of the terms of use agreement files attached to the agreement. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -171,7 +196,7 @@ public async Task PostAsync(AgreementFileLocalization var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Get localizations from agreements + /// The localized version of the terms of use agreement files attached to the agreement. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Agreements/Item/Files/FilesRequestBuilder.cs b/src/generated/Agreements/Item/Files/FilesRequestBuilder.cs index 334a3d0e6fb..a8e3e8ac910 100644 --- a/src/generated/Agreements/Item/Files/FilesRequestBuilder.cs +++ b/src/generated/Agreements/Item/Files/FilesRequestBuilder.cs @@ -31,20 +31,24 @@ public List BuildCommand() { return commands; } /// - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead."; + command.Description = "PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--body")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,32 +61,53 @@ public Command BuildCreateCommand() { return command; } /// - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead."; + command.Description = "PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (agreementId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (agreementId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,7 +133,7 @@ public FilesRequestBuilder(Dictionary pathParameters, IRequestAd RequestAdapter = requestAdapter; } /// - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// Request headers /// Request options /// Request query parameters @@ -129,7 +154,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// /// Request headers /// Request options @@ -147,7 +172,7 @@ public RequestInformation CreatePostRequestInformation(AgreementFileLocalization return requestInfo; } /// - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -159,7 +184,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -171,7 +196,7 @@ public async Task PostAsync(AgreementFileLocalization var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Agreements/Item/Files/Item/AgreementFileLocalizationRequestBuilder.cs b/src/generated/Agreements/Item/Files/Item/AgreementFileLocalizationRequestBuilder.cs index 0dbbb125c48..aa3091e46f6 100644 --- a/src/generated/Agreements/Item/Files/Item/AgreementFileLocalizationRequestBuilder.cs +++ b/src/generated/Agreements/Item/Files/Item/AgreementFileLocalizationRequestBuilder.cs @@ -21,18 +21,21 @@ public class AgreementFileLocalizationRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead."; + command.Description = "PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -40,22 +43,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead."; + command.Description = "PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,22 +80,27 @@ public Command BuildGetCommand() { return command; } /// - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead."; + command.Description = "PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); - command.AddOption(new Option("--body")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -111,7 +128,7 @@ public AgreementFileLocalizationRequestBuilder(Dictionary pathPa RequestAdapter = requestAdapter; } /// - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// Request headers /// Request options /// @@ -126,7 +143,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// Request headers /// Request options /// Request query parameters @@ -147,7 +164,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// /// Request headers /// Request options @@ -165,7 +182,7 @@ public RequestInformation CreatePatchRequestInformation(AgreementFileLocalizatio return requestInfo; } /// - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -176,7 +193,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -188,7 +205,7 @@ public async Task GetAsync(Action return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -200,7 +217,7 @@ public async Task PatchAsync(AgreementFileLocalization model, ActionPDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Agreements/Item/Files/Item/Versions/Item/AgreementFileVersionRequestBuilder.cs b/src/generated/Agreements/Item/Files/Item/Versions/Item/AgreementFileVersionRequestBuilder.cs index 2e3559ab061..5da9b6c1f8b 100644 --- a/src/generated/Agreements/Item/Files/Item/Versions/Item/AgreementFileVersionRequestBuilder.cs +++ b/src/generated/Agreements/Item/Files/Item/Versions/Item/AgreementFileVersionRequestBuilder.cs @@ -20,20 +20,24 @@ public class AgreementFileVersionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Delete navigation property versions for agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete navigation property versions for agreements"; + command.Description = "Read-only. Customized versions of the terms of use agreement in the Azure AD tenant."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); - command.AddOption(new Option("--agreementfileversion-id", description: "key: id of agreementFileVersion")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); + var agreementFileVersionIdOption = new Option("--agreementfileversion-id", description: "key: id of agreementFileVersion"); + agreementFileVersionIdOption.IsRequired = true; + command.AddOption(agreementFileVersionIdOption); command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, agreementFileVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); - if (!String.IsNullOrEmpty(agreementFileVersionId)) requestInfo.PathParameters.Add("agreementFileVersion_id", agreementFileVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,24 +45,34 @@ public Command BuildDeleteCommand() { return command; } /// - /// Get versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get versions from agreements"; + command.Description = "Read-only. Customized versions of the terms of use agreement in the Azure AD tenant."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); - command.AddOption(new Option("--agreementfileversion-id", description: "key: id of agreementFileVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, agreementFileVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); - if (!String.IsNullOrEmpty(agreementFileVersionId)) requestInfo.PathParameters.Add("agreementFileVersion_id", agreementFileVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); + var agreementFileVersionIdOption = new Option("--agreementfileversion-id", description: "key: id of agreementFileVersion"); + agreementFileVersionIdOption.IsRequired = true; + command.AddOption(agreementFileVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, agreementFileVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,24 +85,30 @@ public Command BuildGetCommand() { return command; } /// - /// Update the navigation property versions in agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the navigation property versions in agreements"; + command.Description = "Read-only. Customized versions of the terms of use agreement in the Azure AD tenant."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); - command.AddOption(new Option("--agreementfileversion-id", description: "key: id of agreementFileVersion")); - command.AddOption(new Option("--body")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); + var agreementFileVersionIdOption = new Option("--agreementfileversion-id", description: "key: id of agreementFileVersion"); + agreementFileVersionIdOption.IsRequired = true; + command.AddOption(agreementFileVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, agreementFileVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); - if (!String.IsNullOrEmpty(agreementFileVersionId)) requestInfo.PathParameters.Add("agreementFileVersion_id", agreementFileVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -109,7 +129,7 @@ public AgreementFileVersionRequestBuilder(Dictionary pathParamet RequestAdapter = requestAdapter; } /// - /// Delete navigation property versions for agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Request headers /// Request options /// @@ -124,7 +144,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Request headers /// Request options /// Request query parameters @@ -145,7 +165,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Update the navigation property versions in agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// /// Request headers /// Request options @@ -163,7 +183,7 @@ public RequestInformation CreatePatchRequestInformation(AgreementFileVersion bod return requestInfo; } /// - /// Delete navigation property versions for agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +194,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -186,7 +206,7 @@ public async Task GetAsync(Action q = return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Update the navigation property versions in agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -198,7 +218,7 @@ public async Task PatchAsync(AgreementFileVersion model, ActionGet versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Agreements/Item/Files/Item/Versions/VersionsRequestBuilder.cs b/src/generated/Agreements/Item/Files/Item/Versions/VersionsRequestBuilder.cs index babd6296ca2..a28694a69e3 100644 --- a/src/generated/Agreements/Item/Files/Item/Versions/VersionsRequestBuilder.cs +++ b/src/generated/Agreements/Item/Files/Item/Versions/VersionsRequestBuilder.cs @@ -30,22 +30,27 @@ public List BuildCommand() { return commands; } /// - /// Create new navigation property to versions for agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create new navigation property to versions for agreements"; + command.Description = "Read-only. Customized versions of the terms of use agreement in the Azure AD tenant."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); - command.AddOption(new Option("--body")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,34 +63,56 @@ public Command BuildCreateCommand() { return command; } /// - /// Get versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Get versions from agreements"; + command.Description = "Read-only. Customized versions of the terms of use agreement in the Azure AD tenant."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - if (!String.IsNullOrEmpty(agreementFileLocalizationId)) requestInfo.PathParameters.Add("agreementFileLocalization_id", agreementFileLocalizationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var agreementFileLocalizationIdOption = new Option("--agreementfilelocalization-id", description: "key: id of agreementFileLocalization"); + agreementFileLocalizationIdOption.IsRequired = true; + command.AddOption(agreementFileLocalizationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (agreementId, agreementFileLocalizationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -111,7 +138,7 @@ public VersionsRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// Get versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Request headers /// Request options /// Request query parameters @@ -132,7 +159,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Create new navigation property to versions for agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// /// Request headers /// Request options @@ -150,7 +177,7 @@ public RequestInformation CreatePostRequestInformation(AgreementFileVersion body return requestInfo; } /// - /// Get versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +189,7 @@ public async Task GetAsync(Action q = defa return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Create new navigation property to versions for agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -174,7 +201,7 @@ public async Task PostAsync(AgreementFileVersion model, Ac var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Get versions from agreements + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/AppCatalogs/AppCatalogsRequestBuilder.cs b/src/generated/AppCatalogs/AppCatalogsRequestBuilder.cs index c58c5fc81ea..22156f38670 100644 --- a/src/generated/AppCatalogs/AppCatalogsRequestBuilder.cs +++ b/src/generated/AppCatalogs/AppCatalogsRequestBuilder.cs @@ -27,12 +27,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get appCatalogs"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -51,12 +58,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update appCatalogs"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/AppCatalogs/TeamsApps/Item/AppDefinitions/AppDefinitionsRequestBuilder.cs b/src/generated/AppCatalogs/TeamsApps/Item/AppDefinitions/AppDefinitionsRequestBuilder.cs index 0878457d9f1..1eebb0aa6de 100644 --- a/src/generated/AppCatalogs/TeamsApps/Item/AppDefinitions/AppDefinitionsRequestBuilder.cs +++ b/src/generated/AppCatalogs/TeamsApps/Item/AppDefinitions/AppDefinitionsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The details for each version of the app."; // Create options for all the parameters - command.AddOption(new Option("--teamsapp-id", description: "key: id of teamsApp")); - command.AddOption(new Option("--body")); + var teamsAppIdOption = new Option("--teamsapp-id", description: "key: id of teamsApp"); + teamsAppIdOption.IsRequired = true; + command.AddOption(teamsAppIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamsAppId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamsAppId)) requestInfo.PathParameters.Add("teamsApp_id", teamsAppId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The details for each version of the app."; // Create options for all the parameters - command.AddOption(new Option("--teamsapp-id", description: "key: id of teamsApp")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamsAppId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamsAppId)) requestInfo.PathParameters.Add("teamsApp_id", teamsAppId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamsAppIdOption = new Option("--teamsapp-id", description: "key: id of teamsApp"); + teamsAppIdOption.IsRequired = true; + command.AddOption(teamsAppIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamsAppId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/AppCatalogs/TeamsApps/Item/AppDefinitions/Item/Bot/BotRequestBuilder.cs b/src/generated/AppCatalogs/TeamsApps/Item/AppDefinitions/Item/Bot/BotRequestBuilder.cs index b5d55b20ad4..731113783ab 100644 --- a/src/generated/AppCatalogs/TeamsApps/Item/AppDefinitions/Item/Bot/BotRequestBuilder.cs +++ b/src/generated/AppCatalogs/TeamsApps/Item/AppDefinitions/Item/Bot/BotRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The details of the bot specified in the Teams app manifest."; // Create options for all the parameters - command.AddOption(new Option("--teamsapp-id", description: "key: id of teamsApp")); - command.AddOption(new Option("--teamsappdefinition-id", description: "key: id of teamsAppDefinition")); + var teamsAppIdOption = new Option("--teamsapp-id", description: "key: id of teamsApp"); + teamsAppIdOption.IsRequired = true; + command.AddOption(teamsAppIdOption); + var teamsAppDefinitionIdOption = new Option("--teamsappdefinition-id", description: "key: id of teamsAppDefinition"); + teamsAppDefinitionIdOption.IsRequired = true; + command.AddOption(teamsAppDefinitionIdOption); command.Handler = CommandHandler.Create(async (teamsAppId, teamsAppDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamsAppId)) requestInfo.PathParameters.Add("teamsApp_id", teamsAppId); - if (!String.IsNullOrEmpty(teamsAppDefinitionId)) requestInfo.PathParameters.Add("teamsAppDefinition_id", teamsAppDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The details of the bot specified in the Teams app manifest."; // Create options for all the parameters - command.AddOption(new Option("--teamsapp-id", description: "key: id of teamsApp")); - command.AddOption(new Option("--teamsappdefinition-id", description: "key: id of teamsAppDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamsAppId, teamsAppDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamsAppId)) requestInfo.PathParameters.Add("teamsApp_id", teamsAppId); - if (!String.IsNullOrEmpty(teamsAppDefinitionId)) requestInfo.PathParameters.Add("teamsAppDefinition_id", teamsAppDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamsAppIdOption = new Option("--teamsapp-id", description: "key: id of teamsApp"); + teamsAppIdOption.IsRequired = true; + command.AddOption(teamsAppIdOption); + var teamsAppDefinitionIdOption = new Option("--teamsappdefinition-id", description: "key: id of teamsAppDefinition"); + teamsAppDefinitionIdOption.IsRequired = true; + command.AddOption(teamsAppDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamsAppId, teamsAppDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The details of the bot specified in the Teams app manifest."; // Create options for all the parameters - command.AddOption(new Option("--teamsapp-id", description: "key: id of teamsApp")); - command.AddOption(new Option("--teamsappdefinition-id", description: "key: id of teamsAppDefinition")); - command.AddOption(new Option("--body")); + var teamsAppIdOption = new Option("--teamsapp-id", description: "key: id of teamsApp"); + teamsAppIdOption.IsRequired = true; + command.AddOption(teamsAppIdOption); + var teamsAppDefinitionIdOption = new Option("--teamsappdefinition-id", description: "key: id of teamsAppDefinition"); + teamsAppDefinitionIdOption.IsRequired = true; + command.AddOption(teamsAppDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamsAppId, teamsAppDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamsAppId)) requestInfo.PathParameters.Add("teamsApp_id", teamsAppId); - if (!String.IsNullOrEmpty(teamsAppDefinitionId)) requestInfo.PathParameters.Add("teamsAppDefinition_id", teamsAppDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/AppCatalogs/TeamsApps/Item/AppDefinitions/Item/TeamsAppDefinitionRequestBuilder.cs b/src/generated/AppCatalogs/TeamsApps/Item/AppDefinitions/Item/TeamsAppDefinitionRequestBuilder.cs index b914b0b41e9..bce4586fbed 100644 --- a/src/generated/AppCatalogs/TeamsApps/Item/AppDefinitions/Item/TeamsAppDefinitionRequestBuilder.cs +++ b/src/generated/AppCatalogs/TeamsApps/Item/AppDefinitions/Item/TeamsAppDefinitionRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The details for each version of the app."; // Create options for all the parameters - command.AddOption(new Option("--teamsapp-id", description: "key: id of teamsApp")); - command.AddOption(new Option("--teamsappdefinition-id", description: "key: id of teamsAppDefinition")); + var teamsAppIdOption = new Option("--teamsapp-id", description: "key: id of teamsApp"); + teamsAppIdOption.IsRequired = true; + command.AddOption(teamsAppIdOption); + var teamsAppDefinitionIdOption = new Option("--teamsappdefinition-id", description: "key: id of teamsAppDefinition"); + teamsAppDefinitionIdOption.IsRequired = true; + command.AddOption(teamsAppDefinitionIdOption); command.Handler = CommandHandler.Create(async (teamsAppId, teamsAppDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamsAppId)) requestInfo.PathParameters.Add("teamsApp_id", teamsAppId); - if (!String.IsNullOrEmpty(teamsAppDefinitionId)) requestInfo.PathParameters.Add("teamsAppDefinition_id", teamsAppDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The details for each version of the app."; // Create options for all the parameters - command.AddOption(new Option("--teamsapp-id", description: "key: id of teamsApp")); - command.AddOption(new Option("--teamsappdefinition-id", description: "key: id of teamsAppDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamsAppId, teamsAppDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamsAppId)) requestInfo.PathParameters.Add("teamsApp_id", teamsAppId); - if (!String.IsNullOrEmpty(teamsAppDefinitionId)) requestInfo.PathParameters.Add("teamsAppDefinition_id", teamsAppDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamsAppIdOption = new Option("--teamsapp-id", description: "key: id of teamsApp"); + teamsAppIdOption.IsRequired = true; + command.AddOption(teamsAppIdOption); + var teamsAppDefinitionIdOption = new Option("--teamsappdefinition-id", description: "key: id of teamsAppDefinition"); + teamsAppDefinitionIdOption.IsRequired = true; + command.AddOption(teamsAppDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamsAppId, teamsAppDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The details for each version of the app."; // Create options for all the parameters - command.AddOption(new Option("--teamsapp-id", description: "key: id of teamsApp")); - command.AddOption(new Option("--teamsappdefinition-id", description: "key: id of teamsAppDefinition")); - command.AddOption(new Option("--body")); + var teamsAppIdOption = new Option("--teamsapp-id", description: "key: id of teamsApp"); + teamsAppIdOption.IsRequired = true; + command.AddOption(teamsAppIdOption); + var teamsAppDefinitionIdOption = new Option("--teamsappdefinition-id", description: "key: id of teamsAppDefinition"); + teamsAppDefinitionIdOption.IsRequired = true; + command.AddOption(teamsAppDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamsAppId, teamsAppDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamsAppId)) requestInfo.PathParameters.Add("teamsApp_id", teamsAppId); - if (!String.IsNullOrEmpty(teamsAppDefinitionId)) requestInfo.PathParameters.Add("teamsAppDefinition_id", teamsAppDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/AppCatalogs/TeamsApps/Item/TeamsAppRequestBuilder.cs b/src/generated/AppCatalogs/TeamsApps/Item/TeamsAppRequestBuilder.cs index 343d02e9767..247d0a49254 100644 --- a/src/generated/AppCatalogs/TeamsApps/Item/TeamsAppRequestBuilder.cs +++ b/src/generated/AppCatalogs/TeamsApps/Item/TeamsAppRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property teamsApps for appCatalogs"; // Create options for all the parameters - command.AddOption(new Option("--teamsapp-id", description: "key: id of teamsApp")); + var teamsAppIdOption = new Option("--teamsapp-id", description: "key: id of teamsApp"); + teamsAppIdOption.IsRequired = true; + command.AddOption(teamsAppIdOption); command.Handler = CommandHandler.Create(async (teamsAppId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamsAppId)) requestInfo.PathParameters.Add("teamsApp_id", teamsAppId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get teamsApps from appCatalogs"; // Create options for all the parameters - command.AddOption(new Option("--teamsapp-id", description: "key: id of teamsApp")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamsAppId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamsAppId)) requestInfo.PathParameters.Add("teamsApp_id", teamsAppId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamsAppIdOption = new Option("--teamsapp-id", description: "key: id of teamsApp"); + teamsAppIdOption.IsRequired = true; + command.AddOption(teamsAppIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamsAppId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property teamsApps in appCatalogs"; // Create options for all the parameters - command.AddOption(new Option("--teamsapp-id", description: "key: id of teamsApp")); - command.AddOption(new Option("--body")); + var teamsAppIdOption = new Option("--teamsapp-id", description: "key: id of teamsApp"); + teamsAppIdOption.IsRequired = true; + command.AddOption(teamsAppIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamsAppId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamsAppId)) requestInfo.PathParameters.Add("teamsApp_id", teamsAppId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/AppCatalogs/TeamsApps/TeamsAppsRequestBuilder.cs b/src/generated/AppCatalogs/TeamsApps/TeamsAppsRequestBuilder.cs index c190467fb4a..57bd100d949 100644 --- a/src/generated/AppCatalogs/TeamsApps/TeamsAppsRequestBuilder.cs +++ b/src/generated/AppCatalogs/TeamsApps/TeamsAppsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to teamsApps for appCatalogs"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get teamsApps from appCatalogs"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ApplicationTemplates/ApplicationTemplatesRequestBuilder.cs b/src/generated/ApplicationTemplates/ApplicationTemplatesRequestBuilder.cs index 41e83b16f5b..95d12cce90a 100644 --- a/src/generated/ApplicationTemplates/ApplicationTemplatesRequestBuilder.cs +++ b/src/generated/ApplicationTemplates/ApplicationTemplatesRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to applicationTemplates"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from applicationTemplates"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ApplicationTemplates/Item/ApplicationTemplateRequestBuilder.cs b/src/generated/ApplicationTemplates/Item/ApplicationTemplateRequestBuilder.cs index 31545c4acce..942abcc4b00 100644 --- a/src/generated/ApplicationTemplates/Item/ApplicationTemplateRequestBuilder.cs +++ b/src/generated/ApplicationTemplates/Item/ApplicationTemplateRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from applicationTemplates"; // Create options for all the parameters - command.AddOption(new Option("--applicationtemplate-id", description: "key: id of applicationTemplate")); + var applicationTemplateIdOption = new Option("--applicationtemplate-id", description: "key: id of applicationTemplate"); + applicationTemplateIdOption.IsRequired = true; + command.AddOption(applicationTemplateIdOption); command.Handler = CommandHandler.Create(async (applicationTemplateId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(applicationTemplateId)) requestInfo.PathParameters.Add("applicationTemplate_id", applicationTemplateId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from applicationTemplates by key"; // Create options for all the parameters - command.AddOption(new Option("--applicationtemplate-id", description: "key: id of applicationTemplate")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (applicationTemplateId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationTemplateId)) requestInfo.PathParameters.Add("applicationTemplate_id", applicationTemplateId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var applicationTemplateIdOption = new Option("--applicationtemplate-id", description: "key: id of applicationTemplate"); + applicationTemplateIdOption.IsRequired = true; + command.AddOption(applicationTemplateIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (applicationTemplateId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,14 +86,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in applicationTemplates"; // Create options for all the parameters - command.AddOption(new Option("--applicationtemplate-id", description: "key: id of applicationTemplate")); - command.AddOption(new Option("--body")); + var applicationTemplateIdOption = new Option("--applicationtemplate-id", description: "key: id of applicationTemplate"); + applicationTemplateIdOption.IsRequired = true; + command.AddOption(applicationTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(applicationTemplateId)) requestInfo.PathParameters.Add("applicationTemplate_id", applicationTemplateId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/ApplicationTemplates/Item/Instantiate/InstantiateRequestBuilder.cs b/src/generated/ApplicationTemplates/Item/Instantiate/InstantiateRequestBuilder.cs index b6a143972ff..21fc06698be 100644 --- a/src/generated/ApplicationTemplates/Item/Instantiate/InstantiateRequestBuilder.cs +++ b/src/generated/ApplicationTemplates/Item/Instantiate/InstantiateRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action instantiate"; // Create options for all the parameters - command.AddOption(new Option("--applicationtemplate-id", description: "key: id of applicationTemplate")); - command.AddOption(new Option("--body")); + var applicationTemplateIdOption = new Option("--applicationtemplate-id", description: "key: id of applicationTemplate"); + applicationTemplateIdOption.IsRequired = true; + command.AddOption(applicationTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationTemplateId)) requestInfo.PathParameters.Add("applicationTemplate_id", applicationTemplateId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/ApplicationsRequestBuilder.cs b/src/generated/Applications/ApplicationsRequestBuilder.cs index 1566041e5bd..9396f885f35 100644 --- a/src/generated/Applications/ApplicationsRequestBuilder.cs +++ b/src/generated/Applications/ApplicationsRequestBuilder.cs @@ -58,12 +58,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to applications"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -94,24 +97,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from applications"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Delta/DeltaRequestBuilder.cs b/src/generated/Applications/Delta/DeltaRequestBuilder.cs index 65a1a03079b..173e4d97ece 100644 --- a/src/generated/Applications/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Applications/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs b/src/generated/Applications/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs index 8644b1d66eb..08cbe0f8a5d 100644 --- a/src/generated/Applications/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs +++ b/src/generated/Applications/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getAvailableExtensionProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/GetByIds/GetByIdsRequestBuilder.cs b/src/generated/Applications/GetByIds/GetByIdsRequestBuilder.cs index d682ff94c69..580a44a917b 100644 --- a/src/generated/Applications/GetByIds/GetByIdsRequestBuilder.cs +++ b/src/generated/Applications/GetByIds/GetByIdsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getByIds"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/AddKey/AddKeyRequestBuilder.cs b/src/generated/Applications/Item/AddKey/AddKeyRequestBuilder.cs index da5b6f12937..977e536d1a3 100644 --- a/src/generated/Applications/Item/AddKey/AddKeyRequestBuilder.cs +++ b/src/generated/Applications/Item/AddKey/AddKeyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addKey"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/AddPassword/AddPasswordRequestBuilder.cs b/src/generated/Applications/Item/AddPassword/AddPasswordRequestBuilder.cs index f840db8588e..218b114bfcf 100644 --- a/src/generated/Applications/Item/AddPassword/AddPasswordRequestBuilder.cs +++ b/src/generated/Applications/Item/AddPassword/AddPasswordRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addPassword"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/ApplicationRequestBuilder.cs b/src/generated/Applications/Item/ApplicationRequestBuilder.cs index 12e453a9f3e..8cf2a463c7a 100644 --- a/src/generated/Applications/Item/ApplicationRequestBuilder.cs +++ b/src/generated/Applications/Item/ApplicationRequestBuilder.cs @@ -75,10 +75,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from applications"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); command.Handler = CommandHandler.Create(async (applicationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -99,14 +101,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from applications by key"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (applicationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (applicationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -158,14 +168,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in applications"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Applications/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs b/src/generated/Applications/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs index 2e55c9292b5..0412ebb9bef 100644 --- a/src/generated/Applications/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs +++ b/src/generated/Applications/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs b/src/generated/Applications/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs index 6bfc4f2cb80..a8ddf6e6d4b 100644 --- a/src/generated/Applications/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs +++ b/src/generated/Applications/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/CreatedOnBehalfOf/@Ref/RefRequestBuilder.cs b/src/generated/Applications/Item/CreatedOnBehalfOf/@Ref/RefRequestBuilder.cs index 6ead6217bae..96bb69e8a0c 100644 --- a/src/generated/Applications/Item/CreatedOnBehalfOf/@Ref/RefRequestBuilder.cs +++ b/src/generated/Applications/Item/CreatedOnBehalfOf/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); command.Handler = CommandHandler.Create(async (applicationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); command.Handler = CommandHandler.Create(async (applicationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Read-only."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Applications/Item/CreatedOnBehalfOf/CreatedOnBehalfOfRequestBuilder.cs b/src/generated/Applications/Item/CreatedOnBehalfOf/CreatedOnBehalfOfRequestBuilder.cs index d693e6710ac..659dd46d02f 100644 --- a/src/generated/Applications/Item/CreatedOnBehalfOf/CreatedOnBehalfOfRequestBuilder.cs +++ b/src/generated/Applications/Item/CreatedOnBehalfOf/CreatedOnBehalfOfRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (applicationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (applicationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/ExtensionProperties/ExtensionPropertiesRequestBuilder.cs b/src/generated/Applications/Item/ExtensionProperties/ExtensionPropertiesRequestBuilder.cs index 3c876c6f8dc..a1db35a224d 100644 --- a/src/generated/Applications/Item/ExtensionProperties/ExtensionPropertiesRequestBuilder.cs +++ b/src/generated/Applications/Item/ExtensionProperties/ExtensionPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/ExtensionProperties/Item/ExtensionPropertyRequestBuilder.cs b/src/generated/Applications/Item/ExtensionProperties/Item/ExtensionPropertyRequestBuilder.cs index a8b256bc03d..41e104d1d9c 100644 --- a/src/generated/Applications/Item/ExtensionProperties/Item/ExtensionPropertyRequestBuilder.cs +++ b/src/generated/Applications/Item/ExtensionProperties/Item/ExtensionPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--extensionproperty-id", description: "key: id of extensionProperty")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var extensionPropertyIdOption = new Option("--extensionproperty-id", description: "key: id of extensionProperty"); + extensionPropertyIdOption.IsRequired = true; + command.AddOption(extensionPropertyIdOption); command.Handler = CommandHandler.Create(async (applicationId, extensionPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); - if (!String.IsNullOrEmpty(extensionPropertyId)) requestInfo.PathParameters.Add("extensionProperty_id", extensionPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--extensionproperty-id", description: "key: id of extensionProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (applicationId, extensionPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); - if (!String.IsNullOrEmpty(extensionPropertyId)) requestInfo.PathParameters.Add("extensionProperty_id", extensionPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var extensionPropertyIdOption = new Option("--extensionproperty-id", description: "key: id of extensionProperty"); + extensionPropertyIdOption.IsRequired = true; + command.AddOption(extensionPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (applicationId, extensionPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--extensionproperty-id", description: "key: id of extensionProperty")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var extensionPropertyIdOption = new Option("--extensionproperty-id", description: "key: id of extensionProperty"); + extensionPropertyIdOption.IsRequired = true; + command.AddOption(extensionPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, extensionPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); - if (!String.IsNullOrEmpty(extensionPropertyId)) requestInfo.PathParameters.Add("extensionProperty_id", extensionPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Applications/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs b/src/generated/Applications/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs index f774909cc7c..0b7544fbbcc 100644 --- a/src/generated/Applications/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs +++ b/src/generated/Applications/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs b/src/generated/Applications/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs index 02032fef8ff..ab46af1cd49 100644 --- a/src/generated/Applications/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs +++ b/src/generated/Applications/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/HomeRealmDiscoveryPolicies/@Ref/RefRequestBuilder.cs b/src/generated/Applications/Item/HomeRealmDiscoveryPolicies/@Ref/RefRequestBuilder.cs index 2b2db851c12..d822a0e32d0 100644 --- a/src/generated/Applications/Item/HomeRealmDiscoveryPolicies/@Ref/RefRequestBuilder.cs +++ b/src/generated/Applications/Item/HomeRealmDiscoveryPolicies/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of homeRealmDiscoveryPolicies from applications"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Create new navigation property ref to homeRealmDiscoveryPolicies for applications"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/HomeRealmDiscoveryPolicies/HomeRealmDiscoveryPoliciesRequestBuilder.cs b/src/generated/Applications/Item/HomeRealmDiscoveryPolicies/HomeRealmDiscoveryPoliciesRequestBuilder.cs index f9380c838c4..e8957f3526d 100644 --- a/src/generated/Applications/Item/HomeRealmDiscoveryPolicies/HomeRealmDiscoveryPoliciesRequestBuilder.cs +++ b/src/generated/Applications/Item/HomeRealmDiscoveryPolicies/HomeRealmDiscoveryPoliciesRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get homeRealmDiscoveryPolicies from applications"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/Logo/LogoRequestBuilder.cs b/src/generated/Applications/Item/Logo/LogoRequestBuilder.cs index 0faa5630307..b20da4fc71f 100644 --- a/src/generated/Applications/Item/Logo/LogoRequestBuilder.cs +++ b/src/generated/Applications/Item/Logo/LogoRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The main logo for the application. Not nullable."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (applicationId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The main logo for the application. Not nullable."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--file", description: "Binary request body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (applicationId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Applications/Item/Owners/@Ref/RefRequestBuilder.cs b/src/generated/Applications/Item/Owners/@Ref/RefRequestBuilder.cs index b93356d1a2b..62d4d446a53 100644 --- a/src/generated/Applications/Item/Owners/@Ref/RefRequestBuilder.cs +++ b/src/generated/Applications/Item/Owners/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects that are owners of the application. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Directory objects that are owners of the application. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/Owners/OwnersRequestBuilder.cs b/src/generated/Applications/Item/Owners/OwnersRequestBuilder.cs index d3ea8bb81d3..8bb89428f65 100644 --- a/src/generated/Applications/Item/Owners/OwnersRequestBuilder.cs +++ b/src/generated/Applications/Item/Owners/OwnersRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects that are owners of the application. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/RemoveKey/RemoveKeyRequestBuilder.cs b/src/generated/Applications/Item/RemoveKey/RemoveKeyRequestBuilder.cs index 026cc399770..b2da06d8782 100644 --- a/src/generated/Applications/Item/RemoveKey/RemoveKeyRequestBuilder.cs +++ b/src/generated/Applications/Item/RemoveKey/RemoveKeyRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action removeKey"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Applications/Item/RemovePassword/RemovePasswordRequestBuilder.cs b/src/generated/Applications/Item/RemovePassword/RemovePasswordRequestBuilder.cs index 3ba40205e25..bda090dc809 100644 --- a/src/generated/Applications/Item/RemovePassword/RemovePasswordRequestBuilder.cs +++ b/src/generated/Applications/Item/RemovePassword/RemovePasswordRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action removePassword"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Applications/Item/Restore/RestoreRequestBuilder.cs b/src/generated/Applications/Item/Restore/RestoreRequestBuilder.cs index fa920491476..e103e3cbf9c 100644 --- a/src/generated/Applications/Item/Restore/RestoreRequestBuilder.cs +++ b/src/generated/Applications/Item/Restore/RestoreRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restore"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); command.Handler = CommandHandler.Create(async (applicationId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/SetVerifiedPublisher/SetVerifiedPublisherRequestBuilder.cs b/src/generated/Applications/Item/SetVerifiedPublisher/SetVerifiedPublisherRequestBuilder.cs index 48c41694d47..251ebe53367 100644 --- a/src/generated/Applications/Item/SetVerifiedPublisher/SetVerifiedPublisherRequestBuilder.cs +++ b/src/generated/Applications/Item/SetVerifiedPublisher/SetVerifiedPublisherRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setVerifiedPublisher"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Applications/Item/TokenIssuancePolicies/@Ref/RefRequestBuilder.cs b/src/generated/Applications/Item/TokenIssuancePolicies/@Ref/RefRequestBuilder.cs index 6b0061f7e1e..57d09a88a8a 100644 --- a/src/generated/Applications/Item/TokenIssuancePolicies/@Ref/RefRequestBuilder.cs +++ b/src/generated/Applications/Item/TokenIssuancePolicies/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of tokenIssuancePolicies from applications"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Create new navigation property ref to tokenIssuancePolicies for applications"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/TokenIssuancePolicies/TokenIssuancePoliciesRequestBuilder.cs b/src/generated/Applications/Item/TokenIssuancePolicies/TokenIssuancePoliciesRequestBuilder.cs index cb42ccee429..698f549fc60 100644 --- a/src/generated/Applications/Item/TokenIssuancePolicies/TokenIssuancePoliciesRequestBuilder.cs +++ b/src/generated/Applications/Item/TokenIssuancePolicies/TokenIssuancePoliciesRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get tokenIssuancePolicies from applications"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/TokenLifetimePolicies/@Ref/RefRequestBuilder.cs b/src/generated/Applications/Item/TokenLifetimePolicies/@Ref/RefRequestBuilder.cs index ed4ed4510f1..d17755a0c30 100644 --- a/src/generated/Applications/Item/TokenLifetimePolicies/@Ref/RefRequestBuilder.cs +++ b/src/generated/Applications/Item/TokenLifetimePolicies/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The tokenLifetimePolicies assigned to this application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The tokenLifetimePolicies assigned to this application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--body")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (applicationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/TokenLifetimePolicies/TokenLifetimePoliciesRequestBuilder.cs b/src/generated/Applications/Item/TokenLifetimePolicies/TokenLifetimePoliciesRequestBuilder.cs index 76887275147..c1fed7539ad 100644 --- a/src/generated/Applications/Item/TokenLifetimePolicies/TokenLifetimePoliciesRequestBuilder.cs +++ b/src/generated/Applications/Item/TokenLifetimePolicies/TokenLifetimePoliciesRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The tokenLifetimePolicies assigned to this application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (applicationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Applications/Item/UnsetVerifiedPublisher/UnsetVerifiedPublisherRequestBuilder.cs b/src/generated/Applications/Item/UnsetVerifiedPublisher/UnsetVerifiedPublisherRequestBuilder.cs index 95f792e2085..88027971684 100644 --- a/src/generated/Applications/Item/UnsetVerifiedPublisher/UnsetVerifiedPublisherRequestBuilder.cs +++ b/src/generated/Applications/Item/UnsetVerifiedPublisher/UnsetVerifiedPublisherRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unsetVerifiedPublisher"; // Create options for all the parameters - command.AddOption(new Option("--application-id", description: "key: id of application")); + var applicationIdOption = new Option("--application-id", description: "key: id of application"); + applicationIdOption.IsRequired = true; + command.AddOption(applicationIdOption); command.Handler = CommandHandler.Create(async (applicationId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(applicationId)) requestInfo.PathParameters.Add("application_id", applicationId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Applications/ValidateProperties/ValidatePropertiesRequestBuilder.cs b/src/generated/Applications/ValidateProperties/ValidatePropertiesRequestBuilder.cs index 6d5878b158b..b9b6240bfc0 100644 --- a/src/generated/Applications/ValidateProperties/ValidatePropertiesRequestBuilder.cs +++ b/src/generated/Applications/ValidateProperties/ValidatePropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validateProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/AuditLogs/AuditLogsRequestBuilder.cs b/src/generated/AuditLogs/AuditLogsRequestBuilder.cs index 07ecbd69d4a..4e60547c839 100644 --- a/src/generated/AuditLogs/AuditLogsRequestBuilder.cs +++ b/src/generated/AuditLogs/AuditLogsRequestBuilder.cs @@ -37,12 +37,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get auditLogs"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,12 +68,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update auditLogs"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/AuditLogs/DirectoryAudits/DirectoryAuditsRequestBuilder.cs b/src/generated/AuditLogs/DirectoryAudits/DirectoryAuditsRequestBuilder.cs index 4c8dfde18a3..54825052d33 100644 --- a/src/generated/AuditLogs/DirectoryAudits/DirectoryAuditsRequestBuilder.cs +++ b/src/generated/AuditLogs/DirectoryAudits/DirectoryAuditsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/AuditLogs/DirectoryAudits/Item/DirectoryAuditRequestBuilder.cs b/src/generated/AuditLogs/DirectoryAudits/Item/DirectoryAuditRequestBuilder.cs index 24d5022e875..de1e0388439 100644 --- a/src/generated/AuditLogs/DirectoryAudits/Item/DirectoryAuditRequestBuilder.cs +++ b/src/generated/AuditLogs/DirectoryAudits/Item/DirectoryAuditRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--directoryaudit-id", description: "key: id of directoryAudit")); + var directoryAuditIdOption = new Option("--directoryaudit-id", description: "key: id of directoryAudit"); + directoryAuditIdOption.IsRequired = true; + command.AddOption(directoryAuditIdOption); command.Handler = CommandHandler.Create(async (directoryAuditId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(directoryAuditId)) requestInfo.PathParameters.Add("directoryAudit_id", directoryAuditId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--directoryaudit-id", description: "key: id of directoryAudit")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (directoryAuditId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(directoryAuditId)) requestInfo.PathParameters.Add("directoryAudit_id", directoryAuditId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var directoryAuditIdOption = new Option("--directoryaudit-id", description: "key: id of directoryAudit"); + directoryAuditIdOption.IsRequired = true; + command.AddOption(directoryAuditIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (directoryAuditId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--directoryaudit-id", description: "key: id of directoryAudit")); - command.AddOption(new Option("--body")); + var directoryAuditIdOption = new Option("--directoryaudit-id", description: "key: id of directoryAudit"); + directoryAuditIdOption.IsRequired = true; + command.AddOption(directoryAuditIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryAuditId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(directoryAuditId)) requestInfo.PathParameters.Add("directoryAudit_id", directoryAuditId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/AuditLogs/Provisioning/Item/ProvisioningObjectSummaryRequestBuilder.cs b/src/generated/AuditLogs/Provisioning/Item/ProvisioningObjectSummaryRequestBuilder.cs index 45d40ea30da..3d972de8638 100644 --- a/src/generated/AuditLogs/Provisioning/Item/ProvisioningObjectSummaryRequestBuilder.cs +++ b/src/generated/AuditLogs/Provisioning/Item/ProvisioningObjectSummaryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property provisioning for auditLogs"; // Create options for all the parameters - command.AddOption(new Option("--provisioningobjectsummary-id", description: "key: id of provisioningObjectSummary")); + var provisioningObjectSummaryIdOption = new Option("--provisioningobjectsummary-id", description: "key: id of provisioningObjectSummary"); + provisioningObjectSummaryIdOption.IsRequired = true; + command.AddOption(provisioningObjectSummaryIdOption); command.Handler = CommandHandler.Create(async (provisioningObjectSummaryId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(provisioningObjectSummaryId)) requestInfo.PathParameters.Add("provisioningObjectSummary_id", provisioningObjectSummaryId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get provisioning from auditLogs"; // Create options for all the parameters - command.AddOption(new Option("--provisioningobjectsummary-id", description: "key: id of provisioningObjectSummary")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (provisioningObjectSummaryId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(provisioningObjectSummaryId)) requestInfo.PathParameters.Add("provisioningObjectSummary_id", provisioningObjectSummaryId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var provisioningObjectSummaryIdOption = new Option("--provisioningobjectsummary-id", description: "key: id of provisioningObjectSummary"); + provisioningObjectSummaryIdOption.IsRequired = true; + command.AddOption(provisioningObjectSummaryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (provisioningObjectSummaryId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property provisioning in auditLogs"; // Create options for all the parameters - command.AddOption(new Option("--provisioningobjectsummary-id", description: "key: id of provisioningObjectSummary")); - command.AddOption(new Option("--body")); + var provisioningObjectSummaryIdOption = new Option("--provisioningobjectsummary-id", description: "key: id of provisioningObjectSummary"); + provisioningObjectSummaryIdOption.IsRequired = true; + command.AddOption(provisioningObjectSummaryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (provisioningObjectSummaryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(provisioningObjectSummaryId)) requestInfo.PathParameters.Add("provisioningObjectSummary_id", provisioningObjectSummaryId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/AuditLogs/Provisioning/ProvisioningRequestBuilder.cs b/src/generated/AuditLogs/Provisioning/ProvisioningRequestBuilder.cs index 10476421af4..3d6de5f451a 100644 --- a/src/generated/AuditLogs/Provisioning/ProvisioningRequestBuilder.cs +++ b/src/generated/AuditLogs/Provisioning/ProvisioningRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to provisioning for auditLogs"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get provisioning from auditLogs"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/AuditLogs/RestrictedSignIns/Item/RestrictedSignInRequestBuilder.cs b/src/generated/AuditLogs/RestrictedSignIns/Item/RestrictedSignInRequestBuilder.cs index c355d4d7703..bd489d4a202 100644 --- a/src/generated/AuditLogs/RestrictedSignIns/Item/RestrictedSignInRequestBuilder.cs +++ b/src/generated/AuditLogs/RestrictedSignIns/Item/RestrictedSignInRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property restrictedSignIns for auditLogs"; // Create options for all the parameters - command.AddOption(new Option("--restrictedsignin-id", description: "key: id of restrictedSignIn")); + var restrictedSignInIdOption = new Option("--restrictedsignin-id", description: "key: id of restrictedSignIn"); + restrictedSignInIdOption.IsRequired = true; + command.AddOption(restrictedSignInIdOption); command.Handler = CommandHandler.Create(async (restrictedSignInId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(restrictedSignInId)) requestInfo.PathParameters.Add("restrictedSignIn_id", restrictedSignInId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get restrictedSignIns from auditLogs"; // Create options for all the parameters - command.AddOption(new Option("--restrictedsignin-id", description: "key: id of restrictedSignIn")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (restrictedSignInId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(restrictedSignInId)) requestInfo.PathParameters.Add("restrictedSignIn_id", restrictedSignInId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var restrictedSignInIdOption = new Option("--restrictedsignin-id", description: "key: id of restrictedSignIn"); + restrictedSignInIdOption.IsRequired = true; + command.AddOption(restrictedSignInIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (restrictedSignInId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property restrictedSignIns in auditLogs"; // Create options for all the parameters - command.AddOption(new Option("--restrictedsignin-id", description: "key: id of restrictedSignIn")); - command.AddOption(new Option("--body")); + var restrictedSignInIdOption = new Option("--restrictedsignin-id", description: "key: id of restrictedSignIn"); + restrictedSignInIdOption.IsRequired = true; + command.AddOption(restrictedSignInIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (restrictedSignInId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(restrictedSignInId)) requestInfo.PathParameters.Add("restrictedSignIn_id", restrictedSignInId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/AuditLogs/RestrictedSignIns/RestrictedSignInsRequestBuilder.cs b/src/generated/AuditLogs/RestrictedSignIns/RestrictedSignInsRequestBuilder.cs index 174b7393f74..1ff2e2767eb 100644 --- a/src/generated/AuditLogs/RestrictedSignIns/RestrictedSignInsRequestBuilder.cs +++ b/src/generated/AuditLogs/RestrictedSignIns/RestrictedSignInsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to restrictedSignIns for auditLogs"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get restrictedSignIns from auditLogs"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/AuditLogs/SignIns/Item/SignInRequestBuilder.cs b/src/generated/AuditLogs/SignIns/Item/SignInRequestBuilder.cs index 1a163ca7766..34c1fa29d3e 100644 --- a/src/generated/AuditLogs/SignIns/Item/SignInRequestBuilder.cs +++ b/src/generated/AuditLogs/SignIns/Item/SignInRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--signin-id", description: "key: id of signIn")); + var signInIdOption = new Option("--signin-id", description: "key: id of signIn"); + signInIdOption.IsRequired = true; + command.AddOption(signInIdOption); command.Handler = CommandHandler.Create(async (signInId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(signInId)) requestInfo.PathParameters.Add("signIn_id", signInId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--signin-id", description: "key: id of signIn")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (signInId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(signInId)) requestInfo.PathParameters.Add("signIn_id", signInId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var signInIdOption = new Option("--signin-id", description: "key: id of signIn"); + signInIdOption.IsRequired = true; + command.AddOption(signInIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (signInId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--signin-id", description: "key: id of signIn")); - command.AddOption(new Option("--body")); + var signInIdOption = new Option("--signin-id", description: "key: id of signIn"); + signInIdOption.IsRequired = true; + command.AddOption(signInIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (signInId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(signInId)) requestInfo.PathParameters.Add("signIn_id", signInId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/AuditLogs/SignIns/SignInsRequestBuilder.cs b/src/generated/AuditLogs/SignIns/SignInsRequestBuilder.cs index 698a1576760..2114b14948e 100644 --- a/src/generated/AuditLogs/SignIns/SignInsRequestBuilder.cs +++ b/src/generated/AuditLogs/SignIns/SignInsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/AuthenticationMethodConfigurations/AuthenticationMethodConfigurationsRequestBuilder.cs b/src/generated/AuthenticationMethodConfigurations/AuthenticationMethodConfigurationsRequestBuilder.cs index 987b35bd923..d825636cb31 100644 --- a/src/generated/AuthenticationMethodConfigurations/AuthenticationMethodConfigurationsRequestBuilder.cs +++ b/src/generated/AuthenticationMethodConfigurations/AuthenticationMethodConfigurationsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to authenticationMethodConfigurations"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from authenticationMethodConfigurations"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/AuthenticationMethodConfigurations/Item/AuthenticationMethodConfigurationRequestBuilder.cs b/src/generated/AuthenticationMethodConfigurations/Item/AuthenticationMethodConfigurationRequestBuilder.cs index 397b1355e7f..680a7abf1b8 100644 --- a/src/generated/AuthenticationMethodConfigurations/Item/AuthenticationMethodConfigurationRequestBuilder.cs +++ b/src/generated/AuthenticationMethodConfigurations/Item/AuthenticationMethodConfigurationRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from authenticationMethodConfigurations"; // Create options for all the parameters - command.AddOption(new Option("--authenticationmethodconfiguration-id", description: "key: id of authenticationMethodConfiguration")); + var authenticationMethodConfigurationIdOption = new Option("--authenticationmethodconfiguration-id", description: "key: id of authenticationMethodConfiguration"); + authenticationMethodConfigurationIdOption.IsRequired = true; + command.AddOption(authenticationMethodConfigurationIdOption); command.Handler = CommandHandler.Create(async (authenticationMethodConfigurationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(authenticationMethodConfigurationId)) requestInfo.PathParameters.Add("authenticationMethodConfiguration_id", authenticationMethodConfigurationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from authenticationMethodConfigurations by key"; // Create options for all the parameters - command.AddOption(new Option("--authenticationmethodconfiguration-id", description: "key: id of authenticationMethodConfiguration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (authenticationMethodConfigurationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(authenticationMethodConfigurationId)) requestInfo.PathParameters.Add("authenticationMethodConfiguration_id", authenticationMethodConfigurationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var authenticationMethodConfigurationIdOption = new Option("--authenticationmethodconfiguration-id", description: "key: id of authenticationMethodConfiguration"); + authenticationMethodConfigurationIdOption.IsRequired = true; + command.AddOption(authenticationMethodConfigurationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (authenticationMethodConfigurationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in authenticationMethodConfigurations"; // Create options for all the parameters - command.AddOption(new Option("--authenticationmethodconfiguration-id", description: "key: id of authenticationMethodConfiguration")); - command.AddOption(new Option("--body")); + var authenticationMethodConfigurationIdOption = new Option("--authenticationmethodconfiguration-id", description: "key: id of authenticationMethodConfiguration"); + authenticationMethodConfigurationIdOption.IsRequired = true; + command.AddOption(authenticationMethodConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (authenticationMethodConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(authenticationMethodConfigurationId)) requestInfo.PathParameters.Add("authenticationMethodConfiguration_id", authenticationMethodConfigurationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/AuthenticationMethodsPolicy/AuthenticationMethodConfigurations/AuthenticationMethodConfigurationsRequestBuilder.cs b/src/generated/AuthenticationMethodsPolicy/AuthenticationMethodConfigurations/AuthenticationMethodConfigurationsRequestBuilder.cs index 382a9fd1cfc..665a955773c 100644 --- a/src/generated/AuthenticationMethodsPolicy/AuthenticationMethodConfigurations/AuthenticationMethodConfigurationsRequestBuilder.cs +++ b/src/generated/AuthenticationMethodsPolicy/AuthenticationMethodConfigurations/AuthenticationMethodConfigurationsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents the settings for each authentication method."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents the settings for each authentication method."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/AuthenticationMethodsPolicy/AuthenticationMethodConfigurations/Item/AuthenticationMethodConfigurationRequestBuilder.cs b/src/generated/AuthenticationMethodsPolicy/AuthenticationMethodConfigurations/Item/AuthenticationMethodConfigurationRequestBuilder.cs index 966616ba289..e44330e9c76 100644 --- a/src/generated/AuthenticationMethodsPolicy/AuthenticationMethodConfigurations/Item/AuthenticationMethodConfigurationRequestBuilder.cs +++ b/src/generated/AuthenticationMethodsPolicy/AuthenticationMethodConfigurations/Item/AuthenticationMethodConfigurationRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the settings for each authentication method."; // Create options for all the parameters - command.AddOption(new Option("--authenticationmethodconfiguration-id", description: "key: id of authenticationMethodConfiguration")); + var authenticationMethodConfigurationIdOption = new Option("--authenticationmethodconfiguration-id", description: "key: id of authenticationMethodConfiguration"); + authenticationMethodConfigurationIdOption.IsRequired = true; + command.AddOption(authenticationMethodConfigurationIdOption); command.Handler = CommandHandler.Create(async (authenticationMethodConfigurationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(authenticationMethodConfigurationId)) requestInfo.PathParameters.Add("authenticationMethodConfiguration_id", authenticationMethodConfigurationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the settings for each authentication method."; // Create options for all the parameters - command.AddOption(new Option("--authenticationmethodconfiguration-id", description: "key: id of authenticationMethodConfiguration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (authenticationMethodConfigurationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(authenticationMethodConfigurationId)) requestInfo.PathParameters.Add("authenticationMethodConfiguration_id", authenticationMethodConfigurationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var authenticationMethodConfigurationIdOption = new Option("--authenticationmethodconfiguration-id", description: "key: id of authenticationMethodConfiguration"); + authenticationMethodConfigurationIdOption.IsRequired = true; + command.AddOption(authenticationMethodConfigurationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (authenticationMethodConfigurationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the settings for each authentication method."; // Create options for all the parameters - command.AddOption(new Option("--authenticationmethodconfiguration-id", description: "key: id of authenticationMethodConfiguration")); - command.AddOption(new Option("--body")); + var authenticationMethodConfigurationIdOption = new Option("--authenticationmethodconfiguration-id", description: "key: id of authenticationMethodConfiguration"); + authenticationMethodConfigurationIdOption.IsRequired = true; + command.AddOption(authenticationMethodConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (authenticationMethodConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(authenticationMethodConfigurationId)) requestInfo.PathParameters.Add("authenticationMethodConfiguration_id", authenticationMethodConfigurationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/AuthenticationMethodsPolicy/AuthenticationMethodsPolicyRequestBuilder.cs b/src/generated/AuthenticationMethodsPolicy/AuthenticationMethodsPolicyRequestBuilder.cs index 186c0072a59..a4c27501c15 100644 --- a/src/generated/AuthenticationMethodsPolicy/AuthenticationMethodsPolicyRequestBuilder.cs +++ b/src/generated/AuthenticationMethodsPolicy/AuthenticationMethodsPolicyRequestBuilder.cs @@ -34,12 +34,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get authenticationMethodsPolicy"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,12 +65,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update authenticationMethodsPolicy"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Branding/BrandingRequestBuilder.cs b/src/generated/Branding/BrandingRequestBuilder.cs index 364ffbcb703..797f2e23029 100644 --- a/src/generated/Branding/BrandingRequestBuilder.cs +++ b/src/generated/Branding/BrandingRequestBuilder.cs @@ -27,12 +27,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get branding"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,12 +65,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update branding"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Branding/Localizations/Item/OrganizationalBrandingLocalizationRequestBuilder.cs b/src/generated/Branding/Localizations/Item/OrganizationalBrandingLocalizationRequestBuilder.cs index 845a14733c9..2e5aee547a9 100644 --- a/src/generated/Branding/Localizations/Item/OrganizationalBrandingLocalizationRequestBuilder.cs +++ b/src/generated/Branding/Localizations/Item/OrganizationalBrandingLocalizationRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Add different branding based on a locale."; // Create options for all the parameters - command.AddOption(new Option("--organizationalbrandinglocalization-id", description: "key: id of organizationalBrandingLocalization")); + var organizationalBrandingLocalizationIdOption = new Option("--organizationalbrandinglocalization-id", description: "key: id of organizationalBrandingLocalization"); + organizationalBrandingLocalizationIdOption.IsRequired = true; + command.AddOption(organizationalBrandingLocalizationIdOption); command.Handler = CommandHandler.Create(async (organizationalBrandingLocalizationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(organizationalBrandingLocalizationId)) requestInfo.PathParameters.Add("organizationalBrandingLocalization_id", organizationalBrandingLocalizationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Add different branding based on a locale."; // Create options for all the parameters - command.AddOption(new Option("--organizationalbrandinglocalization-id", description: "key: id of organizationalBrandingLocalization")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (organizationalBrandingLocalizationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(organizationalBrandingLocalizationId)) requestInfo.PathParameters.Add("organizationalBrandingLocalization_id", organizationalBrandingLocalizationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var organizationalBrandingLocalizationIdOption = new Option("--organizationalbrandinglocalization-id", description: "key: id of organizationalBrandingLocalization"); + organizationalBrandingLocalizationIdOption.IsRequired = true; + command.AddOption(organizationalBrandingLocalizationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (organizationalBrandingLocalizationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Add different branding based on a locale."; // Create options for all the parameters - command.AddOption(new Option("--organizationalbrandinglocalization-id", description: "key: id of organizationalBrandingLocalization")); - command.AddOption(new Option("--body")); + var organizationalBrandingLocalizationIdOption = new Option("--organizationalbrandinglocalization-id", description: "key: id of organizationalBrandingLocalization"); + organizationalBrandingLocalizationIdOption.IsRequired = true; + command.AddOption(organizationalBrandingLocalizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (organizationalBrandingLocalizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(organizationalBrandingLocalizationId)) requestInfo.PathParameters.Add("organizationalBrandingLocalization_id", organizationalBrandingLocalizationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Branding/Localizations/LocalizationsRequestBuilder.cs b/src/generated/Branding/Localizations/LocalizationsRequestBuilder.cs index 51ab681bfc2..00bbbc8c36b 100644 --- a/src/generated/Branding/Localizations/LocalizationsRequestBuilder.cs +++ b/src/generated/Branding/Localizations/LocalizationsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add different branding based on a locale."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Add different branding based on a locale."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/CertificateBasedAuthConfiguration/CertificateBasedAuthConfigurationRequestBuilder.cs b/src/generated/CertificateBasedAuthConfiguration/CertificateBasedAuthConfigurationRequestBuilder.cs index 4c4f1088626..4597d9ad376 100644 --- a/src/generated/CertificateBasedAuthConfiguration/CertificateBasedAuthConfigurationRequestBuilder.cs +++ b/src/generated/CertificateBasedAuthConfiguration/CertificateBasedAuthConfigurationRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to certificateBasedAuthConfiguration"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,24 +61,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from certificateBasedAuthConfiguration"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/CertificateBasedAuthConfiguration/Item/CertificateBasedAuthConfigurationRequestBuilder.cs b/src/generated/CertificateBasedAuthConfiguration/Item/CertificateBasedAuthConfigurationRequestBuilder.cs index e6db4e07ef9..568a0f41b23 100644 --- a/src/generated/CertificateBasedAuthConfiguration/Item/CertificateBasedAuthConfigurationRequestBuilder.cs +++ b/src/generated/CertificateBasedAuthConfiguration/Item/CertificateBasedAuthConfigurationRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from certificateBasedAuthConfiguration"; // Create options for all the parameters - command.AddOption(new Option("--certificatebasedauthconfiguration-id", description: "key: id of certificateBasedAuthConfiguration")); + var certificateBasedAuthConfigurationIdOption = new Option("--certificatebasedauthconfiguration-id", description: "key: id of certificateBasedAuthConfiguration"); + certificateBasedAuthConfigurationIdOption.IsRequired = true; + command.AddOption(certificateBasedAuthConfigurationIdOption); command.Handler = CommandHandler.Create(async (certificateBasedAuthConfigurationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(certificateBasedAuthConfigurationId)) requestInfo.PathParameters.Add("certificateBasedAuthConfiguration_id", certificateBasedAuthConfigurationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from certificateBasedAuthConfiguration by key"; // Create options for all the parameters - command.AddOption(new Option("--certificatebasedauthconfiguration-id", description: "key: id of certificateBasedAuthConfiguration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (certificateBasedAuthConfigurationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(certificateBasedAuthConfigurationId)) requestInfo.PathParameters.Add("certificateBasedAuthConfiguration_id", certificateBasedAuthConfigurationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var certificateBasedAuthConfigurationIdOption = new Option("--certificatebasedauthconfiguration-id", description: "key: id of certificateBasedAuthConfiguration"); + certificateBasedAuthConfigurationIdOption.IsRequired = true; + command.AddOption(certificateBasedAuthConfigurationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (certificateBasedAuthConfigurationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in certificateBasedAuthConfiguration"; // Create options for all the parameters - command.AddOption(new Option("--certificatebasedauthconfiguration-id", description: "key: id of certificateBasedAuthConfiguration")); - command.AddOption(new Option("--body")); + var certificateBasedAuthConfigurationIdOption = new Option("--certificatebasedauthconfiguration-id", description: "key: id of certificateBasedAuthConfiguration"); + certificateBasedAuthConfigurationIdOption.IsRequired = true; + command.AddOption(certificateBasedAuthConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (certificateBasedAuthConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(certificateBasedAuthConfigurationId)) requestInfo.PathParameters.Add("certificateBasedAuthConfiguration_id", certificateBasedAuthConfigurationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Chats/ChatsRequestBuilder.cs b/src/generated/Chats/ChatsRequestBuilder.cs index af1abfc8ff5..9f60f31ce83 100644 --- a/src/generated/Chats/ChatsRequestBuilder.cs +++ b/src/generated/Chats/ChatsRequestBuilder.cs @@ -42,12 +42,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to chats"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,24 +69,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from chats"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Chats/GetAllMessages/GetAllMessagesRequestBuilder.cs b/src/generated/Chats/GetAllMessages/GetAllMessagesRequestBuilder.cs index fd1387fa8ab..991def38aa9 100644 --- a/src/generated/Chats/GetAllMessages/GetAllMessagesRequestBuilder.cs +++ b/src/generated/Chats/GetAllMessages/GetAllMessagesRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function getAllMessages"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Chats/Item/ChatRequestBuilder.cs b/src/generated/Chats/Item/ChatRequestBuilder.cs index 5ebc3521c2b..9d98c1c23b5 100644 --- a/src/generated/Chats/Item/ChatRequestBuilder.cs +++ b/src/generated/Chats/Item/ChatRequestBuilder.cs @@ -31,10 +31,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from chats"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); command.Handler = CommandHandler.Create(async (chatId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,14 +50,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from chats by key"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,14 +106,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in chats"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Chats/Item/InstalledApps/InstalledAppsRequestBuilder.cs b/src/generated/Chats/Item/InstalledApps/InstalledAppsRequestBuilder.cs index f2664c0201a..d562d21f989 100644 --- a/src/generated/Chats/Item/InstalledApps/InstalledAppsRequestBuilder.cs +++ b/src/generated/Chats/Item/InstalledApps/InstalledAppsRequestBuilder.cs @@ -39,14 +39,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of all the apps in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,26 +69,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of all the apps in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Chats/Item/InstalledApps/Item/TeamsApp/@Ref/RefRequestBuilder.cs b/src/generated/Chats/Item/InstalledApps/Item/TeamsApp/@Ref/RefRequestBuilder.cs index c8abf532650..56175147da9 100644 --- a/src/generated/Chats/Item/InstalledApps/Item/TeamsApp/@Ref/RefRequestBuilder.cs +++ b/src/generated/Chats/Item/InstalledApps/Item/TeamsApp/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The app that is installed."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The app that is installed."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The app that is installed."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Chats/Item/InstalledApps/Item/TeamsApp/TeamsAppRequestBuilder.cs b/src/generated/Chats/Item/InstalledApps/Item/TeamsApp/TeamsAppRequestBuilder.cs index 5b1ea34621a..300a56042d0 100644 --- a/src/generated/Chats/Item/InstalledApps/Item/TeamsApp/TeamsAppRequestBuilder.cs +++ b/src/generated/Chats/Item/InstalledApps/Item/TeamsApp/TeamsAppRequestBuilder.cs @@ -27,16 +27,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The app that is installed."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Chats/Item/InstalledApps/Item/TeamsAppDefinition/@Ref/RefRequestBuilder.cs b/src/generated/Chats/Item/InstalledApps/Item/TeamsAppDefinition/@Ref/RefRequestBuilder.cs index bacd32c4ce4..2cbbd01e15b 100644 --- a/src/generated/Chats/Item/InstalledApps/Item/TeamsAppDefinition/@Ref/RefRequestBuilder.cs +++ b/src/generated/Chats/Item/InstalledApps/Item/TeamsAppDefinition/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The details of this version of the app."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The details of this version of the app."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The details of this version of the app."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Chats/Item/InstalledApps/Item/TeamsAppDefinition/TeamsAppDefinitionRequestBuilder.cs b/src/generated/Chats/Item/InstalledApps/Item/TeamsAppDefinition/TeamsAppDefinitionRequestBuilder.cs index bcd0036c6c2..3d1e9e11819 100644 --- a/src/generated/Chats/Item/InstalledApps/Item/TeamsAppDefinition/TeamsAppDefinitionRequestBuilder.cs +++ b/src/generated/Chats/Item/InstalledApps/Item/TeamsAppDefinition/TeamsAppDefinitionRequestBuilder.cs @@ -27,16 +27,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The details of this version of the app."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Chats/Item/InstalledApps/Item/TeamsAppInstallationRequestBuilder.cs b/src/generated/Chats/Item/InstalledApps/Item/TeamsAppInstallationRequestBuilder.cs index f0b2ab6e6c4..94cc348b9bb 100644 --- a/src/generated/Chats/Item/InstalledApps/Item/TeamsAppInstallationRequestBuilder.cs +++ b/src/generated/Chats/Item/InstalledApps/Item/TeamsAppInstallationRequestBuilder.cs @@ -29,12 +29,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of all the apps in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +51,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of all the apps in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,16 +88,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of all the apps in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Chats/Item/InstalledApps/Item/Upgrade/UpgradeRequestBuilder.cs b/src/generated/Chats/Item/InstalledApps/Item/Upgrade/UpgradeRequestBuilder.cs index ed0f86e9bf7..4ee5674040b 100644 --- a/src/generated/Chats/Item/InstalledApps/Item/Upgrade/UpgradeRequestBuilder.cs +++ b/src/generated/Chats/Item/InstalledApps/Item/Upgrade/UpgradeRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action upgrade"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (chatId, teamsAppInstallationId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Chats/Item/Members/@Add/AddRequestBuilder.cs b/src/generated/Chats/Item/Members/@Add/AddRequestBuilder.cs index dd144df81dc..921227af740 100644 --- a/src/generated/Chats/Item/Members/@Add/AddRequestBuilder.cs +++ b/src/generated/Chats/Item/Members/@Add/AddRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Chats/Item/Members/Item/ConversationMemberRequestBuilder.cs b/src/generated/Chats/Item/Members/Item/ConversationMemberRequestBuilder.cs index e3a13ebcd4e..065bdae5bb2 100644 --- a/src/generated/Chats/Item/Members/Item/ConversationMemberRequestBuilder.cs +++ b/src/generated/Chats/Item/Members/Item/ConversationMemberRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of all the members in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--conversationmember-id", description: "key: id of conversationMember")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var conversationMemberIdOption = new Option("--conversationmember-id", description: "key: id of conversationMember"); + conversationMemberIdOption.IsRequired = true; + command.AddOption(conversationMemberIdOption); command.Handler = CommandHandler.Create(async (chatId, conversationMemberId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(conversationMemberId)) requestInfo.PathParameters.Add("conversationMember_id", conversationMemberId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of all the members in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--conversationmember-id", description: "key: id of conversationMember")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, conversationMemberId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(conversationMemberId)) requestInfo.PathParameters.Add("conversationMember_id", conversationMemberId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var conversationMemberIdOption = new Option("--conversationmember-id", description: "key: id of conversationMember"); + conversationMemberIdOption.IsRequired = true; + command.AddOption(conversationMemberIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, conversationMemberId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of all the members in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--conversationmember-id", description: "key: id of conversationMember")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var conversationMemberIdOption = new Option("--conversationmember-id", description: "key: id of conversationMember"); + conversationMemberIdOption.IsRequired = true; + command.AddOption(conversationMemberIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, conversationMemberId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(conversationMemberId)) requestInfo.PathParameters.Add("conversationMember_id", conversationMemberId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Chats/Item/Members/MembersRequestBuilder.cs b/src/generated/Chats/Item/Members/MembersRequestBuilder.cs index 0efa7982cde..68d47576b17 100644 --- a/src/generated/Chats/Item/Members/MembersRequestBuilder.cs +++ b/src/generated/Chats/Item/Members/MembersRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of all the members in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,26 +73,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of all the members in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Chats/Item/Messages/Delta/DeltaRequestBuilder.cs b/src/generated/Chats/Item/Messages/Delta/DeltaRequestBuilder.cs index d2f507a01ae..8ce5fdfc600 100644 --- a/src/generated/Chats/Item/Messages/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Chats/Item/Messages/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); command.Handler = CommandHandler.Create(async (chatId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Chats/Item/Messages/Item/ChatMessageRequestBuilder.cs b/src/generated/Chats/Item/Messages/Item/ChatMessageRequestBuilder.cs index 320b49b4ae1..8c4affeaa13 100644 --- a/src/generated/Chats/Item/Messages/Item/ChatMessageRequestBuilder.cs +++ b/src/generated/Chats/Item/Messages/Item/ChatMessageRequestBuilder.cs @@ -28,12 +28,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of all the messages in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); command.Handler = CommandHandler.Create(async (chatId, chatMessageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,16 +50,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of all the messages in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, chatMessageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, chatMessageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of all the messages in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, chatMessageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Chats/Item/Messages/Item/HostedContents/HostedContentsRequestBuilder.cs b/src/generated/Chats/Item/Messages/Item/HostedContents/HostedContentsRequestBuilder.cs index 5cfdf2c3495..829f11be9b0 100644 --- a/src/generated/Chats/Item/Messages/Item/HostedContents/HostedContentsRequestBuilder.cs +++ b/src/generated/Chats/Item/Messages/Item/HostedContents/HostedContentsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, chatMessageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, chatMessageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, chatMessageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Chats/Item/Messages/Item/HostedContents/Item/ChatMessageHostedContentRequestBuilder.cs b/src/generated/Chats/Item/Messages/Item/HostedContents/Item/ChatMessageHostedContentRequestBuilder.cs index 8ca76a61e03..6eadc2533a8 100644 --- a/src/generated/Chats/Item/Messages/Item/HostedContents/Item/ChatMessageHostedContentRequestBuilder.cs +++ b/src/generated/Chats/Item/Messages/Item/HostedContents/Item/ChatMessageHostedContentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageHostedContentIdOption = new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent"); + chatMessageHostedContentIdOption.IsRequired = true; + command.AddOption(chatMessageHostedContentIdOption); command.Handler = CommandHandler.Create(async (chatId, chatMessageId, chatMessageHostedContentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageHostedContentId)) requestInfo.PathParameters.Add("chatMessageHostedContent_id", chatMessageHostedContentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, chatMessageId, chatMessageHostedContentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageHostedContentId)) requestInfo.PathParameters.Add("chatMessageHostedContent_id", chatMessageHostedContentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageHostedContentIdOption = new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent"); + chatMessageHostedContentIdOption.IsRequired = true; + command.AddOption(chatMessageHostedContentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, chatMessageId, chatMessageHostedContentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageHostedContentIdOption = new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent"); + chatMessageHostedContentIdOption.IsRequired = true; + command.AddOption(chatMessageHostedContentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, chatMessageId, chatMessageHostedContentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageHostedContentId)) requestInfo.PathParameters.Add("chatMessageHostedContent_id", chatMessageHostedContentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Chats/Item/Messages/Item/Replies/Delta/DeltaRequestBuilder.cs b/src/generated/Chats/Item/Messages/Item/Replies/Delta/DeltaRequestBuilder.cs index 60ec0d0dd05..1772cf409fe 100644 --- a/src/generated/Chats/Item/Messages/Item/Replies/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Chats/Item/Messages/Item/Replies/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); command.Handler = CommandHandler.Create(async (chatId, chatMessageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Chats/Item/Messages/Item/Replies/Item/ChatMessageRequestBuilder.cs b/src/generated/Chats/Item/Messages/Item/Replies/Item/ChatMessageRequestBuilder.cs index 95fdae9142d..917327a2d2e 100644 --- a/src/generated/Chats/Item/Messages/Item/Replies/Item/ChatMessageRequestBuilder.cs +++ b/src/generated/Chats/Item/Messages/Item/Replies/Item/ChatMessageRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessage-id1", description: "key: id of chatMessage")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageId1Option = new Option("--chatmessage-id1", description: "key: id of chatMessage"); + chatMessageId1Option.IsRequired = true; + command.AddOption(chatMessageId1Option); command.Handler = CommandHandler.Create(async (chatId, chatMessageId, chatMessageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageId1)) requestInfo.PathParameters.Add("chatMessage_id1", chatMessageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessage-id1", description: "key: id of chatMessage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, chatMessageId, chatMessageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageId1)) requestInfo.PathParameters.Add("chatMessage_id1", chatMessageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageId1Option = new Option("--chatmessage-id1", description: "key: id of chatMessage"); + chatMessageId1Option.IsRequired = true; + command.AddOption(chatMessageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, chatMessageId, chatMessageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessage-id1", description: "key: id of chatMessage")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageId1Option = new Option("--chatmessage-id1", description: "key: id of chatMessage"); + chatMessageId1Option.IsRequired = true; + command.AddOption(chatMessageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, chatMessageId, chatMessageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageId1)) requestInfo.PathParameters.Add("chatMessage_id1", chatMessageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Chats/Item/Messages/Item/Replies/RepliesRequestBuilder.cs b/src/generated/Chats/Item/Messages/Item/Replies/RepliesRequestBuilder.cs index 07a83bcf37a..5b9d23c3de3 100644 --- a/src/generated/Chats/Item/Messages/Item/Replies/RepliesRequestBuilder.cs +++ b/src/generated/Chats/Item/Messages/Item/Replies/RepliesRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, chatMessageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,28 +70,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, chatMessageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, chatMessageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Chats/Item/Messages/MessagesRequestBuilder.cs b/src/generated/Chats/Item/Messages/MessagesRequestBuilder.cs index 43849703acc..afbf8eaf012 100644 --- a/src/generated/Chats/Item/Messages/MessagesRequestBuilder.cs +++ b/src/generated/Chats/Item/Messages/MessagesRequestBuilder.cs @@ -39,14 +39,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of all the messages in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,26 +69,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of all the messages in the chat. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Chats/Item/SendActivityNotification/SendActivityNotificationRequestBuilder.cs b/src/generated/Chats/Item/SendActivityNotification/SendActivityNotificationRequestBuilder.cs index 22af7458774..6d083bd3114 100644 --- a/src/generated/Chats/Item/SendActivityNotification/SendActivityNotificationRequestBuilder.cs +++ b/src/generated/Chats/Item/SendActivityNotification/SendActivityNotificationRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sendActivityNotification"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Chats/Item/Tabs/Item/TeamsApp/@Ref/RefRequestBuilder.cs b/src/generated/Chats/Item/Tabs/Item/TeamsApp/@Ref/RefRequestBuilder.cs index 54e1f96cda0..35a6393d7a7 100644 --- a/src/generated/Chats/Item/Tabs/Item/TeamsApp/@Ref/RefRequestBuilder.cs +++ b/src/generated/Chats/Item/Tabs/Item/TeamsApp/@Ref/RefRequestBuilder.cs @@ -19,18 +19,21 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The application that is linked to the tab. This cannot be changed after tab creation."; + command.Description = "The application that is linked to the tab."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); command.Handler = CommandHandler.Create(async (chatId, teamsTabId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -38,18 +41,21 @@ public Command BuildDeleteCommand() { return command; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The application that is linked to the tab. This cannot be changed after tab creation."; + command.Description = "The application that is linked to the tab."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); command.Handler = CommandHandler.Create(async (chatId, teamsTabId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +68,27 @@ public Command BuildGetCommand() { return command; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The application that is linked to the tab. This cannot be changed after tab creation."; + command.Description = "The application that is linked to the tab."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, teamsTabId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -98,7 +109,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Request headers /// Request options /// @@ -113,7 +124,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Request headers /// Request options /// @@ -128,7 +139,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// /// Request headers /// Request options @@ -146,7 +157,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.Chats.Item.Tabs.Ite return requestInfo; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -157,7 +168,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +179,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/Chats/Item/Tabs/Item/TeamsApp/TeamsAppRequestBuilder.cs b/src/generated/Chats/Item/Tabs/Item/TeamsApp/TeamsAppRequestBuilder.cs index d3fd0682c2b..22724fc90ea 100644 --- a/src/generated/Chats/Item/Tabs/Item/TeamsApp/TeamsAppRequestBuilder.cs +++ b/src/generated/Chats/Item/Tabs/Item/TeamsApp/TeamsAppRequestBuilder.cs @@ -21,22 +21,31 @@ public class TeamsAppRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The application that is linked to the tab. This cannot be changed after tab creation."; + command.Description = "The application that is linked to the tab."; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, teamsTabId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, teamsTabId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,7 +79,7 @@ public TeamsAppRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Request headers /// Request options /// Request query parameters @@ -91,7 +100,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -102,7 +111,7 @@ public RequestInformation CreateGetRequestInformation(Action var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Chats/Item/Tabs/Item/TeamsTabRequestBuilder.cs b/src/generated/Chats/Item/Tabs/Item/TeamsTabRequestBuilder.cs index 00b932efad6..137a4cbd206 100644 --- a/src/generated/Chats/Item/Tabs/Item/TeamsTabRequestBuilder.cs +++ b/src/generated/Chats/Item/Tabs/Item/TeamsTabRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property tabs for chats"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); command.Handler = CommandHandler.Create(async (chatId, teamsTabId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get tabs from chats"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, teamsTabId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, teamsTabId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property tabs in chats"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, teamsTabId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Chats/Item/Tabs/TabsRequestBuilder.cs b/src/generated/Chats/Item/Tabs/TabsRequestBuilder.cs index a9e43cd108a..267c39ab725 100644 --- a/src/generated/Chats/Item/Tabs/TabsRequestBuilder.cs +++ b/src/generated/Chats/Item/Tabs/TabsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to tabs for chats"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get tabs from chats"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/CallRecords/CallRecordsRequestBuilder.cs b/src/generated/Communications/CallRecords/CallRecordsRequestBuilder.cs index 5f38b023481..7f822f4deaa 100644 --- a/src/generated/Communications/CallRecords/CallRecordsRequestBuilder.cs +++ b/src/generated/Communications/CallRecords/CallRecordsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to callRecords for communications"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get callRecords from communications"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/CallRecords/Item/CallRecordRequestBuilder.cs b/src/generated/Communications/CallRecords/Item/CallRecordRequestBuilder.cs index c9a896eabf1..6bc4b0edf4c 100644 --- a/src/generated/Communications/CallRecords/Item/CallRecordRequestBuilder.cs +++ b/src/generated/Communications/CallRecords/Item/CallRecordRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property callRecords for communications"; // Create options for all the parameters - command.AddOption(new Option("--callrecord-id", description: "key: id of callRecord")); + var callRecordIdOption = new Option("--callrecord-id", description: "key: id of callRecord"); + callRecordIdOption.IsRequired = true; + command.AddOption(callRecordIdOption); command.Handler = CommandHandler.Create(async (callRecordId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(callRecordId)) requestInfo.PathParameters.Add("callRecord_id", callRecordId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get callRecords from communications"; // Create options for all the parameters - command.AddOption(new Option("--callrecord-id", description: "key: id of callRecord")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (callRecordId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(callRecordId)) requestInfo.PathParameters.Add("callRecord_id", callRecordId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var callRecordIdOption = new Option("--callrecord-id", description: "key: id of callRecord"); + callRecordIdOption.IsRequired = true; + command.AddOption(callRecordIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (callRecordId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,14 +80,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property callRecords in communications"; // Create options for all the parameters - command.AddOption(new Option("--callrecord-id", description: "key: id of callRecord")); - command.AddOption(new Option("--body")); + var callRecordIdOption = new Option("--callrecord-id", description: "key: id of callRecord"); + callRecordIdOption.IsRequired = true; + command.AddOption(callRecordIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callRecordId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(callRecordId)) requestInfo.PathParameters.Add("callRecord_id", callRecordId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/CallRecords/Item/Sessions/Item/Segments/Item/SegmentRequestBuilder.cs b/src/generated/Communications/CallRecords/Item/Sessions/Item/Segments/Item/SegmentRequestBuilder.cs index d534d2426fc..098c61789ca 100644 --- a/src/generated/Communications/CallRecords/Item/Sessions/Item/Segments/Item/SegmentRequestBuilder.cs +++ b/src/generated/Communications/CallRecords/Item/Sessions/Item/Segments/Item/SegmentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of segments involved in the session. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--callrecord-id", description: "key: id of callRecord")); - command.AddOption(new Option("--session-id", description: "key: id of session")); - command.AddOption(new Option("--segment-id", description: "key: id of segment")); + var callRecordIdOption = new Option("--callrecord-id", description: "key: id of callRecord"); + callRecordIdOption.IsRequired = true; + command.AddOption(callRecordIdOption); + var sessionIdOption = new Option("--session-id", description: "key: id of session"); + sessionIdOption.IsRequired = true; + command.AddOption(sessionIdOption); + var segmentIdOption = new Option("--segment-id", description: "key: id of segment"); + segmentIdOption.IsRequired = true; + command.AddOption(segmentIdOption); command.Handler = CommandHandler.Create(async (callRecordId, sessionId, segmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(callRecordId)) requestInfo.PathParameters.Add("callRecord_id", callRecordId); - if (!String.IsNullOrEmpty(sessionId)) requestInfo.PathParameters.Add("session_id", sessionId); - if (!String.IsNullOrEmpty(segmentId)) requestInfo.PathParameters.Add("segment_id", segmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of segments involved in the session. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--callrecord-id", description: "key: id of callRecord")); - command.AddOption(new Option("--session-id", description: "key: id of session")); - command.AddOption(new Option("--segment-id", description: "key: id of segment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (callRecordId, sessionId, segmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(callRecordId)) requestInfo.PathParameters.Add("callRecord_id", callRecordId); - if (!String.IsNullOrEmpty(sessionId)) requestInfo.PathParameters.Add("session_id", sessionId); - if (!String.IsNullOrEmpty(segmentId)) requestInfo.PathParameters.Add("segment_id", segmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var callRecordIdOption = new Option("--callrecord-id", description: "key: id of callRecord"); + callRecordIdOption.IsRequired = true; + command.AddOption(callRecordIdOption); + var sessionIdOption = new Option("--session-id", description: "key: id of session"); + sessionIdOption.IsRequired = true; + command.AddOption(sessionIdOption); + var segmentIdOption = new Option("--segment-id", description: "key: id of segment"); + segmentIdOption.IsRequired = true; + command.AddOption(segmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (callRecordId, sessionId, segmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of segments involved in the session. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--callrecord-id", description: "key: id of callRecord")); - command.AddOption(new Option("--session-id", description: "key: id of session")); - command.AddOption(new Option("--segment-id", description: "key: id of segment")); - command.AddOption(new Option("--body")); + var callRecordIdOption = new Option("--callrecord-id", description: "key: id of callRecord"); + callRecordIdOption.IsRequired = true; + command.AddOption(callRecordIdOption); + var sessionIdOption = new Option("--session-id", description: "key: id of session"); + sessionIdOption.IsRequired = true; + command.AddOption(sessionIdOption); + var segmentIdOption = new Option("--segment-id", description: "key: id of segment"); + segmentIdOption.IsRequired = true; + command.AddOption(segmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callRecordId, sessionId, segmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(callRecordId)) requestInfo.PathParameters.Add("callRecord_id", callRecordId); - if (!String.IsNullOrEmpty(sessionId)) requestInfo.PathParameters.Add("session_id", sessionId); - if (!String.IsNullOrEmpty(segmentId)) requestInfo.PathParameters.Add("segment_id", segmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/CallRecords/Item/Sessions/Item/Segments/SegmentsRequestBuilder.cs b/src/generated/Communications/CallRecords/Item/Sessions/Item/Segments/SegmentsRequestBuilder.cs index fddfe643c96..bbf78eee2e2 100644 --- a/src/generated/Communications/CallRecords/Item/Sessions/Item/Segments/SegmentsRequestBuilder.cs +++ b/src/generated/Communications/CallRecords/Item/Sessions/Item/Segments/SegmentsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of segments involved in the session. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--callrecord-id", description: "key: id of callRecord")); - command.AddOption(new Option("--session-id", description: "key: id of session")); - command.AddOption(new Option("--body")); + var callRecordIdOption = new Option("--callrecord-id", description: "key: id of callRecord"); + callRecordIdOption.IsRequired = true; + command.AddOption(callRecordIdOption); + var sessionIdOption = new Option("--session-id", description: "key: id of session"); + sessionIdOption.IsRequired = true; + command.AddOption(sessionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callRecordId, sessionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callRecordId)) requestInfo.PathParameters.Add("callRecord_id", callRecordId); - if (!String.IsNullOrEmpty(sessionId)) requestInfo.PathParameters.Add("session_id", sessionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of segments involved in the session. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--callrecord-id", description: "key: id of callRecord")); - command.AddOption(new Option("--session-id", description: "key: id of session")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (callRecordId, sessionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(callRecordId)) requestInfo.PathParameters.Add("callRecord_id", callRecordId); - if (!String.IsNullOrEmpty(sessionId)) requestInfo.PathParameters.Add("session_id", sessionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var callRecordIdOption = new Option("--callrecord-id", description: "key: id of callRecord"); + callRecordIdOption.IsRequired = true; + command.AddOption(callRecordIdOption); + var sessionIdOption = new Option("--session-id", description: "key: id of session"); + sessionIdOption.IsRequired = true; + command.AddOption(sessionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (callRecordId, sessionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/CallRecords/Item/Sessions/Item/SessionRequestBuilder.cs b/src/generated/Communications/CallRecords/Item/Sessions/Item/SessionRequestBuilder.cs index 8a585926e81..ad96c5f9d6e 100644 --- a/src/generated/Communications/CallRecords/Item/Sessions/Item/SessionRequestBuilder.cs +++ b/src/generated/Communications/CallRecords/Item/Sessions/Item/SessionRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "List of sessions involved in the call. Peer-to-peer calls typically only have one session, whereas group calls typically have at least one session per participant. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--callrecord-id", description: "key: id of callRecord")); - command.AddOption(new Option("--session-id", description: "key: id of session")); + var callRecordIdOption = new Option("--callrecord-id", description: "key: id of callRecord"); + callRecordIdOption.IsRequired = true; + command.AddOption(callRecordIdOption); + var sessionIdOption = new Option("--session-id", description: "key: id of session"); + sessionIdOption.IsRequired = true; + command.AddOption(sessionIdOption); command.Handler = CommandHandler.Create(async (callRecordId, sessionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(callRecordId)) requestInfo.PathParameters.Add("callRecord_id", callRecordId); - if (!String.IsNullOrEmpty(sessionId)) requestInfo.PathParameters.Add("session_id", sessionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "List of sessions involved in the call. Peer-to-peer calls typically only have one session, whereas group calls typically have at least one session per participant. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--callrecord-id", description: "key: id of callRecord")); - command.AddOption(new Option("--session-id", description: "key: id of session")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (callRecordId, sessionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(callRecordId)) requestInfo.PathParameters.Add("callRecord_id", callRecordId); - if (!String.IsNullOrEmpty(sessionId)) requestInfo.PathParameters.Add("session_id", sessionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var callRecordIdOption = new Option("--callrecord-id", description: "key: id of callRecord"); + callRecordIdOption.IsRequired = true; + command.AddOption(callRecordIdOption); + var sessionIdOption = new Option("--session-id", description: "key: id of session"); + sessionIdOption.IsRequired = true; + command.AddOption(sessionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (callRecordId, sessionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "List of sessions involved in the call. Peer-to-peer calls typically only have one session, whereas group calls typically have at least one session per participant. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--callrecord-id", description: "key: id of callRecord")); - command.AddOption(new Option("--session-id", description: "key: id of session")); - command.AddOption(new Option("--body")); + var callRecordIdOption = new Option("--callrecord-id", description: "key: id of callRecord"); + callRecordIdOption.IsRequired = true; + command.AddOption(callRecordIdOption); + var sessionIdOption = new Option("--session-id", description: "key: id of session"); + sessionIdOption.IsRequired = true; + command.AddOption(sessionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callRecordId, sessionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(callRecordId)) requestInfo.PathParameters.Add("callRecord_id", callRecordId); - if (!String.IsNullOrEmpty(sessionId)) requestInfo.PathParameters.Add("session_id", sessionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/CallRecords/Item/Sessions/SessionsRequestBuilder.cs b/src/generated/Communications/CallRecords/Item/Sessions/SessionsRequestBuilder.cs index 243886f5c6f..150f8e210da 100644 --- a/src/generated/Communications/CallRecords/Item/Sessions/SessionsRequestBuilder.cs +++ b/src/generated/Communications/CallRecords/Item/Sessions/SessionsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "List of sessions involved in the call. Peer-to-peer calls typically only have one session, whereas group calls typically have at least one session per participant. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--callrecord-id", description: "key: id of callRecord")); - command.AddOption(new Option("--body")); + var callRecordIdOption = new Option("--callrecord-id", description: "key: id of callRecord"); + callRecordIdOption.IsRequired = true; + command.AddOption(callRecordIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callRecordId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callRecordId)) requestInfo.PathParameters.Add("callRecord_id", callRecordId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "List of sessions involved in the call. Peer-to-peer calls typically only have one session, whereas group calls typically have at least one session per participant. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--callrecord-id", description: "key: id of callRecord")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (callRecordId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(callRecordId)) requestInfo.PathParameters.Add("callRecord_id", callRecordId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var callRecordIdOption = new Option("--callrecord-id", description: "key: id of callRecord"); + callRecordIdOption.IsRequired = true; + command.AddOption(callRecordIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (callRecordId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/CallsRequestBuilder.cs b/src/generated/Communications/Calls/CallsRequestBuilder.cs index 274214c8efe..e6b1eb33a16 100644 --- a/src/generated/Communications/Calls/CallsRequestBuilder.cs +++ b/src/generated/Communications/Calls/CallsRequestBuilder.cs @@ -53,12 +53,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to calls for communications"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,24 +80,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get calls from communications"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/Item/Answer/AnswerRequestBuilder.cs b/src/generated/Communications/Calls/Item/Answer/AnswerRequestBuilder.cs index 8db92a96630..72eea315077 100644 --- a/src/generated/Communications/Calls/Item/Answer/AnswerRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/Answer/AnswerRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action answer"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/Calls/Item/AudioRoutingGroups/AudioRoutingGroupsRequestBuilder.cs b/src/generated/Communications/Calls/Item/AudioRoutingGroups/AudioRoutingGroupsRequestBuilder.cs index 76de5a84f10..ffbdcad1183 100644 --- a/src/generated/Communications/Calls/Item/AudioRoutingGroups/AudioRoutingGroupsRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/AudioRoutingGroups/AudioRoutingGroupsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (callId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (callId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/Item/AudioRoutingGroups/Item/AudioRoutingGroupRequestBuilder.cs b/src/generated/Communications/Calls/Item/AudioRoutingGroups/Item/AudioRoutingGroupRequestBuilder.cs index 466055d4bee..a0ac9482c43 100644 --- a/src/generated/Communications/Calls/Item/AudioRoutingGroups/Item/AudioRoutingGroupRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/AudioRoutingGroups/Item/AudioRoutingGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--audioroutinggroup-id", description: "key: id of audioRoutingGroup")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var audioRoutingGroupIdOption = new Option("--audioroutinggroup-id", description: "key: id of audioRoutingGroup"); + audioRoutingGroupIdOption.IsRequired = true; + command.AddOption(audioRoutingGroupIdOption); command.Handler = CommandHandler.Create(async (callId, audioRoutingGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - if (!String.IsNullOrEmpty(audioRoutingGroupId)) requestInfo.PathParameters.Add("audioRoutingGroup_id", audioRoutingGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--audioroutinggroup-id", description: "key: id of audioRoutingGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (callId, audioRoutingGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - if (!String.IsNullOrEmpty(audioRoutingGroupId)) requestInfo.PathParameters.Add("audioRoutingGroup_id", audioRoutingGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var audioRoutingGroupIdOption = new Option("--audioroutinggroup-id", description: "key: id of audioRoutingGroup"); + audioRoutingGroupIdOption.IsRequired = true; + command.AddOption(audioRoutingGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (callId, audioRoutingGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--audioroutinggroup-id", description: "key: id of audioRoutingGroup")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var audioRoutingGroupIdOption = new Option("--audioroutinggroup-id", description: "key: id of audioRoutingGroup"); + audioRoutingGroupIdOption.IsRequired = true; + command.AddOption(audioRoutingGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, audioRoutingGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - if (!String.IsNullOrEmpty(audioRoutingGroupId)) requestInfo.PathParameters.Add("audioRoutingGroup_id", audioRoutingGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/Calls/Item/CallRequestBuilder.cs b/src/generated/Communications/Calls/Item/CallRequestBuilder.cs index 449ebcc6ed4..e86889e4185 100644 --- a/src/generated/Communications/Calls/Item/CallRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/CallRequestBuilder.cs @@ -67,10 +67,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property calls for communications"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); command.Handler = CommandHandler.Create(async (callId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,14 +86,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get calls from communications"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (callId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (callId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -137,14 +147,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property calls in communications"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/Calls/Item/CancelMediaProcessing/CancelMediaProcessingRequestBuilder.cs b/src/generated/Communications/Calls/Item/CancelMediaProcessing/CancelMediaProcessingRequestBuilder.cs index fdf388aab5d..4fadf9d0308 100644 --- a/src/generated/Communications/Calls/Item/CancelMediaProcessing/CancelMediaProcessingRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/CancelMediaProcessing/CancelMediaProcessingRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancelMediaProcessing"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/Item/ChangeScreenSharingRole/ChangeScreenSharingRoleRequestBuilder.cs b/src/generated/Communications/Calls/Item/ChangeScreenSharingRole/ChangeScreenSharingRoleRequestBuilder.cs index 59950f4ea5c..f40e9e37fae 100644 --- a/src/generated/Communications/Calls/Item/ChangeScreenSharingRole/ChangeScreenSharingRoleRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/ChangeScreenSharingRole/ChangeScreenSharingRoleRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action changeScreenSharingRole"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/Calls/Item/KeepAlive/KeepAliveRequestBuilder.cs b/src/generated/Communications/Calls/Item/KeepAlive/KeepAliveRequestBuilder.cs index 183ddb591e6..f4191c6048e 100644 --- a/src/generated/Communications/Calls/Item/KeepAlive/KeepAliveRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/KeepAlive/KeepAliveRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action keepAlive"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); command.Handler = CommandHandler.Create(async (callId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/Calls/Item/Mute/MuteRequestBuilder.cs b/src/generated/Communications/Calls/Item/Mute/MuteRequestBuilder.cs index 50e26b24b72..c140c31a829 100644 --- a/src/generated/Communications/Calls/Item/Mute/MuteRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/Mute/MuteRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action mute"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/Item/Operations/Item/CommsOperationRequestBuilder.cs b/src/generated/Communications/Calls/Item/Operations/Item/CommsOperationRequestBuilder.cs index 9da363c25b1..64ead8b523a 100644 --- a/src/generated/Communications/Calls/Item/Operations/Item/CommsOperationRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/Operations/Item/CommsOperationRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--commsoperation-id", description: "key: id of commsOperation")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var commsOperationIdOption = new Option("--commsoperation-id", description: "key: id of commsOperation"); + commsOperationIdOption.IsRequired = true; + command.AddOption(commsOperationIdOption); command.Handler = CommandHandler.Create(async (callId, commsOperationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - if (!String.IsNullOrEmpty(commsOperationId)) requestInfo.PathParameters.Add("commsOperation_id", commsOperationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--commsoperation-id", description: "key: id of commsOperation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (callId, commsOperationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - if (!String.IsNullOrEmpty(commsOperationId)) requestInfo.PathParameters.Add("commsOperation_id", commsOperationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var commsOperationIdOption = new Option("--commsoperation-id", description: "key: id of commsOperation"); + commsOperationIdOption.IsRequired = true; + command.AddOption(commsOperationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (callId, commsOperationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--commsoperation-id", description: "key: id of commsOperation")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var commsOperationIdOption = new Option("--commsoperation-id", description: "key: id of commsOperation"); + commsOperationIdOption.IsRequired = true; + command.AddOption(commsOperationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, commsOperationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - if (!String.IsNullOrEmpty(commsOperationId)) requestInfo.PathParameters.Add("commsOperation_id", commsOperationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/Calls/Item/Operations/OperationsRequestBuilder.cs b/src/generated/Communications/Calls/Item/Operations/OperationsRequestBuilder.cs index 0d64632d422..893dfd62d1f 100644 --- a/src/generated/Communications/Calls/Item/Operations/OperationsRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/Operations/OperationsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (callId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (callId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/Item/Participants/Invite/InviteRequestBuilder.cs b/src/generated/Communications/Calls/Item/Participants/Invite/InviteRequestBuilder.cs index c218eaa7369..e5bcd8d3fcf 100644 --- a/src/generated/Communications/Calls/Item/Participants/Invite/InviteRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/Participants/Invite/InviteRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action invite"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/Item/Participants/Item/Mute/MuteRequestBuilder.cs b/src/generated/Communications/Calls/Item/Participants/Item/Mute/MuteRequestBuilder.cs index 364b75c53e8..eb34270d586 100644 --- a/src/generated/Communications/Calls/Item/Participants/Item/Mute/MuteRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/Participants/Item/Mute/MuteRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action mute"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--participant-id", description: "key: id of participant")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var participantIdOption = new Option("--participant-id", description: "key: id of participant"); + participantIdOption.IsRequired = true; + command.AddOption(participantIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, participantId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - if (!String.IsNullOrEmpty(participantId)) requestInfo.PathParameters.Add("participant_id", participantId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/Item/Participants/Item/ParticipantRequestBuilder.cs b/src/generated/Communications/Calls/Item/Participants/Item/ParticipantRequestBuilder.cs index b1f201df47f..7c96396b8ed 100644 --- a/src/generated/Communications/Calls/Item/Participants/Item/ParticipantRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/Participants/Item/ParticipantRequestBuilder.cs @@ -29,12 +29,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--participant-id", description: "key: id of participant")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var participantIdOption = new Option("--participant-id", description: "key: id of participant"); + participantIdOption.IsRequired = true; + command.AddOption(participantIdOption); command.Handler = CommandHandler.Create(async (callId, participantId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - if (!String.IsNullOrEmpty(participantId)) requestInfo.PathParameters.Add("participant_id", participantId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +51,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--participant-id", description: "key: id of participant")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (callId, participantId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - if (!String.IsNullOrEmpty(participantId)) requestInfo.PathParameters.Add("participant_id", participantId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var participantIdOption = new Option("--participant-id", description: "key: id of participant"); + participantIdOption.IsRequired = true; + command.AddOption(participantIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (callId, participantId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--participant-id", description: "key: id of participant")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var participantIdOption = new Option("--participant-id", description: "key: id of participant"); + participantIdOption.IsRequired = true; + command.AddOption(participantIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, participantId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - if (!String.IsNullOrEmpty(participantId)) requestInfo.PathParameters.Add("participant_id", participantId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/Calls/Item/Participants/Item/StartHoldMusic/StartHoldMusicRequestBuilder.cs b/src/generated/Communications/Calls/Item/Participants/Item/StartHoldMusic/StartHoldMusicRequestBuilder.cs index 7756648e6c1..0122464a30d 100644 --- a/src/generated/Communications/Calls/Item/Participants/Item/StartHoldMusic/StartHoldMusicRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/Participants/Item/StartHoldMusic/StartHoldMusicRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action startHoldMusic"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--participant-id", description: "key: id of participant")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var participantIdOption = new Option("--participant-id", description: "key: id of participant"); + participantIdOption.IsRequired = true; + command.AddOption(participantIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, participantId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - if (!String.IsNullOrEmpty(participantId)) requestInfo.PathParameters.Add("participant_id", participantId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/Item/Participants/Item/StopHoldMusic/StopHoldMusicRequestBuilder.cs b/src/generated/Communications/Calls/Item/Participants/Item/StopHoldMusic/StopHoldMusicRequestBuilder.cs index 552f5a36f9a..b4e91290bfe 100644 --- a/src/generated/Communications/Calls/Item/Participants/Item/StopHoldMusic/StopHoldMusicRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/Participants/Item/StopHoldMusic/StopHoldMusicRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action stopHoldMusic"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--participant-id", description: "key: id of participant")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var participantIdOption = new Option("--participant-id", description: "key: id of participant"); + participantIdOption.IsRequired = true; + command.AddOption(participantIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, participantId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - if (!String.IsNullOrEmpty(participantId)) requestInfo.PathParameters.Add("participant_id", participantId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/Item/Participants/ParticipantsRequestBuilder.cs b/src/generated/Communications/Calls/Item/Participants/ParticipantsRequestBuilder.cs index 5ff024c2c9d..2e65400e473 100644 --- a/src/generated/Communications/Calls/Item/Participants/ParticipantsRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/Participants/ParticipantsRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,26 +76,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (callId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (callId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/Item/PlayPrompt/PlayPromptRequestBuilder.cs b/src/generated/Communications/Calls/Item/PlayPrompt/PlayPromptRequestBuilder.cs index f5490341ab4..5f03e12550a 100644 --- a/src/generated/Communications/Calls/Item/PlayPrompt/PlayPromptRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/PlayPrompt/PlayPromptRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action playPrompt"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/Item/RecordResponse/RecordResponseRequestBuilder.cs b/src/generated/Communications/Calls/Item/RecordResponse/RecordResponseRequestBuilder.cs index cbf49a510c7..b66c6acc0bd 100644 --- a/src/generated/Communications/Calls/Item/RecordResponse/RecordResponseRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/RecordResponse/RecordResponseRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action recordResponse"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/Item/Redirect/RedirectRequestBuilder.cs b/src/generated/Communications/Calls/Item/Redirect/RedirectRequestBuilder.cs index e0e3d378170..5544497d345 100644 --- a/src/generated/Communications/Calls/Item/Redirect/RedirectRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/Redirect/RedirectRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action redirect"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/Calls/Item/Reject/RejectRequestBuilder.cs b/src/generated/Communications/Calls/Item/Reject/RejectRequestBuilder.cs index 70f7592c6e2..789436edb2f 100644 --- a/src/generated/Communications/Calls/Item/Reject/RejectRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/Reject/RejectRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reject"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/Calls/Item/SubscribeToTone/SubscribeToToneRequestBuilder.cs b/src/generated/Communications/Calls/Item/SubscribeToTone/SubscribeToToneRequestBuilder.cs index fa73538a781..9e037c56fe0 100644 --- a/src/generated/Communications/Calls/Item/SubscribeToTone/SubscribeToToneRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/SubscribeToTone/SubscribeToToneRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action subscribeToTone"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/Item/Transfer/TransferRequestBuilder.cs b/src/generated/Communications/Calls/Item/Transfer/TransferRequestBuilder.cs index 74f0365b297..46a79d6c5ff 100644 --- a/src/generated/Communications/Calls/Item/Transfer/TransferRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/Transfer/TransferRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action transfer"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/Calls/Item/Unmute/UnmuteRequestBuilder.cs b/src/generated/Communications/Calls/Item/Unmute/UnmuteRequestBuilder.cs index 6faebae63ed..36b54caab8d 100644 --- a/src/generated/Communications/Calls/Item/Unmute/UnmuteRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/Unmute/UnmuteRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unmute"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/Item/UpdateRecordingStatus/UpdateRecordingStatusRequestBuilder.cs b/src/generated/Communications/Calls/Item/UpdateRecordingStatus/UpdateRecordingStatusRequestBuilder.cs index 19c7a8959fd..1ca23db8ef0 100644 --- a/src/generated/Communications/Calls/Item/UpdateRecordingStatus/UpdateRecordingStatusRequestBuilder.cs +++ b/src/generated/Communications/Calls/Item/UpdateRecordingStatus/UpdateRecordingStatusRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action updateRecordingStatus"; // Create options for all the parameters - command.AddOption(new Option("--call-id", description: "key: id of call")); - command.AddOption(new Option("--body")); + var callIdOption = new Option("--call-id", description: "key: id of call"); + callIdOption.IsRequired = true; + command.AddOption(callIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (callId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(callId)) requestInfo.PathParameters.Add("call_id", callId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Calls/LogTeleconferenceDeviceQuality/LogTeleconferenceDeviceQualityRequestBuilder.cs b/src/generated/Communications/Calls/LogTeleconferenceDeviceQuality/LogTeleconferenceDeviceQualityRequestBuilder.cs index f15423a81c8..2df7dc2c452 100644 --- a/src/generated/Communications/Calls/LogTeleconferenceDeviceQuality/LogTeleconferenceDeviceQualityRequestBuilder.cs +++ b/src/generated/Communications/Calls/LogTeleconferenceDeviceQuality/LogTeleconferenceDeviceQualityRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action logTeleconferenceDeviceQuality"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/CommunicationsRequestBuilder.cs b/src/generated/Communications/CommunicationsRequestBuilder.cs index f7f78758e70..3d23878d6db 100644 --- a/src/generated/Communications/CommunicationsRequestBuilder.cs +++ b/src/generated/Communications/CommunicationsRequestBuilder.cs @@ -46,12 +46,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get communications"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,12 +91,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update communications"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/GetPresencesByUserId/GetPresencesByUserIdRequestBuilder.cs b/src/generated/Communications/GetPresencesByUserId/GetPresencesByUserIdRequestBuilder.cs index 9331ec4829b..1465716416e 100644 --- a/src/generated/Communications/GetPresencesByUserId/GetPresencesByUserIdRequestBuilder.cs +++ b/src/generated/Communications/GetPresencesByUserId/GetPresencesByUserIdRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getPresencesByUserId"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/OnlineMeetings/CreateOrGet/CreateOrGetRequestBuilder.cs b/src/generated/Communications/OnlineMeetings/CreateOrGet/CreateOrGetRequestBuilder.cs index 99454369f7b..4e88f608562 100644 --- a/src/generated/Communications/OnlineMeetings/CreateOrGet/CreateOrGetRequestBuilder.cs +++ b/src/generated/Communications/OnlineMeetings/CreateOrGet/CreateOrGetRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createOrGet"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/AttendanceReportsRequestBuilder.cs b/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/AttendanceReportsRequestBuilder.cs new file mode 100644 index 00000000000..19fc726bfcf --- /dev/null +++ b/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/AttendanceReportsRequestBuilder.cs @@ -0,0 +1,219 @@ +using ApiSdk.Communications.OnlineMeetings.Item.AttendanceReports.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Communications.OnlineMeetings.Item.AttendanceReports { + /// Builds and executes requests for operations under \communications\onlineMeetings\{onlineMeeting-id}\attendanceReports + public class AttendanceReportsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new MeetingAttendanceReportRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildAttendanceRecordsCommand(), + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new AttendanceReportsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AttendanceReportsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/communications/onlineMeetings/{onlineMeeting_id}/attendanceReports{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(MeetingAttendanceReport body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(MeetingAttendanceReport model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// The attendance reports of an online meeting. Read-only. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/AttendanceReportsResponse.cs b/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/AttendanceReportsResponse.cs new file mode 100644 index 00000000000..f4194ccf4fb --- /dev/null +++ b/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/AttendanceReportsResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Communications.OnlineMeetings.Item.AttendanceReports { + public class AttendanceReportsResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new attendanceReportsResponse and sets the default values. + /// + public AttendanceReportsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as AttendanceReportsResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as AttendanceReportsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsRequestBuilder.cs b/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsRequestBuilder.cs new file mode 100644 index 00000000000..d32b5ebd8ca --- /dev/null +++ b/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsRequestBuilder.cs @@ -0,0 +1,224 @@ +using ApiSdk.Communications.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Communications.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords { + /// Builds and executes requests for operations under \communications\onlineMeetings\{onlineMeeting-id}\attendanceReports\{meetingAttendanceReport-id}\attendanceRecords + public class AttendanceRecordsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new AttendanceRecordRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new AttendanceRecordsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AttendanceRecordsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/communications/onlineMeetings/{onlineMeeting_id}/attendanceReports/{meetingAttendanceReport_id}/attendanceRecords{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(AttendanceRecord body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(AttendanceRecord model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// List of attendance records of an attendance report. Read-only. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsResponse.cs b/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsResponse.cs new file mode 100644 index 00000000000..b98efc417eb --- /dev/null +++ b/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Communications.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords { + public class AttendanceRecordsResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new attendanceRecordsResponse and sets the default values. + /// + public AttendanceRecordsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as AttendanceRecordsResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as AttendanceRecordsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/Item/AttendanceRecordRequestBuilder.cs b/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/Item/AttendanceRecordRequestBuilder.cs new file mode 100644 index 00000000000..0c275e5c6a6 --- /dev/null +++ b/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/Item/AttendanceRecordRequestBuilder.cs @@ -0,0 +1,229 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Communications.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords.Item { + /// Builds and executes requests for operations under \communications\onlineMeetings\{onlineMeeting-id}\attendanceReports\{meetingAttendanceReport-id}\attendanceRecords\{attendanceRecord-id} + public class AttendanceRecordRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var attendanceRecordIdOption = new Option("--attendancerecord-id", description: "key: id of attendanceRecord"); + attendanceRecordIdOption.IsRequired = true; + command.AddOption(attendanceRecordIdOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId, attendanceRecordId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var attendanceRecordIdOption = new Option("--attendancerecord-id", description: "key: id of attendanceRecord"); + attendanceRecordIdOption.IsRequired = true; + command.AddOption(attendanceRecordIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId, attendanceRecordId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var attendanceRecordIdOption = new Option("--attendancerecord-id", description: "key: id of attendanceRecord"); + attendanceRecordIdOption.IsRequired = true; + command.AddOption(attendanceRecordIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId, attendanceRecordId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new AttendanceRecordRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AttendanceRecordRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/communications/onlineMeetings/{onlineMeeting_id}/attendanceReports/{meetingAttendanceReport_id}/attendanceRecords/{attendanceRecord_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(AttendanceRecord body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(AttendanceRecord model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// List of attendance records of an attendance report. Read-only. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/Item/MeetingAttendanceReportRequestBuilder.cs b/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/Item/MeetingAttendanceReportRequestBuilder.cs new file mode 100644 index 00000000000..06dec3ab2a6 --- /dev/null +++ b/src/generated/Communications/OnlineMeetings/Item/AttendanceReports/Item/MeetingAttendanceReportRequestBuilder.cs @@ -0,0 +1,228 @@ +using ApiSdk.Communications.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Communications.OnlineMeetings.Item.AttendanceReports.Item { + /// Builds and executes requests for operations under \communications\onlineMeetings\{onlineMeeting-id}\attendanceReports\{meetingAttendanceReport-id} + public class MeetingAttendanceReportRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public Command BuildAttendanceRecordsCommand() { + var command = new Command("attendance-records"); + var builder = new ApiSdk.Communications.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords.AttendanceRecordsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new MeetingAttendanceReportRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public MeetingAttendanceReportRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/communications/onlineMeetings/{onlineMeeting_id}/attendanceReports/{meetingAttendanceReport_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(MeetingAttendanceReport body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(MeetingAttendanceReport model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// The attendance reports of an online meeting. Read-only. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Communications/OnlineMeetings/Item/AttendeeReport/AttendeeReportRequestBuilder.cs b/src/generated/Communications/OnlineMeetings/Item/AttendeeReport/AttendeeReportRequestBuilder.cs index defc5814ea9..bd5532d34e9 100644 --- a/src/generated/Communications/OnlineMeetings/Item/AttendeeReport/AttendeeReportRequestBuilder.cs +++ b/src/generated/Communications/OnlineMeetings/Item/AttendeeReport/AttendeeReportRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property onlineMeetings from communications"; // Create options for all the parameters - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (onlineMeetingId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property onlineMeetings in communications"; // Create options for all the parameters - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); - command.AddOption(new Option("--file", description: "Binary request body")); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (onlineMeetingId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/OnlineMeetings/Item/OnlineMeetingRequestBuilder.cs b/src/generated/Communications/OnlineMeetings/Item/OnlineMeetingRequestBuilder.cs index e3a4ca4ec50..f85238f58ca 100644 --- a/src/generated/Communications/OnlineMeetings/Item/OnlineMeetingRequestBuilder.cs +++ b/src/generated/Communications/OnlineMeetings/Item/OnlineMeetingRequestBuilder.cs @@ -1,3 +1,4 @@ +using ApiSdk.Communications.OnlineMeetings.Item.AttendanceReports; using ApiSdk.Communications.OnlineMeetings.Item.AttendeeReport; using ApiSdk.Models.Microsoft.Graph; using Microsoft.Kiota.Abstractions; @@ -20,6 +21,13 @@ public class OnlineMeetingRequestBuilder { private IRequestAdapter RequestAdapter { get; set; } /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } + public Command BuildAttendanceReportsCommand() { + var command = new Command("attendance-reports"); + var builder = new ApiSdk.Communications.OnlineMeetings.Item.AttendanceReports.AttendanceReportsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } public Command BuildAttendeeReportCommand() { var command = new Command("attendee-report"); var builder = new ApiSdk.Communications.OnlineMeetings.Item.AttendeeReport.AttendeeReportRequestBuilder(PathParameters, RequestAdapter); @@ -34,10 +42,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property onlineMeetings for communications"; // Create options for all the parameters - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); command.Handler = CommandHandler.Create(async (onlineMeetingId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +61,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get onlineMeetings from communications"; // Create options for all the parameters - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onlineMeetingId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +95,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property onlineMeetings in communications"; // Create options for all the parameters - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); - command.AddOption(new Option("--body")); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onlineMeetingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/OnlineMeetings/OnlineMeetingsRequestBuilder.cs b/src/generated/Communications/OnlineMeetings/OnlineMeetingsRequestBuilder.cs index 098822e380c..62e9ddfd535 100644 --- a/src/generated/Communications/OnlineMeetings/OnlineMeetingsRequestBuilder.cs +++ b/src/generated/Communications/OnlineMeetings/OnlineMeetingsRequestBuilder.cs @@ -24,6 +24,7 @@ public class OnlineMeetingsRequestBuilder { public List BuildCommand() { var builder = new OnlineMeetingRequestBuilder(PathParameters, RequestAdapter); var commands = new List { + builder.BuildAttendanceReportsCommand(), builder.BuildAttendeeReportCommand(), builder.BuildDeleteCommand(), builder.BuildGetCommand(), @@ -38,12 +39,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to onlineMeetings for communications"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,24 +72,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get onlineMeetings from communications"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Communications/Presences/Item/ClearPresence/ClearPresenceRequestBuilder.cs b/src/generated/Communications/Presences/Item/ClearPresence/ClearPresenceRequestBuilder.cs index d9046e63202..bb2866719a3 100644 --- a/src/generated/Communications/Presences/Item/ClearPresence/ClearPresenceRequestBuilder.cs +++ b/src/generated/Communications/Presences/Item/ClearPresence/ClearPresenceRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clearPresence"; // Create options for all the parameters - command.AddOption(new Option("--presence-id", description: "key: id of presence")); - command.AddOption(new Option("--body")); + var presenceIdOption = new Option("--presence-id", description: "key: id of presence"); + presenceIdOption.IsRequired = true; + command.AddOption(presenceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (presenceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(presenceId)) requestInfo.PathParameters.Add("presence_id", presenceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/Presences/Item/PresenceRequestBuilder.cs b/src/generated/Communications/Presences/Item/PresenceRequestBuilder.cs index 69bc52a3491..ef4299314cc 100644 --- a/src/generated/Communications/Presences/Item/PresenceRequestBuilder.cs +++ b/src/generated/Communications/Presences/Item/PresenceRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property presences for communications"; // Create options for all the parameters - command.AddOption(new Option("--presence-id", description: "key: id of presence")); + var presenceIdOption = new Option("--presence-id", description: "key: id of presence"); + presenceIdOption.IsRequired = true; + command.AddOption(presenceIdOption); command.Handler = CommandHandler.Create(async (presenceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(presenceId)) requestInfo.PathParameters.Add("presence_id", presenceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get presences from communications"; // Create options for all the parameters - command.AddOption(new Option("--presence-id", description: "key: id of presence")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (presenceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(presenceId)) requestInfo.PathParameters.Add("presence_id", presenceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var presenceIdOption = new Option("--presence-id", description: "key: id of presence"); + presenceIdOption.IsRequired = true; + command.AddOption(presenceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (presenceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property presences in communications"; // Create options for all the parameters - command.AddOption(new Option("--presence-id", description: "key: id of presence")); - command.AddOption(new Option("--body")); + var presenceIdOption = new Option("--presence-id", description: "key: id of presence"); + presenceIdOption.IsRequired = true; + command.AddOption(presenceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (presenceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(presenceId)) requestInfo.PathParameters.Add("presence_id", presenceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/Presences/Item/SetPresence/SetPresenceRequestBuilder.cs b/src/generated/Communications/Presences/Item/SetPresence/SetPresenceRequestBuilder.cs index 5a74edc324f..63db18cc1bc 100644 --- a/src/generated/Communications/Presences/Item/SetPresence/SetPresenceRequestBuilder.cs +++ b/src/generated/Communications/Presences/Item/SetPresence/SetPresenceRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setPresence"; // Create options for all the parameters - command.AddOption(new Option("--presence-id", description: "key: id of presence")); - command.AddOption(new Option("--body")); + var presenceIdOption = new Option("--presence-id", description: "key: id of presence"); + presenceIdOption.IsRequired = true; + command.AddOption(presenceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (presenceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(presenceId)) requestInfo.PathParameters.Add("presence_id", presenceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Communications/Presences/PresencesRequestBuilder.cs b/src/generated/Communications/Presences/PresencesRequestBuilder.cs index 9c6912c6475..202172b88a5 100644 --- a/src/generated/Communications/Presences/PresencesRequestBuilder.cs +++ b/src/generated/Communications/Presences/PresencesRequestBuilder.cs @@ -38,12 +38,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to presences for communications"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +65,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get presences from communications"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Compliance/ComplianceRequestBuilder.cs b/src/generated/Compliance/ComplianceRequestBuilder.cs index abb7093f4f5..76f65ce5e9d 100644 --- a/src/generated/Compliance/ComplianceRequestBuilder.cs +++ b/src/generated/Compliance/ComplianceRequestBuilder.cs @@ -26,12 +26,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get compliance"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(select)) requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -50,12 +57,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update compliance"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Connections/ConnectionsRequestBuilder.cs b/src/generated/Connections/ConnectionsRequestBuilder.cs index a4f7d80123e..8564ff45e84 100644 --- a/src/generated/Connections/ConnectionsRequestBuilder.cs +++ b/src/generated/Connections/ConnectionsRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to connections"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +67,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from connections"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Connections/Item/ExternalConnectionRequestBuilder.cs b/src/generated/Connections/Item/ExternalConnectionRequestBuilder.cs index dfe8011e9ad..5815bf55ec9 100644 --- a/src/generated/Connections/Item/ExternalConnectionRequestBuilder.cs +++ b/src/generated/Connections/Item/ExternalConnectionRequestBuilder.cs @@ -30,10 +30,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from connections"; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); command.Handler = CommandHandler.Create(async (externalConnectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,14 +49,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from connections by key"; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (externalConnectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (externalConnectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -94,14 +104,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in connections"; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--body")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (externalConnectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Connections/Item/Groups/GroupsRequestBuilder.cs b/src/generated/Connections/Item/Groups/GroupsRequestBuilder.cs index e80d65dab0b..df870f4a441 100644 --- a/src/generated/Connections/Item/Groups/GroupsRequestBuilder.cs +++ b/src/generated/Connections/Item/Groups/GroupsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--body")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (externalConnectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (externalConnectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (externalConnectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Connections/Item/Groups/Item/ExternalGroupRequestBuilder.cs b/src/generated/Connections/Item/Groups/Item/ExternalGroupRequestBuilder.cs index 93b42ee0e78..3f3c8d2a53a 100644 --- a/src/generated/Connections/Item/Groups/Item/ExternalGroupRequestBuilder.cs +++ b/src/generated/Connections/Item/Groups/Item/ExternalGroupRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--externalgroup-id", description: "key: id of externalGroup")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var externalGroupIdOption = new Option("--externalgroup-id", description: "key: id of externalGroup"); + externalGroupIdOption.IsRequired = true; + command.AddOption(externalGroupIdOption); command.Handler = CommandHandler.Create(async (externalConnectionId, externalGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - if (!String.IsNullOrEmpty(externalGroupId)) requestInfo.PathParameters.Add("externalGroup_id", externalGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--externalgroup-id", description: "key: id of externalGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (externalConnectionId, externalGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - if (!String.IsNullOrEmpty(externalGroupId)) requestInfo.PathParameters.Add("externalGroup_id", externalGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var externalGroupIdOption = new Option("--externalgroup-id", description: "key: id of externalGroup"); + externalGroupIdOption.IsRequired = true; + command.AddOption(externalGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (externalConnectionId, externalGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--externalgroup-id", description: "key: id of externalGroup")); - command.AddOption(new Option("--body")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var externalGroupIdOption = new Option("--externalgroup-id", description: "key: id of externalGroup"); + externalGroupIdOption.IsRequired = true; + command.AddOption(externalGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (externalConnectionId, externalGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - if (!String.IsNullOrEmpty(externalGroupId)) requestInfo.PathParameters.Add("externalGroup_id", externalGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Connections/Item/Groups/Item/Members/Item/IdentityRequestBuilder.cs b/src/generated/Connections/Item/Groups/Item/Members/Item/IdentityRequestBuilder.cs index d624a25c23e..feddfc3b99a 100644 --- a/src/generated/Connections/Item/Groups/Item/Members/Item/IdentityRequestBuilder.cs +++ b/src/generated/Connections/Item/Groups/Item/Members/Item/IdentityRequestBuilder.cs @@ -20,20 +20,24 @@ public class IdentityRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members."; + command.Description = "A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--externalgroup-id", description: "key: id of externalGroup")); - command.AddOption(new Option("--identity-id", description: "key: id of identity")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var externalGroupIdOption = new Option("--externalgroup-id", description: "key: id of externalGroup"); + externalGroupIdOption.IsRequired = true; + command.AddOption(externalGroupIdOption); + var identityIdOption = new Option("--identity-id", description: "key: id of identity"); + identityIdOption.IsRequired = true; + command.AddOption(identityIdOption); command.Handler = CommandHandler.Create(async (externalConnectionId, externalGroupId, identityId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - if (!String.IsNullOrEmpty(externalGroupId)) requestInfo.PathParameters.Add("externalGroup_id", externalGroupId); - if (!String.IsNullOrEmpty(identityId)) requestInfo.PathParameters.Add("identity_id", identityId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,24 +45,34 @@ public Command BuildDeleteCommand() { return command; } /// - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members."; + command.Description = "A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--externalgroup-id", description: "key: id of externalGroup")); - command.AddOption(new Option("--identity-id", description: "key: id of identity")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (externalConnectionId, externalGroupId, identityId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - if (!String.IsNullOrEmpty(externalGroupId)) requestInfo.PathParameters.Add("externalGroup_id", externalGroupId); - if (!String.IsNullOrEmpty(identityId)) requestInfo.PathParameters.Add("identity_id", identityId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var externalGroupIdOption = new Option("--externalgroup-id", description: "key: id of externalGroup"); + externalGroupIdOption.IsRequired = true; + command.AddOption(externalGroupIdOption); + var identityIdOption = new Option("--identity-id", description: "key: id of identity"); + identityIdOption.IsRequired = true; + command.AddOption(identityIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (externalConnectionId, externalGroupId, identityId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,24 +85,30 @@ public Command BuildGetCommand() { return command; } /// - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members."; + command.Description = "A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--externalgroup-id", description: "key: id of externalGroup")); - command.AddOption(new Option("--identity-id", description: "key: id of identity")); - command.AddOption(new Option("--body")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var externalGroupIdOption = new Option("--externalgroup-id", description: "key: id of externalGroup"); + externalGroupIdOption.IsRequired = true; + command.AddOption(externalGroupIdOption); + var identityIdOption = new Option("--identity-id", description: "key: id of identity"); + identityIdOption.IsRequired = true; + command.AddOption(identityIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (externalConnectionId, externalGroupId, identityId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - if (!String.IsNullOrEmpty(externalGroupId)) requestInfo.PathParameters.Add("externalGroup_id", externalGroupId); - if (!String.IsNullOrEmpty(identityId)) requestInfo.PathParameters.Add("identity_id", identityId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -109,7 +129,7 @@ public IdentityRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// Request headers /// Request options /// @@ -124,7 +144,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// Request headers /// Request options /// Request query parameters @@ -145,7 +165,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// /// Request headers /// Request options @@ -163,7 +183,7 @@ public RequestInformation CreatePatchRequestInformation(ApiSdk.Models.Microsoft. return requestInfo; } /// - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +194,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -186,7 +206,7 @@ public async Task DeleteAsync(Action> h = default, I return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -198,7 +218,7 @@ public async Task PatchAsync(ApiSdk.Models.Microsoft.Graph.Identity model, Actio var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Connections/Item/Groups/Item/Members/MembersRequestBuilder.cs b/src/generated/Connections/Item/Groups/Item/Members/MembersRequestBuilder.cs index a734aa627bd..d000cc449c0 100644 --- a/src/generated/Connections/Item/Groups/Item/Members/MembersRequestBuilder.cs +++ b/src/generated/Connections/Item/Groups/Item/Members/MembersRequestBuilder.cs @@ -30,22 +30,27 @@ public List BuildCommand() { return commands; } /// - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members."; + command.Description = "A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--externalgroup-id", description: "key: id of externalGroup")); - command.AddOption(new Option("--body")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var externalGroupIdOption = new Option("--externalgroup-id", description: "key: id of externalGroup"); + externalGroupIdOption.IsRequired = true; + command.AddOption(externalGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (externalConnectionId, externalGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - if (!String.IsNullOrEmpty(externalGroupId)) requestInfo.PathParameters.Add("externalGroup_id", externalGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,34 +63,56 @@ public Command BuildCreateCommand() { return command; } /// - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members."; + command.Description = "A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--externalgroup-id", description: "key: id of externalGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (externalConnectionId, externalGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - if (!String.IsNullOrEmpty(externalGroupId)) requestInfo.PathParameters.Add("externalGroup_id", externalGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var externalGroupIdOption = new Option("--externalgroup-id", description: "key: id of externalGroup"); + externalGroupIdOption.IsRequired = true; + command.AddOption(externalGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (externalConnectionId, externalGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -111,7 +138,7 @@ public MembersRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// Request headers /// Request options /// Request query parameters @@ -132,7 +159,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// /// Request headers /// Request options @@ -150,7 +177,7 @@ public RequestInformation CreatePostRequestInformation(ApiSdk.Models.Microsoft.G return requestInfo; } /// - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +189,7 @@ public async Task GetAsync(Action q = defau return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -174,7 +201,7 @@ public async Task GetAsync(Action q = defau var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Connections/Item/Items/Item/ExternalItemRequestBuilder.cs b/src/generated/Connections/Item/Items/Item/ExternalItemRequestBuilder.cs index 0c00bd16f93..5072e7f8c56 100644 --- a/src/generated/Connections/Item/Items/Item/ExternalItemRequestBuilder.cs +++ b/src/generated/Connections/Item/Items/Item/ExternalItemRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--externalitem-id", description: "key: id of externalItem")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var externalItemIdOption = new Option("--externalitem-id", description: "key: id of externalItem"); + externalItemIdOption.IsRequired = true; + command.AddOption(externalItemIdOption); command.Handler = CommandHandler.Create(async (externalConnectionId, externalItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - if (!String.IsNullOrEmpty(externalItemId)) requestInfo.PathParameters.Add("externalItem_id", externalItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--externalitem-id", description: "key: id of externalItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (externalConnectionId, externalItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - if (!String.IsNullOrEmpty(externalItemId)) requestInfo.PathParameters.Add("externalItem_id", externalItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var externalItemIdOption = new Option("--externalitem-id", description: "key: id of externalItem"); + externalItemIdOption.IsRequired = true; + command.AddOption(externalItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (externalConnectionId, externalItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--externalitem-id", description: "key: id of externalItem")); - command.AddOption(new Option("--body")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var externalItemIdOption = new Option("--externalitem-id", description: "key: id of externalItem"); + externalItemIdOption.IsRequired = true; + command.AddOption(externalItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (externalConnectionId, externalItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - if (!String.IsNullOrEmpty(externalItemId)) requestInfo.PathParameters.Add("externalItem_id", externalItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Connections/Item/Items/ItemsRequestBuilder.cs b/src/generated/Connections/Item/Items/ItemsRequestBuilder.cs index bcc4aae3772..ce82e3e93f7 100644 --- a/src/generated/Connections/Item/Items/ItemsRequestBuilder.cs +++ b/src/generated/Connections/Item/Items/ItemsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--body")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (externalConnectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (externalConnectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (externalConnectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Connections/Item/Operations/Item/ConnectionOperationRequestBuilder.cs b/src/generated/Connections/Item/Operations/Item/ConnectionOperationRequestBuilder.cs index aea44e0f7c0..fe22e3927e9 100644 --- a/src/generated/Connections/Item/Operations/Item/ConnectionOperationRequestBuilder.cs +++ b/src/generated/Connections/Item/Operations/Item/ConnectionOperationRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--connectionoperation-id", description: "key: id of connectionOperation")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var connectionOperationIdOption = new Option("--connectionoperation-id", description: "key: id of connectionOperation"); + connectionOperationIdOption.IsRequired = true; + command.AddOption(connectionOperationIdOption); command.Handler = CommandHandler.Create(async (externalConnectionId, connectionOperationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - if (!String.IsNullOrEmpty(connectionOperationId)) requestInfo.PathParameters.Add("connectionOperation_id", connectionOperationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--connectionoperation-id", description: "key: id of connectionOperation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (externalConnectionId, connectionOperationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - if (!String.IsNullOrEmpty(connectionOperationId)) requestInfo.PathParameters.Add("connectionOperation_id", connectionOperationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var connectionOperationIdOption = new Option("--connectionoperation-id", description: "key: id of connectionOperation"); + connectionOperationIdOption.IsRequired = true; + command.AddOption(connectionOperationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (externalConnectionId, connectionOperationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--connectionoperation-id", description: "key: id of connectionOperation")); - command.AddOption(new Option("--body")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var connectionOperationIdOption = new Option("--connectionoperation-id", description: "key: id of connectionOperation"); + connectionOperationIdOption.IsRequired = true; + command.AddOption(connectionOperationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (externalConnectionId, connectionOperationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - if (!String.IsNullOrEmpty(connectionOperationId)) requestInfo.PathParameters.Add("connectionOperation_id", connectionOperationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Connections/Item/Operations/OperationsRequestBuilder.cs b/src/generated/Connections/Item/Operations/OperationsRequestBuilder.cs index 378681f607a..7f92d9b8da8 100644 --- a/src/generated/Connections/Item/Operations/OperationsRequestBuilder.cs +++ b/src/generated/Connections/Item/Operations/OperationsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--body")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (externalConnectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (externalConnectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (externalConnectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Connections/Item/Schema/SchemaRequestBuilder.cs b/src/generated/Connections/Item/Schema/SchemaRequestBuilder.cs index ff710e6d9cb..d0548c375ec 100644 --- a/src/generated/Connections/Item/Schema/SchemaRequestBuilder.cs +++ b/src/generated/Connections/Item/Schema/SchemaRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); command.Handler = CommandHandler.Create(async (externalConnectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (externalConnectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (externalConnectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--body")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (externalConnectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Contacts/ContactsRequestBuilder.cs b/src/generated/Contacts/ContactsRequestBuilder.cs index ba4154b146d..58cc72f212f 100644 --- a/src/generated/Contacts/ContactsRequestBuilder.cs +++ b/src/generated/Contacts/ContactsRequestBuilder.cs @@ -49,12 +49,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to contacts"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,24 +88,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from contacts"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/Delta/DeltaRequestBuilder.cs b/src/generated/Contacts/Delta/DeltaRequestBuilder.cs index c48a9cc7534..b35949b1484 100644 --- a/src/generated/Contacts/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Contacts/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs b/src/generated/Contacts/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs index a4cc8891521..fbd539e0d61 100644 --- a/src/generated/Contacts/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs +++ b/src/generated/Contacts/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getAvailableExtensionProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/GetByIds/GetByIdsRequestBuilder.cs b/src/generated/Contacts/GetByIds/GetByIdsRequestBuilder.cs index bccdd2b149a..595c701eedf 100644 --- a/src/generated/Contacts/GetByIds/GetByIdsRequestBuilder.cs +++ b/src/generated/Contacts/GetByIds/GetByIdsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getByIds"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs b/src/generated/Contacts/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs index 28ac1e4788b..ac0b340fb24 100644 --- a/src/generated/Contacts/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs +++ b/src/generated/Contacts/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--body")); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (orgContactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs b/src/generated/Contacts/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs index 60c9109f5ea..59b95840a4e 100644 --- a/src/generated/Contacts/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs +++ b/src/generated/Contacts/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--body")); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (orgContactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/Item/DirectReports/@Ref/RefRequestBuilder.cs b/src/generated/Contacts/Item/DirectReports/@Ref/RefRequestBuilder.cs index f4f55e6fc6e..7a171fe5a8a 100644 --- a/src/generated/Contacts/Item/DirectReports/@Ref/RefRequestBuilder.cs +++ b/src/generated/Contacts/Item/DirectReports/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The contact's direct reports. (The users and contacts that have their manager property set to this contact.) Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (orgContactId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (orgContactId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The contact's direct reports. (The users and contacts that have their manager property set to this contact.) Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--body")); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (orgContactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/Item/DirectReports/DirectReportsRequestBuilder.cs b/src/generated/Contacts/Item/DirectReports/DirectReportsRequestBuilder.cs index 1ab6269de83..3e6f9e06627 100644 --- a/src/generated/Contacts/Item/DirectReports/DirectReportsRequestBuilder.cs +++ b/src/generated/Contacts/Item/DirectReports/DirectReportsRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The contact's direct reports. (The users and contacts that have their manager property set to this contact.) Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (orgContactId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (orgContactId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs b/src/generated/Contacts/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs index 80aabd4221e..cefdead9b80 100644 --- a/src/generated/Contacts/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs +++ b/src/generated/Contacts/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--body")); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (orgContactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs b/src/generated/Contacts/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs index 49ed27a3459..956f12eef9f 100644 --- a/src/generated/Contacts/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs +++ b/src/generated/Contacts/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--body")); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (orgContactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/Item/Manager/@Ref/RefRequestBuilder.cs b/src/generated/Contacts/Item/Manager/@Ref/RefRequestBuilder.cs index 05390372a8a..e21231ac4a6 100644 --- a/src/generated/Contacts/Item/Manager/@Ref/RefRequestBuilder.cs +++ b/src/generated/Contacts/Item/Manager/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user or contact that is this contact's manager. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); command.Handler = CommandHandler.Create(async (orgContactId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user or contact that is this contact's manager. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); command.Handler = CommandHandler.Create(async (orgContactId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The user or contact that is this contact's manager. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--body")); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (orgContactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Contacts/Item/Manager/ManagerRequestBuilder.cs b/src/generated/Contacts/Item/Manager/ManagerRequestBuilder.cs index d4f3fd3e426..fe97c0acd19 100644 --- a/src/generated/Contacts/Item/Manager/ManagerRequestBuilder.cs +++ b/src/generated/Contacts/Item/Manager/ManagerRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user or contact that is this contact's manager. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (orgContactId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (orgContactId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/Item/MemberOf/@Ref/RefRequestBuilder.cs b/src/generated/Contacts/Item/MemberOf/@Ref/RefRequestBuilder.cs index 066fa27957c..e4f3615b932 100644 --- a/src/generated/Contacts/Item/MemberOf/@Ref/RefRequestBuilder.cs +++ b/src/generated/Contacts/Item/MemberOf/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Groups that this contact is a member of. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (orgContactId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (orgContactId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Groups that this contact is a member of. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--body")); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (orgContactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/Item/MemberOf/MemberOfRequestBuilder.cs b/src/generated/Contacts/Item/MemberOf/MemberOfRequestBuilder.cs index d36bb50490b..010d1238bd4 100644 --- a/src/generated/Contacts/Item/MemberOf/MemberOfRequestBuilder.cs +++ b/src/generated/Contacts/Item/MemberOf/MemberOfRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Groups that this contact is a member of. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (orgContactId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (orgContactId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/Item/OrgContactRequestBuilder.cs b/src/generated/Contacts/Item/OrgContactRequestBuilder.cs index fc93e9a687c..c252921330e 100644 --- a/src/generated/Contacts/Item/OrgContactRequestBuilder.cs +++ b/src/generated/Contacts/Item/OrgContactRequestBuilder.cs @@ -47,10 +47,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from contacts"; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); command.Handler = CommandHandler.Create(async (orgContactId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -71,14 +73,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from contacts by key"; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (orgContactId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (orgContactId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -123,14 +133,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in contacts"; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--body")); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (orgContactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Contacts/Item/Restore/RestoreRequestBuilder.cs b/src/generated/Contacts/Item/Restore/RestoreRequestBuilder.cs index 70d69ef52f2..63762e965a3 100644 --- a/src/generated/Contacts/Item/Restore/RestoreRequestBuilder.cs +++ b/src/generated/Contacts/Item/Restore/RestoreRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restore"; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); command.Handler = CommandHandler.Create(async (orgContactId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs b/src/generated/Contacts/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs index aef33ea6a5e..e6e7b52e530 100644 --- a/src/generated/Contacts/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs +++ b/src/generated/Contacts/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of transitiveMemberOf from contacts"; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (orgContactId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (orgContactId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Create new navigation property ref to transitiveMemberOf for contacts"; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--body")); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (orgContactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs b/src/generated/Contacts/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs index 6bdd462a6cd..cf477875339 100644 --- a/src/generated/Contacts/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs +++ b/src/generated/Contacts/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get transitiveMemberOf from contacts"; // Create options for all the parameters - command.AddOption(new Option("--orgcontact-id", description: "key: id of orgContact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (orgContactId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(orgContactId)) requestInfo.PathParameters.Add("orgContact_id", orgContactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var orgContactIdOption = new Option("--orgcontact-id", description: "key: id of orgContact"); + orgContactIdOption.IsRequired = true; + command.AddOption(orgContactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (orgContactId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contacts/ValidateProperties/ValidatePropertiesRequestBuilder.cs b/src/generated/Contacts/ValidateProperties/ValidatePropertiesRequestBuilder.cs index c5ca8a959e3..b272794d72d 100644 --- a/src/generated/Contacts/ValidateProperties/ValidatePropertiesRequestBuilder.cs +++ b/src/generated/Contacts/ValidateProperties/ValidatePropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validateProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Contracts/ContractsRequestBuilder.cs b/src/generated/Contracts/ContractsRequestBuilder.cs index fd597ea960b..035adcf4ff8 100644 --- a/src/generated/Contracts/ContractsRequestBuilder.cs +++ b/src/generated/Contracts/ContractsRequestBuilder.cs @@ -44,12 +44,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to contracts"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,24 +83,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from contracts"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contracts/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs b/src/generated/Contracts/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs index 39bc2b40604..9209f9b80c1 100644 --- a/src/generated/Contracts/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs +++ b/src/generated/Contracts/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getAvailableExtensionProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contracts/GetByIds/GetByIdsRequestBuilder.cs b/src/generated/Contracts/GetByIds/GetByIdsRequestBuilder.cs index b052032923b..4fe78049856 100644 --- a/src/generated/Contracts/GetByIds/GetByIdsRequestBuilder.cs +++ b/src/generated/Contracts/GetByIds/GetByIdsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getByIds"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contracts/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs b/src/generated/Contracts/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs index 294ad8c3ede..9e0aff9c9cd 100644 --- a/src/generated/Contracts/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs +++ b/src/generated/Contracts/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--contract-id", description: "key: id of contract")); - command.AddOption(new Option("--body")); + var contractIdOption = new Option("--contract-id", description: "key: id of contract"); + contractIdOption.IsRequired = true; + command.AddOption(contractIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contractId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contractId)) requestInfo.PathParameters.Add("contract_id", contractId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contracts/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs b/src/generated/Contracts/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs index b4c94c35d63..4ffdbf4b74a 100644 --- a/src/generated/Contracts/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs +++ b/src/generated/Contracts/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--contract-id", description: "key: id of contract")); - command.AddOption(new Option("--body")); + var contractIdOption = new Option("--contract-id", description: "key: id of contract"); + contractIdOption.IsRequired = true; + command.AddOption(contractIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contractId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contractId)) requestInfo.PathParameters.Add("contract_id", contractId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contracts/Item/ContractRequestBuilder.cs b/src/generated/Contracts/Item/ContractRequestBuilder.cs index 0731195baa3..0c2b21cb6cd 100644 --- a/src/generated/Contracts/Item/ContractRequestBuilder.cs +++ b/src/generated/Contracts/Item/ContractRequestBuilder.cs @@ -43,10 +43,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from contracts"; // Create options for all the parameters - command.AddOption(new Option("--contract-id", description: "key: id of contract")); + var contractIdOption = new Option("--contract-id", description: "key: id of contract"); + contractIdOption.IsRequired = true; + command.AddOption(contractIdOption); command.Handler = CommandHandler.Create(async (contractId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contractId)) requestInfo.PathParameters.Add("contract_id", contractId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -60,14 +62,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from contracts by key"; // Create options for all the parameters - command.AddOption(new Option("--contract-id", description: "key: id of contract")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contractId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contractId)) requestInfo.PathParameters.Add("contract_id", contractId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contractIdOption = new Option("--contract-id", description: "key: id of contract"); + contractIdOption.IsRequired = true; + command.AddOption(contractIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contractId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,14 +108,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in contracts"; // Create options for all the parameters - command.AddOption(new Option("--contract-id", description: "key: id of contract")); - command.AddOption(new Option("--body")); + var contractIdOption = new Option("--contract-id", description: "key: id of contract"); + contractIdOption.IsRequired = true; + command.AddOption(contractIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contractId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contractId)) requestInfo.PathParameters.Add("contract_id", contractId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Contracts/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs b/src/generated/Contracts/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs index 2b63dd78f5a..afab847935b 100644 --- a/src/generated/Contracts/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs +++ b/src/generated/Contracts/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--contract-id", description: "key: id of contract")); - command.AddOption(new Option("--body")); + var contractIdOption = new Option("--contract-id", description: "key: id of contract"); + contractIdOption.IsRequired = true; + command.AddOption(contractIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contractId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contractId)) requestInfo.PathParameters.Add("contract_id", contractId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contracts/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs b/src/generated/Contracts/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs index 88e9574ddb6..1136a942148 100644 --- a/src/generated/Contracts/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs +++ b/src/generated/Contracts/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--contract-id", description: "key: id of contract")); - command.AddOption(new Option("--body")); + var contractIdOption = new Option("--contract-id", description: "key: id of contract"); + contractIdOption.IsRequired = true; + command.AddOption(contractIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contractId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contractId)) requestInfo.PathParameters.Add("contract_id", contractId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contracts/Item/Restore/RestoreRequestBuilder.cs b/src/generated/Contracts/Item/Restore/RestoreRequestBuilder.cs index ba7a319f170..ca5702ee580 100644 --- a/src/generated/Contracts/Item/Restore/RestoreRequestBuilder.cs +++ b/src/generated/Contracts/Item/Restore/RestoreRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restore"; // Create options for all the parameters - command.AddOption(new Option("--contract-id", description: "key: id of contract")); + var contractIdOption = new Option("--contract-id", description: "key: id of contract"); + contractIdOption.IsRequired = true; + command.AddOption(contractIdOption); command.Handler = CommandHandler.Create(async (contractId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(contractId)) requestInfo.PathParameters.Add("contract_id", contractId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Contracts/ValidateProperties/ValidatePropertiesRequestBuilder.cs b/src/generated/Contracts/ValidateProperties/ValidatePropertiesRequestBuilder.cs index ee8b5e096f7..e2dfdf5c7f1 100644 --- a/src/generated/Contracts/ValidateProperties/ValidatePropertiesRequestBuilder.cs +++ b/src/generated/Contracts/ValidateProperties/ValidatePropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validateProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DataPolicyOperations/DataPolicyOperationsRequestBuilder.cs b/src/generated/DataPolicyOperations/DataPolicyOperationsRequestBuilder.cs index fa1592d5d09..d26703b971a 100644 --- a/src/generated/DataPolicyOperations/DataPolicyOperationsRequestBuilder.cs +++ b/src/generated/DataPolicyOperations/DataPolicyOperationsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to dataPolicyOperations"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from dataPolicyOperations"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DataPolicyOperations/Item/DataPolicyOperationRequestBuilder.cs b/src/generated/DataPolicyOperations/Item/DataPolicyOperationRequestBuilder.cs index d674d21c8df..53fd6fb2721 100644 --- a/src/generated/DataPolicyOperations/Item/DataPolicyOperationRequestBuilder.cs +++ b/src/generated/DataPolicyOperations/Item/DataPolicyOperationRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from dataPolicyOperations"; // Create options for all the parameters - command.AddOption(new Option("--datapolicyoperation-id", description: "key: id of dataPolicyOperation")); + var dataPolicyOperationIdOption = new Option("--datapolicyoperation-id", description: "key: id of dataPolicyOperation"); + dataPolicyOperationIdOption.IsRequired = true; + command.AddOption(dataPolicyOperationIdOption); command.Handler = CommandHandler.Create(async (dataPolicyOperationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(dataPolicyOperationId)) requestInfo.PathParameters.Add("dataPolicyOperation_id", dataPolicyOperationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from dataPolicyOperations by key"; // Create options for all the parameters - command.AddOption(new Option("--datapolicyoperation-id", description: "key: id of dataPolicyOperation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (dataPolicyOperationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(dataPolicyOperationId)) requestInfo.PathParameters.Add("dataPolicyOperation_id", dataPolicyOperationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var dataPolicyOperationIdOption = new Option("--datapolicyoperation-id", description: "key: id of dataPolicyOperation"); + dataPolicyOperationIdOption.IsRequired = true; + command.AddOption(dataPolicyOperationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (dataPolicyOperationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in dataPolicyOperations"; // Create options for all the parameters - command.AddOption(new Option("--datapolicyoperation-id", description: "key: id of dataPolicyOperation")); - command.AddOption(new Option("--body")); + var dataPolicyOperationIdOption = new Option("--datapolicyoperation-id", description: "key: id of dataPolicyOperation"); + dataPolicyOperationIdOption.IsRequired = true; + command.AddOption(dataPolicyOperationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (dataPolicyOperationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(dataPolicyOperationId)) requestInfo.PathParameters.Add("dataPolicyOperation_id", dataPolicyOperationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/AndroidManagedAppProtections/AndroidManagedAppProtectionsRequestBuilder.cs b/src/generated/DeviceAppManagement/AndroidManagedAppProtections/AndroidManagedAppProtectionsRequestBuilder.cs index 5f490845150..f891bd358a7 100644 --- a/src/generated/DeviceAppManagement/AndroidManagedAppProtections/AndroidManagedAppProtectionsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/AndroidManagedAppProtections/AndroidManagedAppProtectionsRequestBuilder.cs @@ -38,12 +38,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Android managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +65,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Android managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/AndroidManagedAppProtectionRequestBuilder.cs b/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/AndroidManagedAppProtectionRequestBuilder.cs index 0dce8e59e37..c80f2594af8 100644 --- a/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/AndroidManagedAppProtectionRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/AndroidManagedAppProtectionRequestBuilder.cs @@ -35,10 +35,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Android managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection")); + var androidManagedAppProtectionIdOption = new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection"); + androidManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(androidManagedAppProtectionIdOption); command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(androidManagedAppProtectionId)) requestInfo.PathParameters.Add("androidManagedAppProtection_id", androidManagedAppProtectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -60,14 +62,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Android managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(androidManagedAppProtectionId)) requestInfo.PathParameters.Add("androidManagedAppProtection_id", androidManagedAppProtectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var androidManagedAppProtectionIdOption = new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection"); + androidManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(androidManagedAppProtectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,14 +96,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Android managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection")); - command.AddOption(new Option("--body")); + var androidManagedAppProtectionIdOption = new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection"); + androidManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(androidManagedAppProtectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(androidManagedAppProtectionId)) requestInfo.PathParameters.Add("androidManagedAppProtection_id", androidManagedAppProtectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/Apps/AppsRequestBuilder.cs b/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/Apps/AppsRequestBuilder.cs index b284c8347ae..2cbcfb24a2b 100644 --- a/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/Apps/AppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/Apps/AppsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection")); - command.AddOption(new Option("--body")); + var androidManagedAppProtectionIdOption = new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection"); + androidManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(androidManagedAppProtectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(androidManagedAppProtectionId)) requestInfo.PathParameters.Add("androidManagedAppProtection_id", androidManagedAppProtectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(androidManagedAppProtectionId)) requestInfo.PathParameters.Add("androidManagedAppProtection_id", androidManagedAppProtectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var androidManagedAppProtectionIdOption = new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection"); + androidManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(androidManagedAppProtectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs b/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs index efdc85ad9fe..aa80f262287 100644 --- a/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection")); - command.AddOption(new Option("--managedmobileapp-id", description: "key: id of managedMobileApp")); + var androidManagedAppProtectionIdOption = new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection"); + androidManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(androidManagedAppProtectionIdOption); + var managedMobileAppIdOption = new Option("--managedmobileapp-id", description: "key: id of managedMobileApp"); + managedMobileAppIdOption.IsRequired = true; + command.AddOption(managedMobileAppIdOption); command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId, managedMobileAppId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(androidManagedAppProtectionId)) requestInfo.PathParameters.Add("androidManagedAppProtection_id", androidManagedAppProtectionId); - if (!String.IsNullOrEmpty(managedMobileAppId)) requestInfo.PathParameters.Add("managedMobileApp_id", managedMobileAppId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection")); - command.AddOption(new Option("--managedmobileapp-id", description: "key: id of managedMobileApp")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId, managedMobileAppId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(androidManagedAppProtectionId)) requestInfo.PathParameters.Add("androidManagedAppProtection_id", androidManagedAppProtectionId); - if (!String.IsNullOrEmpty(managedMobileAppId)) requestInfo.PathParameters.Add("managedMobileApp_id", managedMobileAppId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var androidManagedAppProtectionIdOption = new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection"); + androidManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(androidManagedAppProtectionIdOption); + var managedMobileAppIdOption = new Option("--managedmobileapp-id", description: "key: id of managedMobileApp"); + managedMobileAppIdOption.IsRequired = true; + command.AddOption(managedMobileAppIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId, managedMobileAppId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection")); - command.AddOption(new Option("--managedmobileapp-id", description: "key: id of managedMobileApp")); - command.AddOption(new Option("--body")); + var androidManagedAppProtectionIdOption = new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection"); + androidManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(androidManagedAppProtectionIdOption); + var managedMobileAppIdOption = new Option("--managedmobileapp-id", description: "key: id of managedMobileApp"); + managedMobileAppIdOption.IsRequired = true; + command.AddOption(managedMobileAppIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId, managedMobileAppId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(androidManagedAppProtectionId)) requestInfo.PathParameters.Add("androidManagedAppProtection_id", androidManagedAppProtectionId); - if (!String.IsNullOrEmpty(managedMobileAppId)) requestInfo.PathParameters.Add("managedMobileApp_id", managedMobileAppId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs b/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs index 9cf08cbb0ea..2665b59cc42 100644 --- a/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/AndroidManagedAppProtections/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Navigation property to deployment summary of the configuration."; // Create options for all the parameters - command.AddOption(new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection")); + var androidManagedAppProtectionIdOption = new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection"); + androidManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(androidManagedAppProtectionIdOption); command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(androidManagedAppProtectionId)) requestInfo.PathParameters.Add("androidManagedAppProtection_id", androidManagedAppProtectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Navigation property to deployment summary of the configuration."; // Create options for all the parameters - command.AddOption(new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(androidManagedAppProtectionId)) requestInfo.PathParameters.Add("androidManagedAppProtection_id", androidManagedAppProtectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var androidManagedAppProtectionIdOption = new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection"); + androidManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(androidManagedAppProtectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Navigation property to deployment summary of the configuration."; // Create options for all the parameters - command.AddOption(new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection")); - command.AddOption(new Option("--body")); + var androidManagedAppProtectionIdOption = new Option("--androidmanagedappprotection-id", description: "key: id of androidManagedAppProtection"); + androidManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(androidManagedAppProtectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (androidManagedAppProtectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(androidManagedAppProtectionId)) requestInfo.PathParameters.Add("androidManagedAppProtection_id", androidManagedAppProtectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/DefaultManagedAppProtections/DefaultManagedAppProtectionsRequestBuilder.cs b/src/generated/DeviceAppManagement/DefaultManagedAppProtections/DefaultManagedAppProtectionsRequestBuilder.cs index ef82e692fac..8a2f6e822ce 100644 --- a/src/generated/DeviceAppManagement/DefaultManagedAppProtections/DefaultManagedAppProtectionsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/DefaultManagedAppProtections/DefaultManagedAppProtectionsRequestBuilder.cs @@ -38,12 +38,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Default managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +65,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Default managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/Apps/AppsRequestBuilder.cs b/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/Apps/AppsRequestBuilder.cs index f516e3d4322..5b679c3cdd9 100644 --- a/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/Apps/AppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/Apps/AppsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection")); - command.AddOption(new Option("--body")); + var defaultManagedAppProtectionIdOption = new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection"); + defaultManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(defaultManagedAppProtectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(defaultManagedAppProtectionId)) requestInfo.PathParameters.Add("defaultManagedAppProtection_id", defaultManagedAppProtectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(defaultManagedAppProtectionId)) requestInfo.PathParameters.Add("defaultManagedAppProtection_id", defaultManagedAppProtectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var defaultManagedAppProtectionIdOption = new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection"); + defaultManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(defaultManagedAppProtectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs b/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs index f45385e941c..90356b59de1 100644 --- a/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection")); - command.AddOption(new Option("--managedmobileapp-id", description: "key: id of managedMobileApp")); + var defaultManagedAppProtectionIdOption = new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection"); + defaultManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(defaultManagedAppProtectionIdOption); + var managedMobileAppIdOption = new Option("--managedmobileapp-id", description: "key: id of managedMobileApp"); + managedMobileAppIdOption.IsRequired = true; + command.AddOption(managedMobileAppIdOption); command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId, managedMobileAppId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(defaultManagedAppProtectionId)) requestInfo.PathParameters.Add("defaultManagedAppProtection_id", defaultManagedAppProtectionId); - if (!String.IsNullOrEmpty(managedMobileAppId)) requestInfo.PathParameters.Add("managedMobileApp_id", managedMobileAppId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection")); - command.AddOption(new Option("--managedmobileapp-id", description: "key: id of managedMobileApp")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId, managedMobileAppId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(defaultManagedAppProtectionId)) requestInfo.PathParameters.Add("defaultManagedAppProtection_id", defaultManagedAppProtectionId); - if (!String.IsNullOrEmpty(managedMobileAppId)) requestInfo.PathParameters.Add("managedMobileApp_id", managedMobileAppId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var defaultManagedAppProtectionIdOption = new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection"); + defaultManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(defaultManagedAppProtectionIdOption); + var managedMobileAppIdOption = new Option("--managedmobileapp-id", description: "key: id of managedMobileApp"); + managedMobileAppIdOption.IsRequired = true; + command.AddOption(managedMobileAppIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId, managedMobileAppId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection")); - command.AddOption(new Option("--managedmobileapp-id", description: "key: id of managedMobileApp")); - command.AddOption(new Option("--body")); + var defaultManagedAppProtectionIdOption = new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection"); + defaultManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(defaultManagedAppProtectionIdOption); + var managedMobileAppIdOption = new Option("--managedmobileapp-id", description: "key: id of managedMobileApp"); + managedMobileAppIdOption.IsRequired = true; + command.AddOption(managedMobileAppIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId, managedMobileAppId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(defaultManagedAppProtectionId)) requestInfo.PathParameters.Add("defaultManagedAppProtection_id", defaultManagedAppProtectionId); - if (!String.IsNullOrEmpty(managedMobileAppId)) requestInfo.PathParameters.Add("managedMobileApp_id", managedMobileAppId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/DefaultManagedAppProtectionRequestBuilder.cs b/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/DefaultManagedAppProtectionRequestBuilder.cs index c34a2261b49..2d61ad29018 100644 --- a/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/DefaultManagedAppProtectionRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/DefaultManagedAppProtectionRequestBuilder.cs @@ -35,10 +35,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Default managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection")); + var defaultManagedAppProtectionIdOption = new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection"); + defaultManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(defaultManagedAppProtectionIdOption); command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(defaultManagedAppProtectionId)) requestInfo.PathParameters.Add("defaultManagedAppProtection_id", defaultManagedAppProtectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -60,14 +62,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Default managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(defaultManagedAppProtectionId)) requestInfo.PathParameters.Add("defaultManagedAppProtection_id", defaultManagedAppProtectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var defaultManagedAppProtectionIdOption = new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection"); + defaultManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(defaultManagedAppProtectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,14 +96,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Default managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection")); - command.AddOption(new Option("--body")); + var defaultManagedAppProtectionIdOption = new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection"); + defaultManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(defaultManagedAppProtectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(defaultManagedAppProtectionId)) requestInfo.PathParameters.Add("defaultManagedAppProtection_id", defaultManagedAppProtectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs b/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs index e4eb51d3c8e..e0b09d50609 100644 --- a/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/DefaultManagedAppProtections/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Navigation property to deployment summary of the configuration."; // Create options for all the parameters - command.AddOption(new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection")); + var defaultManagedAppProtectionIdOption = new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection"); + defaultManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(defaultManagedAppProtectionIdOption); command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(defaultManagedAppProtectionId)) requestInfo.PathParameters.Add("defaultManagedAppProtection_id", defaultManagedAppProtectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Navigation property to deployment summary of the configuration."; // Create options for all the parameters - command.AddOption(new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(defaultManagedAppProtectionId)) requestInfo.PathParameters.Add("defaultManagedAppProtection_id", defaultManagedAppProtectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var defaultManagedAppProtectionIdOption = new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection"); + defaultManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(defaultManagedAppProtectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Navigation property to deployment summary of the configuration."; // Create options for all the parameters - command.AddOption(new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection")); - command.AddOption(new Option("--body")); + var defaultManagedAppProtectionIdOption = new Option("--defaultmanagedappprotection-id", description: "key: id of defaultManagedAppProtection"); + defaultManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(defaultManagedAppProtectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (defaultManagedAppProtectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(defaultManagedAppProtectionId)) requestInfo.PathParameters.Add("defaultManagedAppProtection_id", defaultManagedAppProtectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/DeviceAppManagementRequestBuilder.cs b/src/generated/DeviceAppManagement/DeviceAppManagementRequestBuilder.cs index 1aa120fe507..34cb33fb3c2 100644 --- a/src/generated/DeviceAppManagement/DeviceAppManagementRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/DeviceAppManagementRequestBuilder.cs @@ -55,12 +55,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get deviceAppManagement"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -142,12 +149,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update deviceAppManagement"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/IosManagedAppProtections/IosManagedAppProtectionsRequestBuilder.cs b/src/generated/DeviceAppManagement/IosManagedAppProtections/IosManagedAppProtectionsRequestBuilder.cs index 5b49f9e865d..cc0c3495474 100644 --- a/src/generated/DeviceAppManagement/IosManagedAppProtections/IosManagedAppProtectionsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/IosManagedAppProtections/IosManagedAppProtectionsRequestBuilder.cs @@ -38,12 +38,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "iOS managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +65,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "iOS managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/Apps/AppsRequestBuilder.cs b/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/Apps/AppsRequestBuilder.cs index 788b7dcb593..ff6cd7e433e 100644 --- a/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/Apps/AppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/Apps/AppsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection")); - command.AddOption(new Option("--body")); + var iosManagedAppProtectionIdOption = new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection"); + iosManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(iosManagedAppProtectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(iosManagedAppProtectionId)) requestInfo.PathParameters.Add("iosManagedAppProtection_id", iosManagedAppProtectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(iosManagedAppProtectionId)) requestInfo.PathParameters.Add("iosManagedAppProtection_id", iosManagedAppProtectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var iosManagedAppProtectionIdOption = new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection"); + iosManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(iosManagedAppProtectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs b/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs index dd50ae8ace2..e1a31efcdfe 100644 --- a/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection")); - command.AddOption(new Option("--managedmobileapp-id", description: "key: id of managedMobileApp")); + var iosManagedAppProtectionIdOption = new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection"); + iosManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(iosManagedAppProtectionIdOption); + var managedMobileAppIdOption = new Option("--managedmobileapp-id", description: "key: id of managedMobileApp"); + managedMobileAppIdOption.IsRequired = true; + command.AddOption(managedMobileAppIdOption); command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId, managedMobileAppId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(iosManagedAppProtectionId)) requestInfo.PathParameters.Add("iosManagedAppProtection_id", iosManagedAppProtectionId); - if (!String.IsNullOrEmpty(managedMobileAppId)) requestInfo.PathParameters.Add("managedMobileApp_id", managedMobileAppId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection")); - command.AddOption(new Option("--managedmobileapp-id", description: "key: id of managedMobileApp")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId, managedMobileAppId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(iosManagedAppProtectionId)) requestInfo.PathParameters.Add("iosManagedAppProtection_id", iosManagedAppProtectionId); - if (!String.IsNullOrEmpty(managedMobileAppId)) requestInfo.PathParameters.Add("managedMobileApp_id", managedMobileAppId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var iosManagedAppProtectionIdOption = new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection"); + iosManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(iosManagedAppProtectionIdOption); + var managedMobileAppIdOption = new Option("--managedmobileapp-id", description: "key: id of managedMobileApp"); + managedMobileAppIdOption.IsRequired = true; + command.AddOption(managedMobileAppIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId, managedMobileAppId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection")); - command.AddOption(new Option("--managedmobileapp-id", description: "key: id of managedMobileApp")); - command.AddOption(new Option("--body")); + var iosManagedAppProtectionIdOption = new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection"); + iosManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(iosManagedAppProtectionIdOption); + var managedMobileAppIdOption = new Option("--managedmobileapp-id", description: "key: id of managedMobileApp"); + managedMobileAppIdOption.IsRequired = true; + command.AddOption(managedMobileAppIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId, managedMobileAppId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(iosManagedAppProtectionId)) requestInfo.PathParameters.Add("iosManagedAppProtection_id", iosManagedAppProtectionId); - if (!String.IsNullOrEmpty(managedMobileAppId)) requestInfo.PathParameters.Add("managedMobileApp_id", managedMobileAppId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs b/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs index 8f86913d405..2ce56a3211b 100644 --- a/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Navigation property to deployment summary of the configuration."; // Create options for all the parameters - command.AddOption(new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection")); + var iosManagedAppProtectionIdOption = new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection"); + iosManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(iosManagedAppProtectionIdOption); command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(iosManagedAppProtectionId)) requestInfo.PathParameters.Add("iosManagedAppProtection_id", iosManagedAppProtectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Navigation property to deployment summary of the configuration."; // Create options for all the parameters - command.AddOption(new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(iosManagedAppProtectionId)) requestInfo.PathParameters.Add("iosManagedAppProtection_id", iosManagedAppProtectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var iosManagedAppProtectionIdOption = new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection"); + iosManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(iosManagedAppProtectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Navigation property to deployment summary of the configuration."; // Create options for all the parameters - command.AddOption(new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection")); - command.AddOption(new Option("--body")); + var iosManagedAppProtectionIdOption = new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection"); + iosManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(iosManagedAppProtectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(iosManagedAppProtectionId)) requestInfo.PathParameters.Add("iosManagedAppProtection_id", iosManagedAppProtectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/IosManagedAppProtectionRequestBuilder.cs b/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/IosManagedAppProtectionRequestBuilder.cs index a3750fd8d2b..d628275cf71 100644 --- a/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/IosManagedAppProtectionRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/IosManagedAppProtections/Item/IosManagedAppProtectionRequestBuilder.cs @@ -35,10 +35,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "iOS managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection")); + var iosManagedAppProtectionIdOption = new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection"); + iosManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(iosManagedAppProtectionIdOption); command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(iosManagedAppProtectionId)) requestInfo.PathParameters.Add("iosManagedAppProtection_id", iosManagedAppProtectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -60,14 +62,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "iOS managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(iosManagedAppProtectionId)) requestInfo.PathParameters.Add("iosManagedAppProtection_id", iosManagedAppProtectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var iosManagedAppProtectionIdOption = new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection"); + iosManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(iosManagedAppProtectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,14 +96,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "iOS managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection")); - command.AddOption(new Option("--body")); + var iosManagedAppProtectionIdOption = new Option("--iosmanagedappprotection-id", description: "key: id of iosManagedAppProtection"); + iosManagedAppProtectionIdOption.IsRequired = true; + command.AddOption(iosManagedAppProtectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (iosManagedAppProtectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(iosManagedAppProtectionId)) requestInfo.PathParameters.Add("iosManagedAppProtection_id", iosManagedAppProtectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/ManagedAppPolicyRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/ManagedAppPolicyRequestBuilder.cs index c8dfbeac056..7f44714e79e 100644 --- a/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/ManagedAppPolicyRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/ManagedAppPolicyRequestBuilder.cs @@ -30,10 +30,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); command.Handler = CommandHandler.Create(async (managedAppPolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,14 +49,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedAppPolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedAppPolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,14 +89,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index 45862b038df..f4e50520c1a 100644 --- a/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/TargetApps/TargetAppsRequestBuilder.cs index 2a7b6f63ce7..683e41ae4fb 100644 --- a/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/TargetApps/TargetAppsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs index f3ce10274ad..7e7dd031b87 100644 --- a/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index 8e90464d085..1bf9419a7f5 100644 --- a/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/WindowsInformationProtection/Assign/AssignRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/WindowsInformationProtection/Assign/AssignRequestBuilder.cs index 13173e1c476..e7ddfa53a15 100644 --- a/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/WindowsInformationProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppPolicies/Item/WindowsInformationProtection/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppPolicies/ManagedAppPoliciesRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppPolicies/ManagedAppPoliciesRequestBuilder.cs index aea055b3197..81f62c74caa 100644 --- a/src/generated/DeviceAppManagement/ManagedAppPolicies/ManagedAppPoliciesRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppPolicies/ManagedAppPoliciesRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +67,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Managed app policies."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/GetUserIdsWithFlaggedAppRegistration/GetUserIdsWithFlaggedAppRegistrationRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/GetUserIdsWithFlaggedAppRegistration/GetUserIdsWithFlaggedAppRegistrationRequestBuilder.cs index a5b71f66125..e83d9d8b433 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/GetUserIdsWithFlaggedAppRegistration/GetUserIdsWithFlaggedAppRegistrationRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/GetUserIdsWithFlaggedAppRegistration/GetUserIdsWithFlaggedAppRegistrationRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function getUserIdsWithFlaggedAppRegistration"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/AppliedPoliciesRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/AppliedPoliciesRequestBuilder.cs index 7458dc36978..ec94cfc6780 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/AppliedPoliciesRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/AppliedPoliciesRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Zero or more policys already applied on the registered app when it last synchronized with managment service."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +70,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Zero or more policys already applied on the registered app when it last synchronized with managment service."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedAppRegistrationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedAppRegistrationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/ManagedAppPolicyRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/ManagedAppPolicyRequestBuilder.cs index f03569c0d7d..e3c1acdd411 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/ManagedAppPolicyRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/ManagedAppPolicyRequestBuilder.cs @@ -30,12 +30,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Zero or more policys already applied on the registered app when it last synchronized with managment service."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,16 +52,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Zero or more policys already applied on the registered app when it last synchronized with managment service."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,16 +95,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Zero or more policys already applied on the registered app when it last synchronized with managment service."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index c96c41efdf9..e0c70d4a2be 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/TargetApps/TargetAppsRequestBuilder.cs index 5ff9045185f..410f3191b7f 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/TargetApps/TargetAppsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs index fe69e49b394..fa788ee8cd4 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index 84bd7bc0b53..c46e2fed8d5 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/WindowsInformationProtection/Assign/AssignRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/WindowsInformationProtection/Assign/AssignRequestBuilder.cs index 96cc7cc99fc..dd2ca85c6c2 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/WindowsInformationProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/AppliedPolicies/Item/WindowsInformationProtection/Assign/AssignRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/IntendedPoliciesRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/IntendedPoliciesRequestBuilder.cs index a66165edbcb..5e321e778bb 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/IntendedPoliciesRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/IntendedPoliciesRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Zero or more policies admin intended for the app as of now."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +70,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Zero or more policies admin intended for the app as of now."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedAppRegistrationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedAppRegistrationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/ManagedAppPolicyRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/ManagedAppPolicyRequestBuilder.cs index 13527ba3939..a0bced4bed6 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/ManagedAppPolicyRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/ManagedAppPolicyRequestBuilder.cs @@ -30,12 +30,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Zero or more policies admin intended for the app as of now."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,16 +52,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Zero or more policies admin intended for the app as of now."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,16 +95,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Zero or more policies admin intended for the app as of now."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index 34fa814e51d..a0efd03cfc6 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/TargetApps/TargetAppsRequestBuilder.cs index d3e2066ed52..6da2e787af8 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/TargetApps/TargetAppsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs index 3919150ba3e..6925adaaefd 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index 47497cc4c48..e7d268a186a 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/WindowsInformationProtection/Assign/AssignRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/WindowsInformationProtection/Assign/AssignRequestBuilder.cs index 9c479447c5d..1408fbc9cd4 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/WindowsInformationProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/IntendedPolicies/Item/WindowsInformationProtection/Assign/AssignRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppPolicyIdOption = new Option("--managedapppolicy-id", description: "key: id of managedAppPolicy"); + managedAppPolicyIdOption.IsRequired = true; + command.AddOption(managedAppPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppPolicyId)) requestInfo.PathParameters.Add("managedAppPolicy_id", managedAppPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/ManagedAppRegistrationRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/ManagedAppRegistrationRequestBuilder.cs index b0b2d57c523..3f0a21a389f 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/ManagedAppRegistrationRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/ManagedAppRegistrationRequestBuilder.cs @@ -36,10 +36,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The managed app registrations."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,14 +55,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The managed app registrations."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedAppRegistrationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedAppRegistrationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -93,14 +103,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The managed app registrations."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/Operations/Item/ManagedAppOperationRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/Operations/Item/ManagedAppOperationRequestBuilder.cs index deb996f831d..cde5a1bd4b5 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/Operations/Item/ManagedAppOperationRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/Operations/Item/ManagedAppOperationRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Zero or more long running operations triggered on the app registration."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedappoperation-id", description: "key: id of managedAppOperation")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppOperationIdOption = new Option("--managedappoperation-id", description: "key: id of managedAppOperation"); + managedAppOperationIdOption.IsRequired = true; + command.AddOption(managedAppOperationIdOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppOperationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppOperationId)) requestInfo.PathParameters.Add("managedAppOperation_id", managedAppOperationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Zero or more long running operations triggered on the app registration."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedappoperation-id", description: "key: id of managedAppOperation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppOperationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppOperationId)) requestInfo.PathParameters.Add("managedAppOperation_id", managedAppOperationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppOperationIdOption = new Option("--managedappoperation-id", description: "key: id of managedAppOperation"); + managedAppOperationIdOption.IsRequired = true; + command.AddOption(managedAppOperationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppOperationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Zero or more long running operations triggered on the app registration."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--managedappoperation-id", description: "key: id of managedAppOperation")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var managedAppOperationIdOption = new Option("--managedappoperation-id", description: "key: id of managedAppOperation"); + managedAppOperationIdOption.IsRequired = true; + command.AddOption(managedAppOperationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, managedAppOperationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - if (!String.IsNullOrEmpty(managedAppOperationId)) requestInfo.PathParameters.Add("managedAppOperation_id", managedAppOperationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/Operations/OperationsRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/Operations/OperationsRequestBuilder.cs index 231b1f1dc0b..c2cb5dd21cd 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/Operations/OperationsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/Operations/OperationsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Zero or more long running operations triggered on the app registration."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--body")); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppRegistrationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Zero or more long running operations triggered on the app registration."; // Create options for all the parameters - command.AddOption(new Option("--managedappregistration-id", description: "key: id of managedAppRegistration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedAppRegistrationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedAppRegistrationId)) requestInfo.PathParameters.Add("managedAppRegistration_id", managedAppRegistrationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedAppRegistrationIdOption = new Option("--managedappregistration-id", description: "key: id of managedAppRegistration"); + managedAppRegistrationIdOption.IsRequired = true; + command.AddOption(managedAppRegistrationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedAppRegistrationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/ManagedAppRegistrationsRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/ManagedAppRegistrationsRequestBuilder.cs index 3b7b2f774a0..70a779cd8ef 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/ManagedAppRegistrationsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/ManagedAppRegistrationsRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The managed app registrations."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +67,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The managed app registrations."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/ManagedAppStatuses/Item/ManagedAppStatusRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppStatuses/Item/ManagedAppStatusRequestBuilder.cs index 9f1c1fd1438..691cd1fc078 100644 --- a/src/generated/DeviceAppManagement/ManagedAppStatuses/Item/ManagedAppStatusRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppStatuses/Item/ManagedAppStatusRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The managed app statuses."; // Create options for all the parameters - command.AddOption(new Option("--managedappstatus-id", description: "key: id of managedAppStatus")); + var managedAppStatusIdOption = new Option("--managedappstatus-id", description: "key: id of managedAppStatus"); + managedAppStatusIdOption.IsRequired = true; + command.AddOption(managedAppStatusIdOption); command.Handler = CommandHandler.Create(async (managedAppStatusId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedAppStatusId)) requestInfo.PathParameters.Add("managedAppStatus_id", managedAppStatusId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The managed app statuses."; // Create options for all the parameters - command.AddOption(new Option("--managedappstatus-id", description: "key: id of managedAppStatus")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedAppStatusId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedAppStatusId)) requestInfo.PathParameters.Add("managedAppStatus_id", managedAppStatusId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedAppStatusIdOption = new Option("--managedappstatus-id", description: "key: id of managedAppStatus"); + managedAppStatusIdOption.IsRequired = true; + command.AddOption(managedAppStatusIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedAppStatusId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The managed app statuses."; // Create options for all the parameters - command.AddOption(new Option("--managedappstatus-id", description: "key: id of managedAppStatus")); - command.AddOption(new Option("--body")); + var managedAppStatusIdOption = new Option("--managedappstatus-id", description: "key: id of managedAppStatus"); + managedAppStatusIdOption.IsRequired = true; + command.AddOption(managedAppStatusIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedAppStatusId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedAppStatusId)) requestInfo.PathParameters.Add("managedAppStatus_id", managedAppStatusId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedAppStatuses/ManagedAppStatusesRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppStatuses/ManagedAppStatusesRequestBuilder.cs index 230e711c270..72e64853fb5 100644 --- a/src/generated/DeviceAppManagement/ManagedAppStatuses/ManagedAppStatusesRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppStatuses/ManagedAppStatusesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The managed app statuses."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The managed app statuses."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assign/AssignRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assign/AssignRequestBuilder.cs index 1e98c07b3e8..befc20a39a3 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assign/AssignRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--body")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedEBookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/AssignmentsRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/AssignmentsRequestBuilder.cs index 57acd89bda9..d3851de737d 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/AssignmentsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/AssignmentsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of assignments for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--body")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedEBookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of assignments for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedEBookId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedEBookId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/Item/ManagedEBookAssignmentRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/Item/ManagedEBookAssignmentRequestBuilder.cs index 6a1fdce69cd..491ebe43e18 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/Item/ManagedEBookAssignmentRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/Item/ManagedEBookAssignmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of assignments for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--managedebookassignment-id", description: "key: id of managedEBookAssignment")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var managedEBookAssignmentIdOption = new Option("--managedebookassignment-id", description: "key: id of managedEBookAssignment"); + managedEBookAssignmentIdOption.IsRequired = true; + command.AddOption(managedEBookAssignmentIdOption); command.Handler = CommandHandler.Create(async (managedEBookId, managedEBookAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - if (!String.IsNullOrEmpty(managedEBookAssignmentId)) requestInfo.PathParameters.Add("managedEBookAssignment_id", managedEBookAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of assignments for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--managedebookassignment-id", description: "key: id of managedEBookAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedEBookId, managedEBookAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - if (!String.IsNullOrEmpty(managedEBookAssignmentId)) requestInfo.PathParameters.Add("managedEBookAssignment_id", managedEBookAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var managedEBookAssignmentIdOption = new Option("--managedebookassignment-id", description: "key: id of managedEBookAssignment"); + managedEBookAssignmentIdOption.IsRequired = true; + command.AddOption(managedEBookAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedEBookId, managedEBookAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of assignments for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--managedebookassignment-id", description: "key: id of managedEBookAssignment")); - command.AddOption(new Option("--body")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var managedEBookAssignmentIdOption = new Option("--managedebookassignment-id", description: "key: id of managedEBookAssignment"); + managedEBookAssignmentIdOption.IsRequired = true; + command.AddOption(managedEBookAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedEBookId, managedEBookAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - if (!String.IsNullOrEmpty(managedEBookAssignmentId)) requestInfo.PathParameters.Add("managedEBookAssignment_id", managedEBookAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/Item/DeviceStates/DeviceStatesRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/Item/DeviceStates/DeviceStatesRequestBuilder.cs index f2137547c57..9016b82ea25 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/Item/DeviceStates/DeviceStatesRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/Item/DeviceStates/DeviceStatesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of installation states for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--body")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedEBookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of installation states for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedEBookId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedEBookId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/Item/DeviceStates/Item/DeviceInstallStateRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/Item/DeviceStates/Item/DeviceInstallStateRequestBuilder.cs index bb40b45d5f2..20b8a625699 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/Item/DeviceStates/Item/DeviceInstallStateRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/Item/DeviceStates/Item/DeviceInstallStateRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of installation states for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--deviceinstallstate-id", description: "key: id of deviceInstallState")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var deviceInstallStateIdOption = new Option("--deviceinstallstate-id", description: "key: id of deviceInstallState"); + deviceInstallStateIdOption.IsRequired = true; + command.AddOption(deviceInstallStateIdOption); command.Handler = CommandHandler.Create(async (managedEBookId, deviceInstallStateId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - if (!String.IsNullOrEmpty(deviceInstallStateId)) requestInfo.PathParameters.Add("deviceInstallState_id", deviceInstallStateId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of installation states for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--deviceinstallstate-id", description: "key: id of deviceInstallState")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedEBookId, deviceInstallStateId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - if (!String.IsNullOrEmpty(deviceInstallStateId)) requestInfo.PathParameters.Add("deviceInstallState_id", deviceInstallStateId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var deviceInstallStateIdOption = new Option("--deviceinstallstate-id", description: "key: id of deviceInstallState"); + deviceInstallStateIdOption.IsRequired = true; + command.AddOption(deviceInstallStateIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedEBookId, deviceInstallStateId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of installation states for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--deviceinstallstate-id", description: "key: id of deviceInstallState")); - command.AddOption(new Option("--body")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var deviceInstallStateIdOption = new Option("--deviceinstallstate-id", description: "key: id of deviceInstallState"); + deviceInstallStateIdOption.IsRequired = true; + command.AddOption(deviceInstallStateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedEBookId, deviceInstallStateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - if (!String.IsNullOrEmpty(deviceInstallStateId)) requestInfo.PathParameters.Add("deviceInstallState_id", deviceInstallStateId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/Item/InstallSummary/InstallSummaryRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/Item/InstallSummary/InstallSummaryRequestBuilder.cs index 008c15c62ee..bb519319a2d 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/Item/InstallSummary/InstallSummaryRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/Item/InstallSummary/InstallSummaryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Mobile App Install Summary."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); command.Handler = CommandHandler.Create(async (managedEBookId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Mobile App Install Summary."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedEBookId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedEBookId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Mobile App Install Summary."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--body")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedEBookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/Item/ManagedEBookRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/Item/ManagedEBookRequestBuilder.cs index 1dad1a544d2..1e34d07cc40 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/Item/ManagedEBookRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/Item/ManagedEBookRequestBuilder.cs @@ -44,10 +44,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The Managed eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); command.Handler = CommandHandler.Create(async (managedEBookId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -68,14 +70,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The Managed eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedEBookId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedEBookId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -102,14 +112,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The Managed eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--body")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedEBookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/Item/DeviceStates/DeviceStatesRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/Item/DeviceStates/DeviceStatesRequestBuilder.cs index 08334c9cd61..3fb29ef1a56 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/Item/DeviceStates/DeviceStatesRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/Item/DeviceStates/DeviceStatesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The install state of the eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary")); - command.AddOption(new Option("--body")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var userInstallStateSummaryIdOption = new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary"); + userInstallStateSummaryIdOption.IsRequired = true; + command.AddOption(userInstallStateSummaryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedEBookId, userInstallStateSummaryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - if (!String.IsNullOrEmpty(userInstallStateSummaryId)) requestInfo.PathParameters.Add("userInstallStateSummary_id", userInstallStateSummaryId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The install state of the eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedEBookId, userInstallStateSummaryId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - if (!String.IsNullOrEmpty(userInstallStateSummaryId)) requestInfo.PathParameters.Add("userInstallStateSummary_id", userInstallStateSummaryId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var userInstallStateSummaryIdOption = new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary"); + userInstallStateSummaryIdOption.IsRequired = true; + command.AddOption(userInstallStateSummaryIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedEBookId, userInstallStateSummaryId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/Item/DeviceStates/Item/DeviceInstallStateRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/Item/DeviceStates/Item/DeviceInstallStateRequestBuilder.cs index 595d4e16984..ea6a67cbf1f 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/Item/DeviceStates/Item/DeviceInstallStateRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/Item/DeviceStates/Item/DeviceInstallStateRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The install state of the eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary")); - command.AddOption(new Option("--deviceinstallstate-id", description: "key: id of deviceInstallState")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var userInstallStateSummaryIdOption = new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary"); + userInstallStateSummaryIdOption.IsRequired = true; + command.AddOption(userInstallStateSummaryIdOption); + var deviceInstallStateIdOption = new Option("--deviceinstallstate-id", description: "key: id of deviceInstallState"); + deviceInstallStateIdOption.IsRequired = true; + command.AddOption(deviceInstallStateIdOption); command.Handler = CommandHandler.Create(async (managedEBookId, userInstallStateSummaryId, deviceInstallStateId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - if (!String.IsNullOrEmpty(userInstallStateSummaryId)) requestInfo.PathParameters.Add("userInstallStateSummary_id", userInstallStateSummaryId); - if (!String.IsNullOrEmpty(deviceInstallStateId)) requestInfo.PathParameters.Add("deviceInstallState_id", deviceInstallStateId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The install state of the eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary")); - command.AddOption(new Option("--deviceinstallstate-id", description: "key: id of deviceInstallState")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedEBookId, userInstallStateSummaryId, deviceInstallStateId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - if (!String.IsNullOrEmpty(userInstallStateSummaryId)) requestInfo.PathParameters.Add("userInstallStateSummary_id", userInstallStateSummaryId); - if (!String.IsNullOrEmpty(deviceInstallStateId)) requestInfo.PathParameters.Add("deviceInstallState_id", deviceInstallStateId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var userInstallStateSummaryIdOption = new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary"); + userInstallStateSummaryIdOption.IsRequired = true; + command.AddOption(userInstallStateSummaryIdOption); + var deviceInstallStateIdOption = new Option("--deviceinstallstate-id", description: "key: id of deviceInstallState"); + deviceInstallStateIdOption.IsRequired = true; + command.AddOption(deviceInstallStateIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedEBookId, userInstallStateSummaryId, deviceInstallStateId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The install state of the eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary")); - command.AddOption(new Option("--deviceinstallstate-id", description: "key: id of deviceInstallState")); - command.AddOption(new Option("--body")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var userInstallStateSummaryIdOption = new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary"); + userInstallStateSummaryIdOption.IsRequired = true; + command.AddOption(userInstallStateSummaryIdOption); + var deviceInstallStateIdOption = new Option("--deviceinstallstate-id", description: "key: id of deviceInstallState"); + deviceInstallStateIdOption.IsRequired = true; + command.AddOption(deviceInstallStateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedEBookId, userInstallStateSummaryId, deviceInstallStateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - if (!String.IsNullOrEmpty(userInstallStateSummaryId)) requestInfo.PathParameters.Add("userInstallStateSummary_id", userInstallStateSummaryId); - if (!String.IsNullOrEmpty(deviceInstallStateId)) requestInfo.PathParameters.Add("deviceInstallState_id", deviceInstallStateId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/Item/UserInstallStateSummaryRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/Item/UserInstallStateSummaryRequestBuilder.cs index 16f273902da..be3266c0945 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/Item/UserInstallStateSummaryRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/Item/UserInstallStateSummaryRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of installation states for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var userInstallStateSummaryIdOption = new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary"); + userInstallStateSummaryIdOption.IsRequired = true; + command.AddOption(userInstallStateSummaryIdOption); command.Handler = CommandHandler.Create(async (managedEBookId, userInstallStateSummaryId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - if (!String.IsNullOrEmpty(userInstallStateSummaryId)) requestInfo.PathParameters.Add("userInstallStateSummary_id", userInstallStateSummaryId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of installation states for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedEBookId, userInstallStateSummaryId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - if (!String.IsNullOrEmpty(userInstallStateSummaryId)) requestInfo.PathParameters.Add("userInstallStateSummary_id", userInstallStateSummaryId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var userInstallStateSummaryIdOption = new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary"); + userInstallStateSummaryIdOption.IsRequired = true; + command.AddOption(userInstallStateSummaryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedEBookId, userInstallStateSummaryId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of installation states for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary")); - command.AddOption(new Option("--body")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var userInstallStateSummaryIdOption = new Option("--userinstallstatesummary-id", description: "key: id of userInstallStateSummary"); + userInstallStateSummaryIdOption.IsRequired = true; + command.AddOption(userInstallStateSummaryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedEBookId, userInstallStateSummaryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - if (!String.IsNullOrEmpty(userInstallStateSummaryId)) requestInfo.PathParameters.Add("userInstallStateSummary_id", userInstallStateSummaryId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/UserStateSummaryRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/UserStateSummaryRequestBuilder.cs index aed3456feca..1b5150f613f 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/UserStateSummaryRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/Item/UserStateSummary/UserStateSummaryRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of installation states for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--body")); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedEBookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of installation states for this eBook."; // Create options for all the parameters - command.AddOption(new Option("--managedebook-id", description: "key: id of managedEBook")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedEBookId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedEBookId)) requestInfo.PathParameters.Add("managedEBook_id", managedEBookId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedEBookIdOption = new Option("--managedebook-id", description: "key: id of managedEBook"); + managedEBookIdOption.IsRequired = true; + command.AddOption(managedEBookIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedEBookId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/ManagedEBooksRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/ManagedEBooksRequestBuilder.cs index 818bc3e8e31..30819dcfa39 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/ManagedEBooksRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/ManagedEBooksRequestBuilder.cs @@ -41,12 +41,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The Managed eBook."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,24 +68,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The Managed eBook."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/MdmWindowsInformationProtectionPolicies/Item/MdmWindowsInformationProtectionPolicyRequestBuilder.cs b/src/generated/DeviceAppManagement/MdmWindowsInformationProtectionPolicies/Item/MdmWindowsInformationProtectionPolicyRequestBuilder.cs index b1daee07db4..e4401a78e82 100644 --- a/src/generated/DeviceAppManagement/MdmWindowsInformationProtectionPolicies/Item/MdmWindowsInformationProtectionPolicyRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MdmWindowsInformationProtectionPolicies/Item/MdmWindowsInformationProtectionPolicyRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Windows information protection for apps running on devices which are MDM enrolled."; // Create options for all the parameters - command.AddOption(new Option("--mdmwindowsinformationprotectionpolicy-id", description: "key: id of mdmWindowsInformationProtectionPolicy")); + var mdmWindowsInformationProtectionPolicyIdOption = new Option("--mdmwindowsinformationprotectionpolicy-id", description: "key: id of mdmWindowsInformationProtectionPolicy"); + mdmWindowsInformationProtectionPolicyIdOption.IsRequired = true; + command.AddOption(mdmWindowsInformationProtectionPolicyIdOption); command.Handler = CommandHandler.Create(async (mdmWindowsInformationProtectionPolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mdmWindowsInformationProtectionPolicyId)) requestInfo.PathParameters.Add("mdmWindowsInformationProtectionPolicy_id", mdmWindowsInformationProtectionPolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Windows information protection for apps running on devices which are MDM enrolled."; // Create options for all the parameters - command.AddOption(new Option("--mdmwindowsinformationprotectionpolicy-id", description: "key: id of mdmWindowsInformationProtectionPolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mdmWindowsInformationProtectionPolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mdmWindowsInformationProtectionPolicyId)) requestInfo.PathParameters.Add("mdmWindowsInformationProtectionPolicy_id", mdmWindowsInformationProtectionPolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mdmWindowsInformationProtectionPolicyIdOption = new Option("--mdmwindowsinformationprotectionpolicy-id", description: "key: id of mdmWindowsInformationProtectionPolicy"); + mdmWindowsInformationProtectionPolicyIdOption.IsRequired = true; + command.AddOption(mdmWindowsInformationProtectionPolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mdmWindowsInformationProtectionPolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Windows information protection for apps running on devices which are MDM enrolled."; // Create options for all the parameters - command.AddOption(new Option("--mdmwindowsinformationprotectionpolicy-id", description: "key: id of mdmWindowsInformationProtectionPolicy")); - command.AddOption(new Option("--body")); + var mdmWindowsInformationProtectionPolicyIdOption = new Option("--mdmwindowsinformationprotectionpolicy-id", description: "key: id of mdmWindowsInformationProtectionPolicy"); + mdmWindowsInformationProtectionPolicyIdOption.IsRequired = true; + command.AddOption(mdmWindowsInformationProtectionPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mdmWindowsInformationProtectionPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mdmWindowsInformationProtectionPolicyId)) requestInfo.PathParameters.Add("mdmWindowsInformationProtectionPolicy_id", mdmWindowsInformationProtectionPolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/MdmWindowsInformationProtectionPolicies/MdmWindowsInformationProtectionPoliciesRequestBuilder.cs b/src/generated/DeviceAppManagement/MdmWindowsInformationProtectionPolicies/MdmWindowsInformationProtectionPoliciesRequestBuilder.cs index 97586f2c4c7..f98be1f3ebe 100644 --- a/src/generated/DeviceAppManagement/MdmWindowsInformationProtectionPolicies/MdmWindowsInformationProtectionPoliciesRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MdmWindowsInformationProtectionPolicies/MdmWindowsInformationProtectionPoliciesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Windows information protection for apps running on devices which are MDM enrolled."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Windows information protection for apps running on devices which are MDM enrolled."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/MobileAppCategories/Item/MobileAppCategoryRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppCategories/Item/MobileAppCategoryRequestBuilder.cs index 4b847ef2958..db31736b9e9 100644 --- a/src/generated/DeviceAppManagement/MobileAppCategories/Item/MobileAppCategoryRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppCategories/Item/MobileAppCategoryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The mobile app categories."; // Create options for all the parameters - command.AddOption(new Option("--mobileappcategory-id", description: "key: id of mobileAppCategory")); + var mobileAppCategoryIdOption = new Option("--mobileappcategory-id", description: "key: id of mobileAppCategory"); + mobileAppCategoryIdOption.IsRequired = true; + command.AddOption(mobileAppCategoryIdOption); command.Handler = CommandHandler.Create(async (mobileAppCategoryId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mobileAppCategoryId)) requestInfo.PathParameters.Add("mobileAppCategory_id", mobileAppCategoryId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The mobile app categories."; // Create options for all the parameters - command.AddOption(new Option("--mobileappcategory-id", description: "key: id of mobileAppCategory")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mobileAppCategoryId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mobileAppCategoryId)) requestInfo.PathParameters.Add("mobileAppCategory_id", mobileAppCategoryId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mobileAppCategoryIdOption = new Option("--mobileappcategory-id", description: "key: id of mobileAppCategory"); + mobileAppCategoryIdOption.IsRequired = true; + command.AddOption(mobileAppCategoryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mobileAppCategoryId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The mobile app categories."; // Create options for all the parameters - command.AddOption(new Option("--mobileappcategory-id", description: "key: id of mobileAppCategory")); - command.AddOption(new Option("--body")); + var mobileAppCategoryIdOption = new Option("--mobileappcategory-id", description: "key: id of mobileAppCategory"); + mobileAppCategoryIdOption.IsRequired = true; + command.AddOption(mobileAppCategoryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mobileAppCategoryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mobileAppCategoryId)) requestInfo.PathParameters.Add("mobileAppCategory_id", mobileAppCategoryId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/MobileAppCategories/MobileAppCategoriesRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppCategories/MobileAppCategoriesRequestBuilder.cs index e88ff48a4db..1cd0093ecc7 100644 --- a/src/generated/DeviceAppManagement/MobileAppCategories/MobileAppCategoriesRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppCategories/MobileAppCategoriesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The mobile app categories."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The mobile app categories."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/Assign/AssignRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/Assign/AssignRequestBuilder.cs index 88018db2971..f91e36020f4 100644 --- a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/Assign/AssignRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--body")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs index 8425df16483..d652c36c639 100644 --- a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of group assignemenets for app configration."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--body")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of group assignemenets for app configration."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/Assignments/Item/ManagedDeviceMobileAppConfigurationAssignmentRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/Assignments/Item/ManagedDeviceMobileAppConfigurationAssignmentRequestBuilder.cs index 39d05d4840c..d31eabaf8f6 100644 --- a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/Assignments/Item/ManagedDeviceMobileAppConfigurationAssignmentRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/Assignments/Item/ManagedDeviceMobileAppConfigurationAssignmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of group assignemenets for app configration."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--manageddevicemobileappconfigurationassignment-id", description: "key: id of managedDeviceMobileAppConfigurationAssignment")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var managedDeviceMobileAppConfigurationAssignmentIdOption = new Option("--manageddevicemobileappconfigurationassignment-id", description: "key: id of managedDeviceMobileAppConfigurationAssignment"); + managedDeviceMobileAppConfigurationAssignmentIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationAssignmentIdOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, managedDeviceMobileAppConfigurationAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationAssignmentId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfigurationAssignment_id", managedDeviceMobileAppConfigurationAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of group assignemenets for app configration."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--manageddevicemobileappconfigurationassignment-id", description: "key: id of managedDeviceMobileAppConfigurationAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, managedDeviceMobileAppConfigurationAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationAssignmentId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfigurationAssignment_id", managedDeviceMobileAppConfigurationAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var managedDeviceMobileAppConfigurationAssignmentIdOption = new Option("--manageddevicemobileappconfigurationassignment-id", description: "key: id of managedDeviceMobileAppConfigurationAssignment"); + managedDeviceMobileAppConfigurationAssignmentIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, managedDeviceMobileAppConfigurationAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of group assignemenets for app configration."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--manageddevicemobileappconfigurationassignment-id", description: "key: id of managedDeviceMobileAppConfigurationAssignment")); - command.AddOption(new Option("--body")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var managedDeviceMobileAppConfigurationAssignmentIdOption = new Option("--manageddevicemobileappconfigurationassignment-id", description: "key: id of managedDeviceMobileAppConfigurationAssignment"); + managedDeviceMobileAppConfigurationAssignmentIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, managedDeviceMobileAppConfigurationAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationAssignmentId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfigurationAssignment_id", managedDeviceMobileAppConfigurationAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/DeviceStatusSummary/DeviceStatusSummaryRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/DeviceStatusSummary/DeviceStatusSummaryRequestBuilder.cs index e58e2a877d1..e01bf38d24f 100644 --- a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/DeviceStatusSummary/DeviceStatusSummaryRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/DeviceStatusSummary/DeviceStatusSummaryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "App configuration device status summary."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "App configuration device status summary."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "App configuration device status summary."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--body")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/DeviceStatuses/DeviceStatusesRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/DeviceStatuses/DeviceStatusesRequestBuilder.cs index 4a1371cf321..29a20fc5a7e 100644 --- a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/DeviceStatuses/DeviceStatusesRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/DeviceStatuses/DeviceStatusesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "List of ManagedDeviceMobileAppConfigurationDeviceStatus."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--body")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "List of ManagedDeviceMobileAppConfigurationDeviceStatus."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/DeviceStatuses/Item/ManagedDeviceMobileAppConfigurationDeviceStatusRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/DeviceStatuses/Item/ManagedDeviceMobileAppConfigurationDeviceStatusRequestBuilder.cs index 0f456853896..3ef0049d94d 100644 --- a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/DeviceStatuses/Item/ManagedDeviceMobileAppConfigurationDeviceStatusRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/DeviceStatuses/Item/ManagedDeviceMobileAppConfigurationDeviceStatusRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "List of ManagedDeviceMobileAppConfigurationDeviceStatus."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--manageddevicemobileappconfigurationdevicestatus-id", description: "key: id of managedDeviceMobileAppConfigurationDeviceStatus")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var managedDeviceMobileAppConfigurationDeviceStatusIdOption = new Option("--manageddevicemobileappconfigurationdevicestatus-id", description: "key: id of managedDeviceMobileAppConfigurationDeviceStatus"); + managedDeviceMobileAppConfigurationDeviceStatusIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationDeviceStatusIdOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, managedDeviceMobileAppConfigurationDeviceStatusId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationDeviceStatusId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfigurationDeviceStatus_id", managedDeviceMobileAppConfigurationDeviceStatusId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "List of ManagedDeviceMobileAppConfigurationDeviceStatus."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--manageddevicemobileappconfigurationdevicestatus-id", description: "key: id of managedDeviceMobileAppConfigurationDeviceStatus")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, managedDeviceMobileAppConfigurationDeviceStatusId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationDeviceStatusId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfigurationDeviceStatus_id", managedDeviceMobileAppConfigurationDeviceStatusId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var managedDeviceMobileAppConfigurationDeviceStatusIdOption = new Option("--manageddevicemobileappconfigurationdevicestatus-id", description: "key: id of managedDeviceMobileAppConfigurationDeviceStatus"); + managedDeviceMobileAppConfigurationDeviceStatusIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationDeviceStatusIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, managedDeviceMobileAppConfigurationDeviceStatusId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "List of ManagedDeviceMobileAppConfigurationDeviceStatus."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--manageddevicemobileappconfigurationdevicestatus-id", description: "key: id of managedDeviceMobileAppConfigurationDeviceStatus")); - command.AddOption(new Option("--body")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var managedDeviceMobileAppConfigurationDeviceStatusIdOption = new Option("--manageddevicemobileappconfigurationdevicestatus-id", description: "key: id of managedDeviceMobileAppConfigurationDeviceStatus"); + managedDeviceMobileAppConfigurationDeviceStatusIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationDeviceStatusIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, managedDeviceMobileAppConfigurationDeviceStatusId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationDeviceStatusId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfigurationDeviceStatus_id", managedDeviceMobileAppConfigurationDeviceStatusId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/ManagedDeviceMobileAppConfigurationRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/ManagedDeviceMobileAppConfigurationRequestBuilder.cs index 2a764bd5b66..b04b3e1d476 100644 --- a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/ManagedDeviceMobileAppConfigurationRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/ManagedDeviceMobileAppConfigurationRequestBuilder.cs @@ -45,10 +45,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The Managed Device Mobile Application Configurations."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -77,14 +79,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The Managed Device Mobile Application Configurations."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -103,14 +113,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The Managed Device Mobile Application Configurations."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--body")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/UserStatusSummary/UserStatusSummaryRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/UserStatusSummary/UserStatusSummaryRequestBuilder.cs index 01f14945d98..e5ad29e2370 100644 --- a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/UserStatusSummary/UserStatusSummaryRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/UserStatusSummary/UserStatusSummaryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "App configuration user status summary."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "App configuration user status summary."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "App configuration user status summary."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--body")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/UserStatuses/Item/ManagedDeviceMobileAppConfigurationUserStatusRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/UserStatuses/Item/ManagedDeviceMobileAppConfigurationUserStatusRequestBuilder.cs index 26c143196f7..6314c72682b 100644 --- a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/UserStatuses/Item/ManagedDeviceMobileAppConfigurationUserStatusRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/UserStatuses/Item/ManagedDeviceMobileAppConfigurationUserStatusRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "List of ManagedDeviceMobileAppConfigurationUserStatus."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--manageddevicemobileappconfigurationuserstatus-id", description: "key: id of managedDeviceMobileAppConfigurationUserStatus")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var managedDeviceMobileAppConfigurationUserStatusIdOption = new Option("--manageddevicemobileappconfigurationuserstatus-id", description: "key: id of managedDeviceMobileAppConfigurationUserStatus"); + managedDeviceMobileAppConfigurationUserStatusIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationUserStatusIdOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, managedDeviceMobileAppConfigurationUserStatusId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationUserStatusId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfigurationUserStatus_id", managedDeviceMobileAppConfigurationUserStatusId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "List of ManagedDeviceMobileAppConfigurationUserStatus."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--manageddevicemobileappconfigurationuserstatus-id", description: "key: id of managedDeviceMobileAppConfigurationUserStatus")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, managedDeviceMobileAppConfigurationUserStatusId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationUserStatusId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfigurationUserStatus_id", managedDeviceMobileAppConfigurationUserStatusId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var managedDeviceMobileAppConfigurationUserStatusIdOption = new Option("--manageddevicemobileappconfigurationuserstatus-id", description: "key: id of managedDeviceMobileAppConfigurationUserStatus"); + managedDeviceMobileAppConfigurationUserStatusIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationUserStatusIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, managedDeviceMobileAppConfigurationUserStatusId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "List of ManagedDeviceMobileAppConfigurationUserStatus."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--manageddevicemobileappconfigurationuserstatus-id", description: "key: id of managedDeviceMobileAppConfigurationUserStatus")); - command.AddOption(new Option("--body")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var managedDeviceMobileAppConfigurationUserStatusIdOption = new Option("--manageddevicemobileappconfigurationuserstatus-id", description: "key: id of managedDeviceMobileAppConfigurationUserStatus"); + managedDeviceMobileAppConfigurationUserStatusIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationUserStatusIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, managedDeviceMobileAppConfigurationUserStatusId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationUserStatusId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfigurationUserStatus_id", managedDeviceMobileAppConfigurationUserStatusId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/UserStatuses/UserStatusesRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/UserStatuses/UserStatusesRequestBuilder.cs index 2a162e61066..d2f30c9e5e7 100644 --- a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/UserStatuses/UserStatusesRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/UserStatuses/UserStatusesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "List of ManagedDeviceMobileAppConfigurationUserStatus."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--body")); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "List of ManagedDeviceMobileAppConfigurationUserStatus."; // Create options for all the parameters - command.AddOption(new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceMobileAppConfigurationId)) requestInfo.PathParameters.Add("managedDeviceMobileAppConfiguration_id", managedDeviceMobileAppConfigurationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceMobileAppConfigurationIdOption = new Option("--manageddevicemobileappconfiguration-id", description: "key: id of managedDeviceMobileAppConfiguration"); + managedDeviceMobileAppConfigurationIdOption.IsRequired = true; + command.AddOption(managedDeviceMobileAppConfigurationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceMobileAppConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/MobileAppConfigurations/MobileAppConfigurationsRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppConfigurations/MobileAppConfigurationsRequestBuilder.cs index c295ec2927f..562da356bac 100644 --- a/src/generated/DeviceAppManagement/MobileAppConfigurations/MobileAppConfigurationsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppConfigurations/MobileAppConfigurationsRequestBuilder.cs @@ -42,12 +42,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The Managed Device Mobile Application Configurations."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,24 +69,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The Managed Device Mobile Application Configurations."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/MobileApps/Item/Assign/AssignRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileApps/Item/Assign/AssignRequestBuilder.cs index a127db56e37..aeb4057cec5 100644 --- a/src/generated/DeviceAppManagement/MobileApps/Item/Assign/AssignRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileApps/Item/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--mobileapp-id", description: "key: id of mobileApp")); - command.AddOption(new Option("--body")); + var mobileAppIdOption = new Option("--mobileapp-id", description: "key: id of mobileApp"); + mobileAppIdOption.IsRequired = true; + command.AddOption(mobileAppIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mobileAppId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mobileAppId)) requestInfo.PathParameters.Add("mobileApp_id", mobileAppId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/MobileApps/Item/Assignments/AssignmentsRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileApps/Item/Assignments/AssignmentsRequestBuilder.cs index 6cbe2d5562b..ea3dc10eb37 100644 --- a/src/generated/DeviceAppManagement/MobileApps/Item/Assignments/AssignmentsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileApps/Item/Assignments/AssignmentsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of group assignments for this mobile app."; // Create options for all the parameters - command.AddOption(new Option("--mobileapp-id", description: "key: id of mobileApp")); - command.AddOption(new Option("--body")); + var mobileAppIdOption = new Option("--mobileapp-id", description: "key: id of mobileApp"); + mobileAppIdOption.IsRequired = true; + command.AddOption(mobileAppIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mobileAppId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mobileAppId)) requestInfo.PathParameters.Add("mobileApp_id", mobileAppId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of group assignments for this mobile app."; // Create options for all the parameters - command.AddOption(new Option("--mobileapp-id", description: "key: id of mobileApp")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mobileAppId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mobileAppId)) requestInfo.PathParameters.Add("mobileApp_id", mobileAppId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mobileAppIdOption = new Option("--mobileapp-id", description: "key: id of mobileApp"); + mobileAppIdOption.IsRequired = true; + command.AddOption(mobileAppIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mobileAppId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/MobileApps/Item/Assignments/Item/MobileAppAssignmentRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileApps/Item/Assignments/Item/MobileAppAssignmentRequestBuilder.cs index d32011b8be1..7aa593137f1 100644 --- a/src/generated/DeviceAppManagement/MobileApps/Item/Assignments/Item/MobileAppAssignmentRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileApps/Item/Assignments/Item/MobileAppAssignmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of group assignments for this mobile app."; // Create options for all the parameters - command.AddOption(new Option("--mobileapp-id", description: "key: id of mobileApp")); - command.AddOption(new Option("--mobileappassignment-id", description: "key: id of mobileAppAssignment")); + var mobileAppIdOption = new Option("--mobileapp-id", description: "key: id of mobileApp"); + mobileAppIdOption.IsRequired = true; + command.AddOption(mobileAppIdOption); + var mobileAppAssignmentIdOption = new Option("--mobileappassignment-id", description: "key: id of mobileAppAssignment"); + mobileAppAssignmentIdOption.IsRequired = true; + command.AddOption(mobileAppAssignmentIdOption); command.Handler = CommandHandler.Create(async (mobileAppId, mobileAppAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mobileAppId)) requestInfo.PathParameters.Add("mobileApp_id", mobileAppId); - if (!String.IsNullOrEmpty(mobileAppAssignmentId)) requestInfo.PathParameters.Add("mobileAppAssignment_id", mobileAppAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of group assignments for this mobile app."; // Create options for all the parameters - command.AddOption(new Option("--mobileapp-id", description: "key: id of mobileApp")); - command.AddOption(new Option("--mobileappassignment-id", description: "key: id of mobileAppAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mobileAppId, mobileAppAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mobileAppId)) requestInfo.PathParameters.Add("mobileApp_id", mobileAppId); - if (!String.IsNullOrEmpty(mobileAppAssignmentId)) requestInfo.PathParameters.Add("mobileAppAssignment_id", mobileAppAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mobileAppIdOption = new Option("--mobileapp-id", description: "key: id of mobileApp"); + mobileAppIdOption.IsRequired = true; + command.AddOption(mobileAppIdOption); + var mobileAppAssignmentIdOption = new Option("--mobileappassignment-id", description: "key: id of mobileAppAssignment"); + mobileAppAssignmentIdOption.IsRequired = true; + command.AddOption(mobileAppAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mobileAppId, mobileAppAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of group assignments for this mobile app."; // Create options for all the parameters - command.AddOption(new Option("--mobileapp-id", description: "key: id of mobileApp")); - command.AddOption(new Option("--mobileappassignment-id", description: "key: id of mobileAppAssignment")); - command.AddOption(new Option("--body")); + var mobileAppIdOption = new Option("--mobileapp-id", description: "key: id of mobileApp"); + mobileAppIdOption.IsRequired = true; + command.AddOption(mobileAppIdOption); + var mobileAppAssignmentIdOption = new Option("--mobileappassignment-id", description: "key: id of mobileAppAssignment"); + mobileAppAssignmentIdOption.IsRequired = true; + command.AddOption(mobileAppAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mobileAppId, mobileAppAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mobileAppId)) requestInfo.PathParameters.Add("mobileApp_id", mobileAppId); - if (!String.IsNullOrEmpty(mobileAppAssignmentId)) requestInfo.PathParameters.Add("mobileAppAssignment_id", mobileAppAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/MobileApps/Item/Categories/@Ref/RefRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileApps/Item/Categories/@Ref/RefRequestBuilder.cs index a5324afb544..92c4aed8d07 100644 --- a/src/generated/DeviceAppManagement/MobileApps/Item/Categories/@Ref/RefRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileApps/Item/Categories/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of categories for this app."; // Create options for all the parameters - command.AddOption(new Option("--mobileapp-id", description: "key: id of mobileApp")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (mobileAppId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mobileAppId)) requestInfo.PathParameters.Add("mobileApp_id", mobileAppId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var mobileAppIdOption = new Option("--mobileapp-id", description: "key: id of mobileApp"); + mobileAppIdOption.IsRequired = true; + command.AddOption(mobileAppIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (mobileAppId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The list of categories for this app."; // Create options for all the parameters - command.AddOption(new Option("--mobileapp-id", description: "key: id of mobileApp")); - command.AddOption(new Option("--body")); + var mobileAppIdOption = new Option("--mobileapp-id", description: "key: id of mobileApp"); + mobileAppIdOption.IsRequired = true; + command.AddOption(mobileAppIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mobileAppId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mobileAppId)) requestInfo.PathParameters.Add("mobileApp_id", mobileAppId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/MobileApps/Item/Categories/CategoriesRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileApps/Item/Categories/CategoriesRequestBuilder.cs index d218603ac50..fdf4177992e 100644 --- a/src/generated/DeviceAppManagement/MobileApps/Item/Categories/CategoriesRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileApps/Item/Categories/CategoriesRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of categories for this app."; // Create options for all the parameters - command.AddOption(new Option("--mobileapp-id", description: "key: id of mobileApp")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mobileAppId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mobileAppId)) requestInfo.PathParameters.Add("mobileApp_id", mobileAppId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mobileAppIdOption = new Option("--mobileapp-id", description: "key: id of mobileApp"); + mobileAppIdOption.IsRequired = true; + command.AddOption(mobileAppIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mobileAppId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/MobileApps/Item/MobileAppRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileApps/Item/MobileAppRequestBuilder.cs index 539f64c62e2..9951b8660f9 100644 --- a/src/generated/DeviceAppManagement/MobileApps/Item/MobileAppRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileApps/Item/MobileAppRequestBuilder.cs @@ -49,10 +49,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The mobile apps."; // Create options for all the parameters - command.AddOption(new Option("--mobileapp-id", description: "key: id of mobileApp")); + var mobileAppIdOption = new Option("--mobileapp-id", description: "key: id of mobileApp"); + mobileAppIdOption.IsRequired = true; + command.AddOption(mobileAppIdOption); command.Handler = CommandHandler.Create(async (mobileAppId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mobileAppId)) requestInfo.PathParameters.Add("mobileApp_id", mobileAppId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,14 +68,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The mobile apps."; // Create options for all the parameters - command.AddOption(new Option("--mobileapp-id", description: "key: id of mobileApp")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mobileAppId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mobileAppId)) requestInfo.PathParameters.Add("mobileApp_id", mobileAppId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mobileAppIdOption = new Option("--mobileapp-id", description: "key: id of mobileApp"); + mobileAppIdOption.IsRequired = true; + command.AddOption(mobileAppIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mobileAppId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,14 +102,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The mobile apps."; // Create options for all the parameters - command.AddOption(new Option("--mobileapp-id", description: "key: id of mobileApp")); - command.AddOption(new Option("--body")); + var mobileAppIdOption = new Option("--mobileapp-id", description: "key: id of mobileApp"); + mobileAppIdOption.IsRequired = true; + command.AddOption(mobileAppIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mobileAppId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mobileAppId)) requestInfo.PathParameters.Add("mobileApp_id", mobileAppId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/MobileApps/MobileAppsRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileApps/MobileAppsRequestBuilder.cs index 28264269aeb..310596245ba 100644 --- a/src/generated/DeviceAppManagement/MobileApps/MobileAppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileApps/MobileAppsRequestBuilder.cs @@ -39,12 +39,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The mobile apps."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,24 +66,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The mobile apps."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/SyncMicrosoftStoreForBusinessApps/SyncMicrosoftStoreForBusinessAppsRequestBuilder.cs b/src/generated/DeviceAppManagement/SyncMicrosoftStoreForBusinessApps/SyncMicrosoftStoreForBusinessAppsRequestBuilder.cs index c31750dea90..77efa471990 100644 --- a/src/generated/DeviceAppManagement/SyncMicrosoftStoreForBusinessApps/SyncMicrosoftStoreForBusinessAppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/SyncMicrosoftStoreForBusinessApps/SyncMicrosoftStoreForBusinessAppsRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildPostCommand() { command.Description = "Syncs Intune account with Microsoft Store For Business"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreatePostRequestInformation(); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Apps/AppsRequestBuilder.cs b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Apps/AppsRequestBuilder.cs index 6d40ef50c18..11f986ad1c5 100644 --- a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Apps/AppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Apps/AppsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--body")); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs index 06f2f5c9bf7..ed355760978 100644 --- a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Apps/Item/ManagedMobileAppRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--managedmobileapp-id", description: "key: id of managedMobileApp")); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var managedMobileAppIdOption = new Option("--managedmobileapp-id", description: "key: id of managedMobileApp"); + managedMobileAppIdOption.IsRequired = true; + command.AddOption(managedMobileAppIdOption); command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, managedMobileAppId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); - if (!String.IsNullOrEmpty(managedMobileAppId)) requestInfo.PathParameters.Add("managedMobileApp_id", managedMobileAppId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--managedmobileapp-id", description: "key: id of managedMobileApp")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, managedMobileAppId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); - if (!String.IsNullOrEmpty(managedMobileAppId)) requestInfo.PathParameters.Add("managedMobileApp_id", managedMobileAppId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var managedMobileAppIdOption = new Option("--managedmobileapp-id", description: "key: id of managedMobileApp"); + managedMobileAppIdOption.IsRequired = true; + command.AddOption(managedMobileAppIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, managedMobileAppId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "List of apps to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--managedmobileapp-id", description: "key: id of managedMobileApp")); - command.AddOption(new Option("--body")); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var managedMobileAppIdOption = new Option("--managedmobileapp-id", description: "key: id of managedMobileApp"); + managedMobileAppIdOption.IsRequired = true; + command.AddOption(managedMobileAppIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, managedMobileAppId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); - if (!String.IsNullOrEmpty(managedMobileAppId)) requestInfo.PathParameters.Add("managedMobileApp_id", managedMobileAppId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Assign/AssignRequestBuilder.cs b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Assign/AssignRequestBuilder.cs index cfd2701f176..e6003f36ee2 100644 --- a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Assign/AssignRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--body")); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs index 09930625827..d9f10c572e2 100644 --- a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Navigation property to list of inclusion and exclusion groups to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--body")); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Navigation property to list of inclusion and exclusion groups to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Assignments/Item/TargetedManagedAppPolicyAssignmentRequestBuilder.cs b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Assignments/Item/TargetedManagedAppPolicyAssignmentRequestBuilder.cs index 36f2b1d50f3..2c9b37dab45 100644 --- a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Assignments/Item/TargetedManagedAppPolicyAssignmentRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/Assignments/Item/TargetedManagedAppPolicyAssignmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Navigation property to list of inclusion and exclusion groups to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--targetedmanagedapppolicyassignment-id", description: "key: id of targetedManagedAppPolicyAssignment")); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var targetedManagedAppPolicyAssignmentIdOption = new Option("--targetedmanagedapppolicyassignment-id", description: "key: id of targetedManagedAppPolicyAssignment"); + targetedManagedAppPolicyAssignmentIdOption.IsRequired = true; + command.AddOption(targetedManagedAppPolicyAssignmentIdOption); command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, targetedManagedAppPolicyAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); - if (!String.IsNullOrEmpty(targetedManagedAppPolicyAssignmentId)) requestInfo.PathParameters.Add("targetedManagedAppPolicyAssignment_id", targetedManagedAppPolicyAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Navigation property to list of inclusion and exclusion groups to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--targetedmanagedapppolicyassignment-id", description: "key: id of targetedManagedAppPolicyAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, targetedManagedAppPolicyAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); - if (!String.IsNullOrEmpty(targetedManagedAppPolicyAssignmentId)) requestInfo.PathParameters.Add("targetedManagedAppPolicyAssignment_id", targetedManagedAppPolicyAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var targetedManagedAppPolicyAssignmentIdOption = new Option("--targetedmanagedapppolicyassignment-id", description: "key: id of targetedManagedAppPolicyAssignment"); + targetedManagedAppPolicyAssignmentIdOption.IsRequired = true; + command.AddOption(targetedManagedAppPolicyAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, targetedManagedAppPolicyAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Navigation property to list of inclusion and exclusion groups to which the policy is deployed."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--targetedmanagedapppolicyassignment-id", description: "key: id of targetedManagedAppPolicyAssignment")); - command.AddOption(new Option("--body")); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var targetedManagedAppPolicyAssignmentIdOption = new Option("--targetedmanagedapppolicyassignment-id", description: "key: id of targetedManagedAppPolicyAssignment"); + targetedManagedAppPolicyAssignmentIdOption.IsRequired = true; + command.AddOption(targetedManagedAppPolicyAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, targetedManagedAppPolicyAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); - if (!String.IsNullOrEmpty(targetedManagedAppPolicyAssignmentId)) requestInfo.PathParameters.Add("targetedManagedAppPolicyAssignment_id", targetedManagedAppPolicyAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs index fac6c4a847f..700f4a61faf 100644 --- a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/DeploymentSummary/DeploymentSummaryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Navigation property to deployment summary of the configuration."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Navigation property to deployment summary of the configuration."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Navigation property to deployment summary of the configuration."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--body")); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/TargetApps/TargetAppsRequestBuilder.cs index b4a238a7511..df91fd72235 100644 --- a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/TargetApps/TargetAppsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--body")); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/TargetedManagedAppConfigurationRequestBuilder.cs b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/TargetedManagedAppConfigurationRequestBuilder.cs index bb7a202dc98..cade243f100 100644 --- a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/TargetedManagedAppConfigurationRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/Item/TargetedManagedAppConfigurationRequestBuilder.cs @@ -51,10 +51,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Targeted managed app configurations."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -76,14 +78,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Targeted managed app configurations."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -102,14 +112,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Targeted managed app configurations."; // Create options for all the parameters - command.AddOption(new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration")); - command.AddOption(new Option("--body")); + var targetedManagedAppConfigurationIdOption = new Option("--targetedmanagedappconfiguration-id", description: "key: id of targetedManagedAppConfiguration"); + targetedManagedAppConfigurationIdOption.IsRequired = true; + command.AddOption(targetedManagedAppConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (targetedManagedAppConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(targetedManagedAppConfigurationId)) requestInfo.PathParameters.Add("targetedManagedAppConfiguration_id", targetedManagedAppConfigurationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/TargetedManagedAppConfigurationsRequestBuilder.cs b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/TargetedManagedAppConfigurationsRequestBuilder.cs index d0647b494be..7ce2b78e977 100644 --- a/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/TargetedManagedAppConfigurationsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/TargetedManagedAppConfigurations/TargetedManagedAppConfigurationsRequestBuilder.cs @@ -41,12 +41,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Targeted managed app configurations."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,24 +68,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Targeted managed app configurations."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/VppTokens/Item/SyncLicenses/SyncLicensesRequestBuilder.cs b/src/generated/DeviceAppManagement/VppTokens/Item/SyncLicenses/SyncLicensesRequestBuilder.cs index 3e0a600b379..9f12dbf3f7f 100644 --- a/src/generated/DeviceAppManagement/VppTokens/Item/SyncLicenses/SyncLicensesRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/VppTokens/Item/SyncLicenses/SyncLicensesRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Syncs licenses associated with a specific appleVolumePurchaseProgramToken"; // Create options for all the parameters - command.AddOption(new Option("--vpptoken-id", description: "key: id of vppToken")); + var vppTokenIdOption = new Option("--vpptoken-id", description: "key: id of vppToken"); + vppTokenIdOption.IsRequired = true; + command.AddOption(vppTokenIdOption); command.Handler = CommandHandler.Create(async (vppTokenId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(vppTokenId)) requestInfo.PathParameters.Add("vppToken_id", vppTokenId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/VppTokens/Item/VppTokenRequestBuilder.cs b/src/generated/DeviceAppManagement/VppTokens/Item/VppTokenRequestBuilder.cs index 3ebf274a981..02eb05afec5 100644 --- a/src/generated/DeviceAppManagement/VppTokens/Item/VppTokenRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/VppTokens/Item/VppTokenRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "List of Vpp tokens for this organization."; // Create options for all the parameters - command.AddOption(new Option("--vpptoken-id", description: "key: id of vppToken")); + var vppTokenIdOption = new Option("--vpptoken-id", description: "key: id of vppToken"); + vppTokenIdOption.IsRequired = true; + command.AddOption(vppTokenIdOption); command.Handler = CommandHandler.Create(async (vppTokenId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(vppTokenId)) requestInfo.PathParameters.Add("vppToken_id", vppTokenId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "List of Vpp tokens for this organization."; // Create options for all the parameters - command.AddOption(new Option("--vpptoken-id", description: "key: id of vppToken")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (vppTokenId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(vppTokenId)) requestInfo.PathParameters.Add("vppToken_id", vppTokenId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var vppTokenIdOption = new Option("--vpptoken-id", description: "key: id of vppToken"); + vppTokenIdOption.IsRequired = true; + command.AddOption(vppTokenIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (vppTokenId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,14 +80,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "List of Vpp tokens for this organization."; // Create options for all the parameters - command.AddOption(new Option("--vpptoken-id", description: "key: id of vppToken")); - command.AddOption(new Option("--body")); + var vppTokenIdOption = new Option("--vpptoken-id", description: "key: id of vppToken"); + vppTokenIdOption.IsRequired = true; + command.AddOption(vppTokenIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (vppTokenId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(vppTokenId)) requestInfo.PathParameters.Add("vppToken_id", vppTokenId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/VppTokens/VppTokensRequestBuilder.cs b/src/generated/DeviceAppManagement/VppTokens/VppTokensRequestBuilder.cs index 61ce31bec2a..4b654248082 100644 --- a/src/generated/DeviceAppManagement/VppTokens/VppTokensRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/VppTokens/VppTokensRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "List of Vpp tokens for this organization."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "List of Vpp tokens for this organization."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceAppManagement/WindowsInformationProtectionPolicies/Item/WindowsInformationProtectionPolicyRequestBuilder.cs b/src/generated/DeviceAppManagement/WindowsInformationProtectionPolicies/Item/WindowsInformationProtectionPolicyRequestBuilder.cs index c75091921f9..cbc38acf56e 100644 --- a/src/generated/DeviceAppManagement/WindowsInformationProtectionPolicies/Item/WindowsInformationProtectionPolicyRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/WindowsInformationProtectionPolicies/Item/WindowsInformationProtectionPolicyRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Windows information protection for apps running on devices which are not MDM enrolled."; // Create options for all the parameters - command.AddOption(new Option("--windowsinformationprotectionpolicy-id", description: "key: id of windowsInformationProtectionPolicy")); + var windowsInformationProtectionPolicyIdOption = new Option("--windowsinformationprotectionpolicy-id", description: "key: id of windowsInformationProtectionPolicy"); + windowsInformationProtectionPolicyIdOption.IsRequired = true; + command.AddOption(windowsInformationProtectionPolicyIdOption); command.Handler = CommandHandler.Create(async (windowsInformationProtectionPolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(windowsInformationProtectionPolicyId)) requestInfo.PathParameters.Add("windowsInformationProtectionPolicy_id", windowsInformationProtectionPolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Windows information protection for apps running on devices which are not MDM enrolled."; // Create options for all the parameters - command.AddOption(new Option("--windowsinformationprotectionpolicy-id", description: "key: id of windowsInformationProtectionPolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (windowsInformationProtectionPolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(windowsInformationProtectionPolicyId)) requestInfo.PathParameters.Add("windowsInformationProtectionPolicy_id", windowsInformationProtectionPolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var windowsInformationProtectionPolicyIdOption = new Option("--windowsinformationprotectionpolicy-id", description: "key: id of windowsInformationProtectionPolicy"); + windowsInformationProtectionPolicyIdOption.IsRequired = true; + command.AddOption(windowsInformationProtectionPolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (windowsInformationProtectionPolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Windows information protection for apps running on devices which are not MDM enrolled."; // Create options for all the parameters - command.AddOption(new Option("--windowsinformationprotectionpolicy-id", description: "key: id of windowsInformationProtectionPolicy")); - command.AddOption(new Option("--body")); + var windowsInformationProtectionPolicyIdOption = new Option("--windowsinformationprotectionpolicy-id", description: "key: id of windowsInformationProtectionPolicy"); + windowsInformationProtectionPolicyIdOption.IsRequired = true; + command.AddOption(windowsInformationProtectionPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (windowsInformationProtectionPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(windowsInformationProtectionPolicyId)) requestInfo.PathParameters.Add("windowsInformationProtectionPolicy_id", windowsInformationProtectionPolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceAppManagement/WindowsInformationProtectionPolicies/WindowsInformationProtectionPoliciesRequestBuilder.cs b/src/generated/DeviceAppManagement/WindowsInformationProtectionPolicies/WindowsInformationProtectionPoliciesRequestBuilder.cs index 47224867b8c..2b1d31239c8 100644 --- a/src/generated/DeviceAppManagement/WindowsInformationProtectionPolicies/WindowsInformationProtectionPoliciesRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/WindowsInformationProtectionPolicies/WindowsInformationProtectionPoliciesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Windows information protection for apps running on devices which are not MDM enrolled."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Windows information protection for apps running on devices which are not MDM enrolled."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/ApplePushNotificationCertificate/ApplePushNotificationCertificateRequestBuilder.cs b/src/generated/DeviceManagement/ApplePushNotificationCertificate/ApplePushNotificationCertificateRequestBuilder.cs index 98ce3a3f6f3..7929b6f9fcd 100644 --- a/src/generated/DeviceManagement/ApplePushNotificationCertificate/ApplePushNotificationCertificateRequestBuilder.cs +++ b/src/generated/DeviceManagement/ApplePushNotificationCertificate/ApplePushNotificationCertificateRequestBuilder.cs @@ -28,7 +28,8 @@ public Command BuildDeleteCommand() { command.Description = "Apple push notification certificate."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,12 +43,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Apple push notification certificate."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,12 +74,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Apple push notification certificate."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ApplePushNotificationCertificate/DownloadApplePushNotificationCertificateSigningRequest/DownloadApplePushNotificationCertificateSigningRequestRequestBuilder.cs b/src/generated/DeviceManagement/ApplePushNotificationCertificate/DownloadApplePushNotificationCertificateSigningRequest/DownloadApplePushNotificationCertificateSigningRequestRequestBuilder.cs index 19460e5bf07..598459b8b6c 100644 --- a/src/generated/DeviceManagement/ApplePushNotificationCertificate/DownloadApplePushNotificationCertificateSigningRequest/DownloadApplePushNotificationCertificateSigningRequestRequestBuilder.cs +++ b/src/generated/DeviceManagement/ApplePushNotificationCertificate/DownloadApplePushNotificationCertificateSigningRequest/DownloadApplePushNotificationCertificateSigningRequestRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Download Apple push notification certificate signing request"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/ComplianceManagementPartners/ComplianceManagementPartnersRequestBuilder.cs b/src/generated/DeviceManagement/ComplianceManagementPartners/ComplianceManagementPartnersRequestBuilder.cs index cf9b786483a..b68f6c987e1 100644 --- a/src/generated/DeviceManagement/ComplianceManagementPartners/ComplianceManagementPartnersRequestBuilder.cs +++ b/src/generated/DeviceManagement/ComplianceManagementPartners/ComplianceManagementPartnersRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of Compliance Management Partners configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of Compliance Management Partners configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/ComplianceManagementPartners/Item/ComplianceManagementPartnerRequestBuilder.cs b/src/generated/DeviceManagement/ComplianceManagementPartners/Item/ComplianceManagementPartnerRequestBuilder.cs index 8d059b95c0d..b20450cd196 100644 --- a/src/generated/DeviceManagement/ComplianceManagementPartners/Item/ComplianceManagementPartnerRequestBuilder.cs +++ b/src/generated/DeviceManagement/ComplianceManagementPartners/Item/ComplianceManagementPartnerRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of Compliance Management Partners configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--compliancemanagementpartner-id", description: "key: id of complianceManagementPartner")); + var complianceManagementPartnerIdOption = new Option("--compliancemanagementpartner-id", description: "key: id of complianceManagementPartner"); + complianceManagementPartnerIdOption.IsRequired = true; + command.AddOption(complianceManagementPartnerIdOption); command.Handler = CommandHandler.Create(async (complianceManagementPartnerId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(complianceManagementPartnerId)) requestInfo.PathParameters.Add("complianceManagementPartner_id", complianceManagementPartnerId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of Compliance Management Partners configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--compliancemanagementpartner-id", description: "key: id of complianceManagementPartner")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (complianceManagementPartnerId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(complianceManagementPartnerId)) requestInfo.PathParameters.Add("complianceManagementPartner_id", complianceManagementPartnerId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var complianceManagementPartnerIdOption = new Option("--compliancemanagementpartner-id", description: "key: id of complianceManagementPartner"); + complianceManagementPartnerIdOption.IsRequired = true; + command.AddOption(complianceManagementPartnerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (complianceManagementPartnerId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of Compliance Management Partners configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--compliancemanagementpartner-id", description: "key: id of complianceManagementPartner")); - command.AddOption(new Option("--body")); + var complianceManagementPartnerIdOption = new Option("--compliancemanagementpartner-id", description: "key: id of complianceManagementPartner"); + complianceManagementPartnerIdOption.IsRequired = true; + command.AddOption(complianceManagementPartnerIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (complianceManagementPartnerId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(complianceManagementPartnerId)) requestInfo.PathParameters.Add("complianceManagementPartner_id", complianceManagementPartnerId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ConditionalAccessSettings/ConditionalAccessSettingsRequestBuilder.cs b/src/generated/DeviceManagement/ConditionalAccessSettings/ConditionalAccessSettingsRequestBuilder.cs index 7ee02ac32de..f02808d56f9 100644 --- a/src/generated/DeviceManagement/ConditionalAccessSettings/ConditionalAccessSettingsRequestBuilder.cs +++ b/src/generated/DeviceManagement/ConditionalAccessSettings/ConditionalAccessSettingsRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildDeleteCommand() { command.Description = "The Exchange on premises conditional access settings. On premises conditional access will require devices to be both enrolled and compliant for mail access"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,12 +42,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The Exchange on premises conditional access settings. On premises conditional access will require devices to be both enrolled and compliant for mail access"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,12 +73,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The Exchange on premises conditional access settings. On premises conditional access will require devices to be both enrolled and compliant for mail access"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DetectedApps/DetectedAppsRequestBuilder.cs b/src/generated/DeviceManagement/DetectedApps/DetectedAppsRequestBuilder.cs index f23afbf4975..dc259b14e30 100644 --- a/src/generated/DeviceManagement/DetectedApps/DetectedAppsRequestBuilder.cs +++ b/src/generated/DeviceManagement/DetectedApps/DetectedAppsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of detected apps associated with a device."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of detected apps associated with a device."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DetectedApps/Item/DetectedAppRequestBuilder.cs b/src/generated/DeviceManagement/DetectedApps/Item/DetectedAppRequestBuilder.cs index 85a8ce57851..8b834d61bd1 100644 --- a/src/generated/DeviceManagement/DetectedApps/Item/DetectedAppRequestBuilder.cs +++ b/src/generated/DeviceManagement/DetectedApps/Item/DetectedAppRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of detected apps associated with a device."; // Create options for all the parameters - command.AddOption(new Option("--detectedapp-id", description: "key: id of detectedApp")); + var detectedAppIdOption = new Option("--detectedapp-id", description: "key: id of detectedApp"); + detectedAppIdOption.IsRequired = true; + command.AddOption(detectedAppIdOption); command.Handler = CommandHandler.Create(async (detectedAppId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(detectedAppId)) requestInfo.PathParameters.Add("detectedApp_id", detectedAppId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of detected apps associated with a device."; // Create options for all the parameters - command.AddOption(new Option("--detectedapp-id", description: "key: id of detectedApp")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (detectedAppId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(detectedAppId)) requestInfo.PathParameters.Add("detectedApp_id", detectedAppId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var detectedAppIdOption = new Option("--detectedapp-id", description: "key: id of detectedApp"); + detectedAppIdOption.IsRequired = true; + command.AddOption(detectedAppIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (detectedAppId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of detected apps associated with a device."; // Create options for all the parameters - command.AddOption(new Option("--detectedapp-id", description: "key: id of detectedApp")); - command.AddOption(new Option("--body")); + var detectedAppIdOption = new Option("--detectedapp-id", description: "key: id of detectedApp"); + detectedAppIdOption.IsRequired = true; + command.AddOption(detectedAppIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (detectedAppId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(detectedAppId)) requestInfo.PathParameters.Add("detectedApp_id", detectedAppId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DetectedApps/Item/ManagedDevices/@Ref/RefRequestBuilder.cs b/src/generated/DeviceManagement/DetectedApps/Item/ManagedDevices/@Ref/RefRequestBuilder.cs index 10122709796..f10cec25689 100644 --- a/src/generated/DeviceManagement/DetectedApps/Item/ManagedDevices/@Ref/RefRequestBuilder.cs +++ b/src/generated/DeviceManagement/DetectedApps/Item/ManagedDevices/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The devices that have the discovered application installed"; // Create options for all the parameters - command.AddOption(new Option("--detectedapp-id", description: "key: id of detectedApp")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (detectedAppId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(detectedAppId)) requestInfo.PathParameters.Add("detectedApp_id", detectedAppId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var detectedAppIdOption = new Option("--detectedapp-id", description: "key: id of detectedApp"); + detectedAppIdOption.IsRequired = true; + command.AddOption(detectedAppIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (detectedAppId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The devices that have the discovered application installed"; // Create options for all the parameters - command.AddOption(new Option("--detectedapp-id", description: "key: id of detectedApp")); - command.AddOption(new Option("--body")); + var detectedAppIdOption = new Option("--detectedapp-id", description: "key: id of detectedApp"); + detectedAppIdOption.IsRequired = true; + command.AddOption(detectedAppIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (detectedAppId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(detectedAppId)) requestInfo.PathParameters.Add("detectedApp_id", detectedAppId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DetectedApps/Item/ManagedDevices/ManagedDevicesRequestBuilder.cs b/src/generated/DeviceManagement/DetectedApps/Item/ManagedDevices/ManagedDevicesRequestBuilder.cs index 96f5697d223..7e55a3fad7c 100644 --- a/src/generated/DeviceManagement/DetectedApps/Item/ManagedDevices/ManagedDevicesRequestBuilder.cs +++ b/src/generated/DeviceManagement/DetectedApps/Item/ManagedDevices/ManagedDevicesRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The devices that have the discovered application installed"; // Create options for all the parameters - command.AddOption(new Option("--detectedapp-id", description: "key: id of detectedApp")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (detectedAppId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(detectedAppId)) requestInfo.PathParameters.Add("detectedApp_id", detectedAppId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var detectedAppIdOption = new Option("--detectedapp-id", description: "key: id of detectedApp"); + detectedAppIdOption.IsRequired = true; + command.AddOption(detectedAppIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (detectedAppId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceCategories/DeviceCategoriesRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCategories/DeviceCategoriesRequestBuilder.cs index 2d89e5f6579..b0a4f5d5121 100644 --- a/src/generated/DeviceManagement/DeviceCategories/DeviceCategoriesRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCategories/DeviceCategoriesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of device categories with the tenant."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of device categories with the tenant."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceCategories/Item/DeviceCategoryRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCategories/Item/DeviceCategoryRequestBuilder.cs index 47c9358fe49..96002c7cf2a 100644 --- a/src/generated/DeviceManagement/DeviceCategories/Item/DeviceCategoryRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCategories/Item/DeviceCategoryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of device categories with the tenant."; // Create options for all the parameters - command.AddOption(new Option("--devicecategory-id", description: "key: id of deviceCategory")); + var deviceCategoryIdOption = new Option("--devicecategory-id", description: "key: id of deviceCategory"); + deviceCategoryIdOption.IsRequired = true; + command.AddOption(deviceCategoryIdOption); command.Handler = CommandHandler.Create(async (deviceCategoryId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceCategoryId)) requestInfo.PathParameters.Add("deviceCategory_id", deviceCategoryId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of device categories with the tenant."; // Create options for all the parameters - command.AddOption(new Option("--devicecategory-id", description: "key: id of deviceCategory")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCategoryId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCategoryId)) requestInfo.PathParameters.Add("deviceCategory_id", deviceCategoryId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCategoryIdOption = new Option("--devicecategory-id", description: "key: id of deviceCategory"); + deviceCategoryIdOption.IsRequired = true; + command.AddOption(deviceCategoryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCategoryId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of device categories with the tenant."; // Create options for all the parameters - command.AddOption(new Option("--devicecategory-id", description: "key: id of deviceCategory")); - command.AddOption(new Option("--body")); + var deviceCategoryIdOption = new Option("--devicecategory-id", description: "key: id of deviceCategory"); + deviceCategoryIdOption.IsRequired = true; + command.AddOption(deviceCategoryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCategoryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCategoryId)) requestInfo.PathParameters.Add("deviceCategory_id", deviceCategoryId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/DeviceCompliancePoliciesRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/DeviceCompliancePoliciesRequestBuilder.cs index 1b8ae1794e7..496ac99c3a5 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/DeviceCompliancePoliciesRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/DeviceCompliancePoliciesRequestBuilder.cs @@ -45,12 +45,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The device compliance policies."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,24 +72,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The device compliance policies."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/Assign/AssignRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/Assign/AssignRequestBuilder.cs index f88c863c28b..f59bfe47ae1 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/Assign/AssignRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/Assignments/AssignmentsRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/Assignments/AssignmentsRequestBuilder.cs index f02ac10f641..cda196db74c 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/Assignments/AssignmentsRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/Assignments/AssignmentsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of assignments for this compliance policy."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of assignments for this compliance policy."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/Assignments/Item/DeviceCompliancePolicyAssignmentRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/Assignments/Item/DeviceCompliancePolicyAssignmentRequestBuilder.cs index 0e67971af8b..93db5b24876 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/Assignments/Item/DeviceCompliancePolicyAssignmentRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/Assignments/Item/DeviceCompliancePolicyAssignmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of assignments for this compliance policy."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecompliancepolicyassignment-id", description: "key: id of deviceCompliancePolicyAssignment")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceCompliancePolicyAssignmentIdOption = new Option("--devicecompliancepolicyassignment-id", description: "key: id of deviceCompliancePolicyAssignment"); + deviceCompliancePolicyAssignmentIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyAssignmentIdOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceCompliancePolicyAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceCompliancePolicyAssignmentId)) requestInfo.PathParameters.Add("deviceCompliancePolicyAssignment_id", deviceCompliancePolicyAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of assignments for this compliance policy."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecompliancepolicyassignment-id", description: "key: id of deviceCompliancePolicyAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceCompliancePolicyAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceCompliancePolicyAssignmentId)) requestInfo.PathParameters.Add("deviceCompliancePolicyAssignment_id", deviceCompliancePolicyAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceCompliancePolicyAssignmentIdOption = new Option("--devicecompliancepolicyassignment-id", description: "key: id of deviceCompliancePolicyAssignment"); + deviceCompliancePolicyAssignmentIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceCompliancePolicyAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of assignments for this compliance policy."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecompliancepolicyassignment-id", description: "key: id of deviceCompliancePolicyAssignment")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceCompliancePolicyAssignmentIdOption = new Option("--devicecompliancepolicyassignment-id", description: "key: id of deviceCompliancePolicyAssignment"); + deviceCompliancePolicyAssignmentIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceCompliancePolicyAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceCompliancePolicyAssignmentId)) requestInfo.PathParameters.Add("deviceCompliancePolicyAssignment_id", deviceCompliancePolicyAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceCompliancePolicyRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceCompliancePolicyRequestBuilder.cs index 2347ac7117c..9080cf9bd0e 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceCompliancePolicyRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceCompliancePolicyRequestBuilder.cs @@ -48,10 +48,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The device compliance policies."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -87,14 +89,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The device compliance policies."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -113,14 +123,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The device compliance policies."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceSettingStateSummaries/DeviceSettingStateSummariesRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceSettingStateSummaries/DeviceSettingStateSummariesRequestBuilder.cs index c9acc50fc20..95a558fcecf 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceSettingStateSummaries/DeviceSettingStateSummariesRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceSettingStateSummaries/DeviceSettingStateSummariesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Compliance Setting State Device Summary"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Compliance Setting State Device Summary"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceSettingStateSummaries/Item/SettingStateDeviceSummaryRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceSettingStateSummaries/Item/SettingStateDeviceSummaryRequestBuilder.cs index ffa27c82ac7..bd04fd26927 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceSettingStateSummaries/Item/SettingStateDeviceSummaryRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceSettingStateSummaries/Item/SettingStateDeviceSummaryRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Compliance Setting State Device Summary"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--settingstatedevicesummary-id", description: "key: id of settingStateDeviceSummary")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var settingStateDeviceSummaryIdOption = new Option("--settingstatedevicesummary-id", description: "key: id of settingStateDeviceSummary"); + settingStateDeviceSummaryIdOption.IsRequired = true; + command.AddOption(settingStateDeviceSummaryIdOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, settingStateDeviceSummaryId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(settingStateDeviceSummaryId)) requestInfo.PathParameters.Add("settingStateDeviceSummary_id", settingStateDeviceSummaryId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Compliance Setting State Device Summary"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--settingstatedevicesummary-id", description: "key: id of settingStateDeviceSummary")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, settingStateDeviceSummaryId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(settingStateDeviceSummaryId)) requestInfo.PathParameters.Add("settingStateDeviceSummary_id", settingStateDeviceSummaryId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var settingStateDeviceSummaryIdOption = new Option("--settingstatedevicesummary-id", description: "key: id of settingStateDeviceSummary"); + settingStateDeviceSummaryIdOption.IsRequired = true; + command.AddOption(settingStateDeviceSummaryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, settingStateDeviceSummaryId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Compliance Setting State Device Summary"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--settingstatedevicesummary-id", description: "key: id of settingStateDeviceSummary")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var settingStateDeviceSummaryIdOption = new Option("--settingstatedevicesummary-id", description: "key: id of settingStateDeviceSummary"); + settingStateDeviceSummaryIdOption.IsRequired = true; + command.AddOption(settingStateDeviceSummaryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, settingStateDeviceSummaryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(settingStateDeviceSummaryId)) requestInfo.PathParameters.Add("settingStateDeviceSummary_id", settingStateDeviceSummaryId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceStatusOverview/DeviceStatusOverviewRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceStatusOverview/DeviceStatusOverviewRequestBuilder.cs index 06de3d49cec..1ec27e29c4c 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceStatusOverview/DeviceStatusOverviewRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceStatusOverview/DeviceStatusOverviewRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device compliance devices status overview"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device compliance devices status overview"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device compliance devices status overview"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceStatuses/DeviceStatusesRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceStatuses/DeviceStatusesRequestBuilder.cs index 93cb537a333..1049e066508 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceStatuses/DeviceStatusesRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceStatuses/DeviceStatusesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "List of DeviceComplianceDeviceStatus."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "List of DeviceComplianceDeviceStatus."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceStatuses/Item/DeviceComplianceDeviceStatusRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceStatuses/Item/DeviceComplianceDeviceStatusRequestBuilder.cs index 1e032b763ff..f46507f490d 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceStatuses/Item/DeviceComplianceDeviceStatusRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceStatuses/Item/DeviceComplianceDeviceStatusRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "List of DeviceComplianceDeviceStatus."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecompliancedevicestatus-id", description: "key: id of deviceComplianceDeviceStatus")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceComplianceDeviceStatusIdOption = new Option("--devicecompliancedevicestatus-id", description: "key: id of deviceComplianceDeviceStatus"); + deviceComplianceDeviceStatusIdOption.IsRequired = true; + command.AddOption(deviceComplianceDeviceStatusIdOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceDeviceStatusId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceComplianceDeviceStatusId)) requestInfo.PathParameters.Add("deviceComplianceDeviceStatus_id", deviceComplianceDeviceStatusId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "List of DeviceComplianceDeviceStatus."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecompliancedevicestatus-id", description: "key: id of deviceComplianceDeviceStatus")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceDeviceStatusId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceComplianceDeviceStatusId)) requestInfo.PathParameters.Add("deviceComplianceDeviceStatus_id", deviceComplianceDeviceStatusId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceComplianceDeviceStatusIdOption = new Option("--devicecompliancedevicestatus-id", description: "key: id of deviceComplianceDeviceStatus"); + deviceComplianceDeviceStatusIdOption.IsRequired = true; + command.AddOption(deviceComplianceDeviceStatusIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceDeviceStatusId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "List of DeviceComplianceDeviceStatus."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecompliancedevicestatus-id", description: "key: id of deviceComplianceDeviceStatus")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceComplianceDeviceStatusIdOption = new Option("--devicecompliancedevicestatus-id", description: "key: id of deviceComplianceDeviceStatus"); + deviceComplianceDeviceStatusIdOption.IsRequired = true; + command.AddOption(deviceComplianceDeviceStatusIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceDeviceStatusId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceComplianceDeviceStatusId)) requestInfo.PathParameters.Add("deviceComplianceDeviceStatus_id", deviceComplianceDeviceStatusId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduleActionsForRules/ScheduleActionsForRulesRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduleActionsForRules/ScheduleActionsForRulesRequestBuilder.cs index d2a6664b760..6db4208e829 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduleActionsForRules/ScheduleActionsForRulesRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduleActionsForRules/ScheduleActionsForRulesRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action scheduleActionsForRules"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/Item/DeviceComplianceScheduledActionForRuleRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/Item/DeviceComplianceScheduledActionForRuleRequestBuilder.cs index 420dc9580b8..1b25caee5ee 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/Item/DeviceComplianceScheduledActionForRuleRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/Item/DeviceComplianceScheduledActionForRuleRequestBuilder.cs @@ -21,18 +21,21 @@ public class DeviceComplianceScheduledActionForRuleRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies."; + command.Description = "The list of scheduled action for this rule"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceComplianceScheduledActionForRuleIdOption = new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule"); + deviceComplianceScheduledActionForRuleIdOption.IsRequired = true; + command.AddOption(deviceComplianceScheduledActionForRuleIdOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceScheduledActionForRuleId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceComplianceScheduledActionForRuleId)) requestInfo.PathParameters.Add("deviceComplianceScheduledActionForRule_id", deviceComplianceScheduledActionForRuleId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -40,22 +43,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies."; + command.Description = "The list of scheduled action for this rule"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceScheduledActionForRuleId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceComplianceScheduledActionForRuleId)) requestInfo.PathParameters.Add("deviceComplianceScheduledActionForRule_id", deviceComplianceScheduledActionForRuleId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceComplianceScheduledActionForRuleIdOption = new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule"); + deviceComplianceScheduledActionForRuleIdOption.IsRequired = true; + command.AddOption(deviceComplianceScheduledActionForRuleIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceScheduledActionForRuleId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,22 +80,27 @@ public Command BuildGetCommand() { return command; } /// - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies."; + command.Description = "The list of scheduled action for this rule"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceComplianceScheduledActionForRuleIdOption = new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule"); + deviceComplianceScheduledActionForRuleIdOption.IsRequired = true; + command.AddOption(deviceComplianceScheduledActionForRuleIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceScheduledActionForRuleId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceComplianceScheduledActionForRuleId)) requestInfo.PathParameters.Add("deviceComplianceScheduledActionForRule_id", deviceComplianceScheduledActionForRuleId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -111,7 +128,7 @@ public DeviceComplianceScheduledActionForRuleRequestBuilder(Dictionary - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// Request headers /// Request options /// @@ -126,7 +143,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// Request headers /// Request options /// Request query parameters @@ -147,7 +164,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// /// Request headers /// Request options @@ -165,7 +182,7 @@ public RequestInformation CreatePatchRequestInformation(DeviceComplianceSchedule return requestInfo; } /// - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -176,7 +193,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -188,7 +205,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } /// - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// Cancellation token to use when cancelling requests /// Request headers /// @@ -200,7 +217,7 @@ public async Task PatchAsync(DeviceComplianceScheduledActionForRule model, Actio var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/Item/ScheduledActionConfigurations/Item/DeviceComplianceActionItemRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/Item/ScheduledActionConfigurations/Item/DeviceComplianceActionItemRequestBuilder.cs index 8b02af5b06e..1ff3361ccec 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/Item/ScheduledActionConfigurations/Item/DeviceComplianceActionItemRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/Item/ScheduledActionConfigurations/Item/DeviceComplianceActionItemRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of scheduled action configurations for this compliance policy. Compliance policy must have one and only one block scheduled action."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule")); - command.AddOption(new Option("--devicecomplianceactionitem-id", description: "key: id of deviceComplianceActionItem")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceComplianceScheduledActionForRuleIdOption = new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule"); + deviceComplianceScheduledActionForRuleIdOption.IsRequired = true; + command.AddOption(deviceComplianceScheduledActionForRuleIdOption); + var deviceComplianceActionItemIdOption = new Option("--devicecomplianceactionitem-id", description: "key: id of deviceComplianceActionItem"); + deviceComplianceActionItemIdOption.IsRequired = true; + command.AddOption(deviceComplianceActionItemIdOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceScheduledActionForRuleId, deviceComplianceActionItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceComplianceScheduledActionForRuleId)) requestInfo.PathParameters.Add("deviceComplianceScheduledActionForRule_id", deviceComplianceScheduledActionForRuleId); - if (!String.IsNullOrEmpty(deviceComplianceActionItemId)) requestInfo.PathParameters.Add("deviceComplianceActionItem_id", deviceComplianceActionItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of scheduled action configurations for this compliance policy. Compliance policy must have one and only one block scheduled action."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule")); - command.AddOption(new Option("--devicecomplianceactionitem-id", description: "key: id of deviceComplianceActionItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceScheduledActionForRuleId, deviceComplianceActionItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceComplianceScheduledActionForRuleId)) requestInfo.PathParameters.Add("deviceComplianceScheduledActionForRule_id", deviceComplianceScheduledActionForRuleId); - if (!String.IsNullOrEmpty(deviceComplianceActionItemId)) requestInfo.PathParameters.Add("deviceComplianceActionItem_id", deviceComplianceActionItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceComplianceScheduledActionForRuleIdOption = new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule"); + deviceComplianceScheduledActionForRuleIdOption.IsRequired = true; + command.AddOption(deviceComplianceScheduledActionForRuleIdOption); + var deviceComplianceActionItemIdOption = new Option("--devicecomplianceactionitem-id", description: "key: id of deviceComplianceActionItem"); + deviceComplianceActionItemIdOption.IsRequired = true; + command.AddOption(deviceComplianceActionItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceScheduledActionForRuleId, deviceComplianceActionItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of scheduled action configurations for this compliance policy. Compliance policy must have one and only one block scheduled action."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule")); - command.AddOption(new Option("--devicecomplianceactionitem-id", description: "key: id of deviceComplianceActionItem")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceComplianceScheduledActionForRuleIdOption = new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule"); + deviceComplianceScheduledActionForRuleIdOption.IsRequired = true; + command.AddOption(deviceComplianceScheduledActionForRuleIdOption); + var deviceComplianceActionItemIdOption = new Option("--devicecomplianceactionitem-id", description: "key: id of deviceComplianceActionItem"); + deviceComplianceActionItemIdOption.IsRequired = true; + command.AddOption(deviceComplianceActionItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceScheduledActionForRuleId, deviceComplianceActionItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceComplianceScheduledActionForRuleId)) requestInfo.PathParameters.Add("deviceComplianceScheduledActionForRule_id", deviceComplianceScheduledActionForRuleId); - if (!String.IsNullOrEmpty(deviceComplianceActionItemId)) requestInfo.PathParameters.Add("deviceComplianceActionItem_id", deviceComplianceActionItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/Item/ScheduledActionConfigurations/ScheduledActionConfigurationsRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/Item/ScheduledActionConfigurations/ScheduledActionConfigurationsRequestBuilder.cs index a4638a6447b..79ce6a633b5 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/Item/ScheduledActionConfigurations/ScheduledActionConfigurationsRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/Item/ScheduledActionConfigurations/ScheduledActionConfigurationsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of scheduled action configurations for this compliance policy. Compliance policy must have one and only one block scheduled action."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceComplianceScheduledActionForRuleIdOption = new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule"); + deviceComplianceScheduledActionForRuleIdOption.IsRequired = true; + command.AddOption(deviceComplianceScheduledActionForRuleIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceScheduledActionForRuleId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceComplianceScheduledActionForRuleId)) requestInfo.PathParameters.Add("deviceComplianceScheduledActionForRule_id", deviceComplianceScheduledActionForRuleId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of scheduled action configurations for this compliance policy. Compliance policy must have one and only one block scheduled action."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceScheduledActionForRuleId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceComplianceScheduledActionForRuleId)) requestInfo.PathParameters.Add("deviceComplianceScheduledActionForRule_id", deviceComplianceScheduledActionForRuleId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceComplianceScheduledActionForRuleIdOption = new Option("--devicecompliancescheduledactionforrule-id", description: "key: id of deviceComplianceScheduledActionForRule"); + deviceComplianceScheduledActionForRuleIdOption.IsRequired = true; + command.AddOption(deviceComplianceScheduledActionForRuleIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceScheduledActionForRuleId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/ScheduledActionsForRuleRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/ScheduledActionsForRuleRequestBuilder.cs index 3868c8e6af5..73e58166942 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/ScheduledActionsForRuleRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/ScheduledActionsForRule/ScheduledActionsForRuleRequestBuilder.cs @@ -31,20 +31,24 @@ public List BuildCommand() { return commands; } /// - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies."; + command.Description = "The list of scheduled action for this rule"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,32 +61,53 @@ public Command BuildCreateCommand() { return command; } /// - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies."; + command.Description = "The list of scheduled action for this rule"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,7 +133,7 @@ public ScheduledActionsForRuleRequestBuilder(Dictionary pathPara RequestAdapter = requestAdapter; } /// - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// Request headers /// Request options /// Request query parameters @@ -129,7 +154,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// /// Request headers /// Request options @@ -147,7 +172,7 @@ public RequestInformation CreatePostRequestInformation(DeviceComplianceScheduled return requestInfo; } /// - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -159,7 +184,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } /// - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule /// Cancellation token to use when cancelling requests /// Request headers /// @@ -171,7 +196,7 @@ public async Task PostAsync(DeviceCompli var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/UserStatusOverview/UserStatusOverviewRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/UserStatusOverview/UserStatusOverviewRequestBuilder.cs index 807cc28e2cd..ee74e621f46 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/UserStatusOverview/UserStatusOverviewRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/UserStatusOverview/UserStatusOverviewRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device compliance users status overview"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device compliance users status overview"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device compliance users status overview"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/UserStatuses/Item/DeviceComplianceUserStatusRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/UserStatuses/Item/DeviceComplianceUserStatusRequestBuilder.cs index ab1ac3bd3a6..5bb54ea31bd 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/UserStatuses/Item/DeviceComplianceUserStatusRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/UserStatuses/Item/DeviceComplianceUserStatusRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "List of DeviceComplianceUserStatus."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecomplianceuserstatus-id", description: "key: id of deviceComplianceUserStatus")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceComplianceUserStatusIdOption = new Option("--devicecomplianceuserstatus-id", description: "key: id of deviceComplianceUserStatus"); + deviceComplianceUserStatusIdOption.IsRequired = true; + command.AddOption(deviceComplianceUserStatusIdOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceUserStatusId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceComplianceUserStatusId)) requestInfo.PathParameters.Add("deviceComplianceUserStatus_id", deviceComplianceUserStatusId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "List of DeviceComplianceUserStatus."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecomplianceuserstatus-id", description: "key: id of deviceComplianceUserStatus")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceUserStatusId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceComplianceUserStatusId)) requestInfo.PathParameters.Add("deviceComplianceUserStatus_id", deviceComplianceUserStatusId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceComplianceUserStatusIdOption = new Option("--devicecomplianceuserstatus-id", description: "key: id of deviceComplianceUserStatus"); + deviceComplianceUserStatusIdOption.IsRequired = true; + command.AddOption(deviceComplianceUserStatusIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceUserStatusId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "List of DeviceComplianceUserStatus."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--devicecomplianceuserstatus-id", description: "key: id of deviceComplianceUserStatus")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var deviceComplianceUserStatusIdOption = new Option("--devicecomplianceuserstatus-id", description: "key: id of deviceComplianceUserStatus"); + deviceComplianceUserStatusIdOption.IsRequired = true; + command.AddOption(deviceComplianceUserStatusIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, deviceComplianceUserStatusId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - if (!String.IsNullOrEmpty(deviceComplianceUserStatusId)) requestInfo.PathParameters.Add("deviceComplianceUserStatus_id", deviceComplianceUserStatusId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/UserStatuses/UserStatusesRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/UserStatuses/UserStatusesRequestBuilder.cs index 091d3140f23..5c82714f1a7 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/UserStatuses/UserStatusesRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/UserStatuses/UserStatusesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "List of DeviceComplianceUserStatus."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "List of DeviceComplianceUserStatus."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicyId)) requestInfo.PathParameters.Add("deviceCompliancePolicy_id", deviceCompliancePolicyId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicyIdOption = new Option("--devicecompliancepolicy-id", description: "key: id of deviceCompliancePolicy"); + deviceCompliancePolicyIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicyId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicyDeviceStateSummary/DeviceCompliancePolicyDeviceStateSummaryRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicyDeviceStateSummary/DeviceCompliancePolicyDeviceStateSummaryRequestBuilder.cs index 9581d684ca4..2cd1da8e5df 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicyDeviceStateSummary/DeviceCompliancePolicyDeviceStateSummaryRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicyDeviceStateSummary/DeviceCompliancePolicyDeviceStateSummaryRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildDeleteCommand() { command.Description = "The device compliance state summary for this account."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,12 +42,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The device compliance state summary for this account."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,12 +73,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The device compliance state summary for this account."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/DeviceCompliancePolicySettingStateSummariesRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/DeviceCompliancePolicySettingStateSummariesRequestBuilder.cs index fb154923edb..296e943d9af 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/DeviceCompliancePolicySettingStateSummariesRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/DeviceCompliancePolicySettingStateSummariesRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The summary states of compliance policy settings for this account."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The summary states of compliance policy settings for this account."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/Item/DeviceCompliancePolicySettingStateSummaryRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/Item/DeviceCompliancePolicySettingStateSummaryRequestBuilder.cs index 562285aa55a..33fcbf09998 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/Item/DeviceCompliancePolicySettingStateSummaryRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/Item/DeviceCompliancePolicySettingStateSummaryRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The summary states of compliance policy settings for this account."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary")); + var deviceCompliancePolicySettingStateSummaryIdOption = new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary"); + deviceCompliancePolicySettingStateSummaryIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicySettingStateSummaryIdOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicySettingStateSummaryId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicySettingStateSummaryId)) requestInfo.PathParameters.Add("deviceCompliancePolicySettingStateSummary_id", deviceCompliancePolicySettingStateSummaryId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The summary states of compliance policy settings for this account."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicySettingStateSummaryId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicySettingStateSummaryId)) requestInfo.PathParameters.Add("deviceCompliancePolicySettingStateSummary_id", deviceCompliancePolicySettingStateSummaryId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicySettingStateSummaryIdOption = new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary"); + deviceCompliancePolicySettingStateSummaryIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicySettingStateSummaryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicySettingStateSummaryId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The summary states of compliance policy settings for this account."; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicySettingStateSummaryIdOption = new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary"); + deviceCompliancePolicySettingStateSummaryIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicySettingStateSummaryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicySettingStateSummaryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicySettingStateSummaryId)) requestInfo.PathParameters.Add("deviceCompliancePolicySettingStateSummary_id", deviceCompliancePolicySettingStateSummaryId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/Item/DeviceComplianceSettingStates/DeviceComplianceSettingStatesRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/Item/DeviceComplianceSettingStates/DeviceComplianceSettingStatesRequestBuilder.cs index 5ff7719cd2b..a8974dfe55e 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/Item/DeviceComplianceSettingStates/DeviceComplianceSettingStatesRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/Item/DeviceComplianceSettingStates/DeviceComplianceSettingStatesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Not yet documented"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicySettingStateSummaryIdOption = new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary"); + deviceCompliancePolicySettingStateSummaryIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicySettingStateSummaryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicySettingStateSummaryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicySettingStateSummaryId)) requestInfo.PathParameters.Add("deviceCompliancePolicySettingStateSummary_id", deviceCompliancePolicySettingStateSummaryId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Not yet documented"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicySettingStateSummaryId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicySettingStateSummaryId)) requestInfo.PathParameters.Add("deviceCompliancePolicySettingStateSummary_id", deviceCompliancePolicySettingStateSummaryId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicySettingStateSummaryIdOption = new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary"); + deviceCompliancePolicySettingStateSummaryIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicySettingStateSummaryIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicySettingStateSummaryId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/Item/DeviceComplianceSettingStates/Item/DeviceComplianceSettingStateRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/Item/DeviceComplianceSettingStates/Item/DeviceComplianceSettingStateRequestBuilder.cs index df225acebb0..0a6cef956dc 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/Item/DeviceComplianceSettingStates/Item/DeviceComplianceSettingStateRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicySettingStateSummaries/Item/DeviceComplianceSettingStates/Item/DeviceComplianceSettingStateRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Not yet documented"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary")); - command.AddOption(new Option("--devicecompliancesettingstate-id", description: "key: id of deviceComplianceSettingState")); + var deviceCompliancePolicySettingStateSummaryIdOption = new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary"); + deviceCompliancePolicySettingStateSummaryIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicySettingStateSummaryIdOption); + var deviceComplianceSettingStateIdOption = new Option("--devicecompliancesettingstate-id", description: "key: id of deviceComplianceSettingState"); + deviceComplianceSettingStateIdOption.IsRequired = true; + command.AddOption(deviceComplianceSettingStateIdOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicySettingStateSummaryId, deviceComplianceSettingStateId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicySettingStateSummaryId)) requestInfo.PathParameters.Add("deviceCompliancePolicySettingStateSummary_id", deviceCompliancePolicySettingStateSummaryId); - if (!String.IsNullOrEmpty(deviceComplianceSettingStateId)) requestInfo.PathParameters.Add("deviceComplianceSettingState_id", deviceComplianceSettingStateId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Not yet documented"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary")); - command.AddOption(new Option("--devicecompliancesettingstate-id", description: "key: id of deviceComplianceSettingState")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceCompliancePolicySettingStateSummaryId, deviceComplianceSettingStateId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceCompliancePolicySettingStateSummaryId)) requestInfo.PathParameters.Add("deviceCompliancePolicySettingStateSummary_id", deviceCompliancePolicySettingStateSummaryId); - if (!String.IsNullOrEmpty(deviceComplianceSettingStateId)) requestInfo.PathParameters.Add("deviceComplianceSettingState_id", deviceComplianceSettingStateId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceCompliancePolicySettingStateSummaryIdOption = new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary"); + deviceCompliancePolicySettingStateSummaryIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicySettingStateSummaryIdOption); + var deviceComplianceSettingStateIdOption = new Option("--devicecompliancesettingstate-id", description: "key: id of deviceComplianceSettingState"); + deviceComplianceSettingStateIdOption.IsRequired = true; + command.AddOption(deviceComplianceSettingStateIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceCompliancePolicySettingStateSummaryId, deviceComplianceSettingStateId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Not yet documented"; // Create options for all the parameters - command.AddOption(new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary")); - command.AddOption(new Option("--devicecompliancesettingstate-id", description: "key: id of deviceComplianceSettingState")); - command.AddOption(new Option("--body")); + var deviceCompliancePolicySettingStateSummaryIdOption = new Option("--devicecompliancepolicysettingstatesummary-id", description: "key: id of deviceCompliancePolicySettingStateSummary"); + deviceCompliancePolicySettingStateSummaryIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicySettingStateSummaryIdOption); + var deviceComplianceSettingStateIdOption = new Option("--devicecompliancesettingstate-id", description: "key: id of deviceComplianceSettingState"); + deviceComplianceSettingStateIdOption.IsRequired = true; + command.AddOption(deviceComplianceSettingStateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceCompliancePolicySettingStateSummaryId, deviceComplianceSettingStateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceCompliancePolicySettingStateSummaryId)) requestInfo.PathParameters.Add("deviceCompliancePolicySettingStateSummary_id", deviceCompliancePolicySettingStateSummaryId); - if (!String.IsNullOrEmpty(deviceComplianceSettingStateId)) requestInfo.PathParameters.Add("deviceComplianceSettingState_id", deviceComplianceSettingStateId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceConfigurationDeviceStateSummaries/DeviceConfigurationDeviceStateSummariesRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurationDeviceStateSummaries/DeviceConfigurationDeviceStateSummariesRequestBuilder.cs index 1287e2c2be7..6cc15cdd1ae 100644 --- a/src/generated/DeviceManagement/DeviceConfigurationDeviceStateSummaries/DeviceConfigurationDeviceStateSummariesRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurationDeviceStateSummaries/DeviceConfigurationDeviceStateSummariesRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildDeleteCommand() { command.Description = "The device configuration device state summary for this account."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,12 +42,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The device configuration device state summary for this account."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,12 +73,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The device configuration device state summary for this account."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceConfigurations/DeviceConfigurationsRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/DeviceConfigurationsRequestBuilder.cs index 6f2ca74e2e7..afb892baf7b 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/DeviceConfigurationsRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/DeviceConfigurationsRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The device configurations."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,24 +70,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The device configurations."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceConfigurations/Item/Assign/AssignRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/Item/Assign/AssignRequestBuilder.cs index b23fc4fd4e2..71a04fec67e 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/Item/Assign/AssignRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/Item/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--body")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs index fc28cd4c0d3..423b236547c 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of assignments for the device configuration profile."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--body")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of assignments for the device configuration profile."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceConfigurations/Item/Assignments/Item/DeviceConfigurationAssignmentRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/Item/Assignments/Item/DeviceConfigurationAssignmentRequestBuilder.cs index 27d0ab288b0..4251fd22e99 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/Item/Assignments/Item/DeviceConfigurationAssignmentRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/Item/Assignments/Item/DeviceConfigurationAssignmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of assignments for the device configuration profile."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--deviceconfigurationassignment-id", description: "key: id of deviceConfigurationAssignment")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var deviceConfigurationAssignmentIdOption = new Option("--deviceconfigurationassignment-id", description: "key: id of deviceConfigurationAssignment"); + deviceConfigurationAssignmentIdOption.IsRequired = true; + command.AddOption(deviceConfigurationAssignmentIdOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, deviceConfigurationAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - if (!String.IsNullOrEmpty(deviceConfigurationAssignmentId)) requestInfo.PathParameters.Add("deviceConfigurationAssignment_id", deviceConfigurationAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of assignments for the device configuration profile."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--deviceconfigurationassignment-id", description: "key: id of deviceConfigurationAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceConfigurationId, deviceConfigurationAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - if (!String.IsNullOrEmpty(deviceConfigurationAssignmentId)) requestInfo.PathParameters.Add("deviceConfigurationAssignment_id", deviceConfigurationAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var deviceConfigurationAssignmentIdOption = new Option("--deviceconfigurationassignment-id", description: "key: id of deviceConfigurationAssignment"); + deviceConfigurationAssignmentIdOption.IsRequired = true; + command.AddOption(deviceConfigurationAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceConfigurationId, deviceConfigurationAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of assignments for the device configuration profile."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--deviceconfigurationassignment-id", description: "key: id of deviceConfigurationAssignment")); - command.AddOption(new Option("--body")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var deviceConfigurationAssignmentIdOption = new Option("--deviceconfigurationassignment-id", description: "key: id of deviceConfigurationAssignment"); + deviceConfigurationAssignmentIdOption.IsRequired = true; + command.AddOption(deviceConfigurationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, deviceConfigurationAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - if (!String.IsNullOrEmpty(deviceConfigurationAssignmentId)) requestInfo.PathParameters.Add("deviceConfigurationAssignment_id", deviceConfigurationAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceConfigurationRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceConfigurationRequestBuilder.cs index 2ba071d02e1..8ffabc7a772 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceConfigurationRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceConfigurationRequestBuilder.cs @@ -47,10 +47,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The device configurations."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -86,14 +88,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The device configurations."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceConfigurationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceConfigurationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,14 +122,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The device configurations."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--body")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceSettingStateSummaries/DeviceSettingStateSummariesRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceSettingStateSummaries/DeviceSettingStateSummariesRequestBuilder.cs index cf5f962c4b0..5ae733d926c 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceSettingStateSummaries/DeviceSettingStateSummariesRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceSettingStateSummaries/DeviceSettingStateSummariesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Device Configuration Setting State Device Summary"; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--body")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Device Configuration Setting State Device Summary"; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceSettingStateSummaries/Item/SettingStateDeviceSummaryRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceSettingStateSummaries/Item/SettingStateDeviceSummaryRequestBuilder.cs index 2dc315161f1..e9ff7e82396 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceSettingStateSummaries/Item/SettingStateDeviceSummaryRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceSettingStateSummaries/Item/SettingStateDeviceSummaryRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device Configuration Setting State Device Summary"; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--settingstatedevicesummary-id", description: "key: id of settingStateDeviceSummary")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var settingStateDeviceSummaryIdOption = new Option("--settingstatedevicesummary-id", description: "key: id of settingStateDeviceSummary"); + settingStateDeviceSummaryIdOption.IsRequired = true; + command.AddOption(settingStateDeviceSummaryIdOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, settingStateDeviceSummaryId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - if (!String.IsNullOrEmpty(settingStateDeviceSummaryId)) requestInfo.PathParameters.Add("settingStateDeviceSummary_id", settingStateDeviceSummaryId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device Configuration Setting State Device Summary"; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--settingstatedevicesummary-id", description: "key: id of settingStateDeviceSummary")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceConfigurationId, settingStateDeviceSummaryId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - if (!String.IsNullOrEmpty(settingStateDeviceSummaryId)) requestInfo.PathParameters.Add("settingStateDeviceSummary_id", settingStateDeviceSummaryId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var settingStateDeviceSummaryIdOption = new Option("--settingstatedevicesummary-id", description: "key: id of settingStateDeviceSummary"); + settingStateDeviceSummaryIdOption.IsRequired = true; + command.AddOption(settingStateDeviceSummaryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceConfigurationId, settingStateDeviceSummaryId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device Configuration Setting State Device Summary"; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--settingstatedevicesummary-id", description: "key: id of settingStateDeviceSummary")); - command.AddOption(new Option("--body")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var settingStateDeviceSummaryIdOption = new Option("--settingstatedevicesummary-id", description: "key: id of settingStateDeviceSummary"); + settingStateDeviceSummaryIdOption.IsRequired = true; + command.AddOption(settingStateDeviceSummaryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, settingStateDeviceSummaryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - if (!String.IsNullOrEmpty(settingStateDeviceSummaryId)) requestInfo.PathParameters.Add("settingStateDeviceSummary_id", settingStateDeviceSummaryId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceStatusOverview/DeviceStatusOverviewRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceStatusOverview/DeviceStatusOverviewRequestBuilder.cs index ed87309890a..5527f95e2c7 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceStatusOverview/DeviceStatusOverviewRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceStatusOverview/DeviceStatusOverviewRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device Configuration devices status overview"; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device Configuration devices status overview"; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceConfigurationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceConfigurationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device Configuration devices status overview"; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--body")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceStatuses/DeviceStatusesRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceStatuses/DeviceStatusesRequestBuilder.cs index 3957dd42539..c86aac05cb9 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceStatuses/DeviceStatusesRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceStatuses/DeviceStatusesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Device configuration installation status by device."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--body")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Device configuration installation status by device."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceStatuses/Item/DeviceConfigurationDeviceStatusRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceStatuses/Item/DeviceConfigurationDeviceStatusRequestBuilder.cs index 42ba86d3e43..9441afb1a81 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceStatuses/Item/DeviceConfigurationDeviceStatusRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceStatuses/Item/DeviceConfigurationDeviceStatusRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device configuration installation status by device."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--deviceconfigurationdevicestatus-id", description: "key: id of deviceConfigurationDeviceStatus")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var deviceConfigurationDeviceStatusIdOption = new Option("--deviceconfigurationdevicestatus-id", description: "key: id of deviceConfigurationDeviceStatus"); + deviceConfigurationDeviceStatusIdOption.IsRequired = true; + command.AddOption(deviceConfigurationDeviceStatusIdOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, deviceConfigurationDeviceStatusId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - if (!String.IsNullOrEmpty(deviceConfigurationDeviceStatusId)) requestInfo.PathParameters.Add("deviceConfigurationDeviceStatus_id", deviceConfigurationDeviceStatusId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device configuration installation status by device."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--deviceconfigurationdevicestatus-id", description: "key: id of deviceConfigurationDeviceStatus")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceConfigurationId, deviceConfigurationDeviceStatusId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - if (!String.IsNullOrEmpty(deviceConfigurationDeviceStatusId)) requestInfo.PathParameters.Add("deviceConfigurationDeviceStatus_id", deviceConfigurationDeviceStatusId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var deviceConfigurationDeviceStatusIdOption = new Option("--deviceconfigurationdevicestatus-id", description: "key: id of deviceConfigurationDeviceStatus"); + deviceConfigurationDeviceStatusIdOption.IsRequired = true; + command.AddOption(deviceConfigurationDeviceStatusIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceConfigurationId, deviceConfigurationDeviceStatusId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device configuration installation status by device."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--deviceconfigurationdevicestatus-id", description: "key: id of deviceConfigurationDeviceStatus")); - command.AddOption(new Option("--body")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var deviceConfigurationDeviceStatusIdOption = new Option("--deviceconfigurationdevicestatus-id", description: "key: id of deviceConfigurationDeviceStatus"); + deviceConfigurationDeviceStatusIdOption.IsRequired = true; + command.AddOption(deviceConfigurationDeviceStatusIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, deviceConfigurationDeviceStatusId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - if (!String.IsNullOrEmpty(deviceConfigurationDeviceStatusId)) requestInfo.PathParameters.Add("deviceConfigurationDeviceStatus_id", deviceConfigurationDeviceStatusId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceConfigurations/Item/GetOmaSettingPlainTextValueWithSecretReferenceValueId/GetOmaSettingPlainTextValueWithSecretReferenceValueIdRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/Item/GetOmaSettingPlainTextValueWithSecretReferenceValueId/GetOmaSettingPlainTextValueWithSecretReferenceValueIdRequestBuilder.cs index 9ab9836cdef..7cab5e3dd8f 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/Item/GetOmaSettingPlainTextValueWithSecretReferenceValueId/GetOmaSettingPlainTextValueWithSecretReferenceValueIdRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/Item/GetOmaSettingPlainTextValueWithSecretReferenceValueId/GetOmaSettingPlainTextValueWithSecretReferenceValueIdRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOmaSettingPlainTextValue"; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--secretreferencevalueid", description: "Usage: secretReferenceValueId={secretReferenceValueId}")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var secretReferenceValueIdOption = new Option("--secretreferencevalueid", description: "Usage: secretReferenceValueId={secretReferenceValueId}"); + secretReferenceValueIdOption.IsRequired = true; + command.AddOption(secretReferenceValueIdOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, secretReferenceValueId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - if (!String.IsNullOrEmpty(secretReferenceValueId)) requestInfo.PathParameters.Add("secretReferenceValueId", secretReferenceValueId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceConfigurations/Item/UserStatusOverview/UserStatusOverviewRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/Item/UserStatusOverview/UserStatusOverviewRequestBuilder.cs index ea8c31c0bcc..55af9f69b74 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/Item/UserStatusOverview/UserStatusOverviewRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/Item/UserStatusOverview/UserStatusOverviewRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device Configuration users status overview"; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device Configuration users status overview"; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceConfigurationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceConfigurationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device Configuration users status overview"; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--body")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceConfigurations/Item/UserStatuses/Item/DeviceConfigurationUserStatusRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/Item/UserStatuses/Item/DeviceConfigurationUserStatusRequestBuilder.cs index 6787d670af5..d6be6b4d6b8 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/Item/UserStatuses/Item/DeviceConfigurationUserStatusRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/Item/UserStatuses/Item/DeviceConfigurationUserStatusRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device configuration installation status by user."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--deviceconfigurationuserstatus-id", description: "key: id of deviceConfigurationUserStatus")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var deviceConfigurationUserStatusIdOption = new Option("--deviceconfigurationuserstatus-id", description: "key: id of deviceConfigurationUserStatus"); + deviceConfigurationUserStatusIdOption.IsRequired = true; + command.AddOption(deviceConfigurationUserStatusIdOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, deviceConfigurationUserStatusId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - if (!String.IsNullOrEmpty(deviceConfigurationUserStatusId)) requestInfo.PathParameters.Add("deviceConfigurationUserStatus_id", deviceConfigurationUserStatusId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device configuration installation status by user."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--deviceconfigurationuserstatus-id", description: "key: id of deviceConfigurationUserStatus")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceConfigurationId, deviceConfigurationUserStatusId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - if (!String.IsNullOrEmpty(deviceConfigurationUserStatusId)) requestInfo.PathParameters.Add("deviceConfigurationUserStatus_id", deviceConfigurationUserStatusId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var deviceConfigurationUserStatusIdOption = new Option("--deviceconfigurationuserstatus-id", description: "key: id of deviceConfigurationUserStatus"); + deviceConfigurationUserStatusIdOption.IsRequired = true; + command.AddOption(deviceConfigurationUserStatusIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceConfigurationId, deviceConfigurationUserStatusId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device configuration installation status by user."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--deviceconfigurationuserstatus-id", description: "key: id of deviceConfigurationUserStatus")); - command.AddOption(new Option("--body")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var deviceConfigurationUserStatusIdOption = new Option("--deviceconfigurationuserstatus-id", description: "key: id of deviceConfigurationUserStatus"); + deviceConfigurationUserStatusIdOption.IsRequired = true; + command.AddOption(deviceConfigurationUserStatusIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, deviceConfigurationUserStatusId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - if (!String.IsNullOrEmpty(deviceConfigurationUserStatusId)) requestInfo.PathParameters.Add("deviceConfigurationUserStatus_id", deviceConfigurationUserStatusId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceConfigurations/Item/UserStatuses/UserStatusesRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/Item/UserStatuses/UserStatusesRequestBuilder.cs index e31347e85d0..355ac3ad745 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/Item/UserStatuses/UserStatusesRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/Item/UserStatuses/UserStatusesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Device configuration installation status by user."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--body")); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Device configuration installation status by user."; // Create options for all the parameters - command.AddOption(new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceConfigurationId)) requestInfo.PathParameters.Add("deviceConfiguration_id", deviceConfigurationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceConfigurationIdOption = new Option("--deviceconfiguration-id", description: "key: id of deviceConfiguration"); + deviceConfigurationIdOption.IsRequired = true; + command.AddOption(deviceConfigurationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/DeviceEnrollmentConfigurationsRequestBuilder.cs b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/DeviceEnrollmentConfigurationsRequestBuilder.cs index b110895bb60..a49055c0eba 100644 --- a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/DeviceEnrollmentConfigurationsRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/DeviceEnrollmentConfigurationsRequestBuilder.cs @@ -39,12 +39,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of device enrollment configurations"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,24 +66,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of device enrollment configurations"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/Assign/AssignRequestBuilder.cs b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/Assign/AssignRequestBuilder.cs index 88de7f9c5e1..fa9ee8d587a 100644 --- a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/Assign/AssignRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration")); - command.AddOption(new Option("--body")); + var deviceEnrollmentConfigurationIdOption = new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration"); + deviceEnrollmentConfigurationIdOption.IsRequired = true; + command.AddOption(deviceEnrollmentConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceEnrollmentConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceEnrollmentConfigurationId)) requestInfo.PathParameters.Add("deviceEnrollmentConfiguration_id", deviceEnrollmentConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs index be87940fdc8..261e88ae6af 100644 --- a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/Assignments/AssignmentsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of group assignments for the device configuration profile"; // Create options for all the parameters - command.AddOption(new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration")); - command.AddOption(new Option("--body")); + var deviceEnrollmentConfigurationIdOption = new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration"); + deviceEnrollmentConfigurationIdOption.IsRequired = true; + command.AddOption(deviceEnrollmentConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceEnrollmentConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceEnrollmentConfigurationId)) requestInfo.PathParameters.Add("deviceEnrollmentConfiguration_id", deviceEnrollmentConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of group assignments for the device configuration profile"; // Create options for all the parameters - command.AddOption(new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceEnrollmentConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceEnrollmentConfigurationId)) requestInfo.PathParameters.Add("deviceEnrollmentConfiguration_id", deviceEnrollmentConfigurationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceEnrollmentConfigurationIdOption = new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration"); + deviceEnrollmentConfigurationIdOption.IsRequired = true; + command.AddOption(deviceEnrollmentConfigurationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceEnrollmentConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/Assignments/Item/EnrollmentConfigurationAssignmentRequestBuilder.cs b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/Assignments/Item/EnrollmentConfigurationAssignmentRequestBuilder.cs index 2e4c67f64c0..76466b4a3cb 100644 --- a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/Assignments/Item/EnrollmentConfigurationAssignmentRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/Assignments/Item/EnrollmentConfigurationAssignmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of group assignments for the device configuration profile"; // Create options for all the parameters - command.AddOption(new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration")); - command.AddOption(new Option("--enrollmentconfigurationassignment-id", description: "key: id of enrollmentConfigurationAssignment")); + var deviceEnrollmentConfigurationIdOption = new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration"); + deviceEnrollmentConfigurationIdOption.IsRequired = true; + command.AddOption(deviceEnrollmentConfigurationIdOption); + var enrollmentConfigurationAssignmentIdOption = new Option("--enrollmentconfigurationassignment-id", description: "key: id of enrollmentConfigurationAssignment"); + enrollmentConfigurationAssignmentIdOption.IsRequired = true; + command.AddOption(enrollmentConfigurationAssignmentIdOption); command.Handler = CommandHandler.Create(async (deviceEnrollmentConfigurationId, enrollmentConfigurationAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceEnrollmentConfigurationId)) requestInfo.PathParameters.Add("deviceEnrollmentConfiguration_id", deviceEnrollmentConfigurationId); - if (!String.IsNullOrEmpty(enrollmentConfigurationAssignmentId)) requestInfo.PathParameters.Add("enrollmentConfigurationAssignment_id", enrollmentConfigurationAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of group assignments for the device configuration profile"; // Create options for all the parameters - command.AddOption(new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration")); - command.AddOption(new Option("--enrollmentconfigurationassignment-id", description: "key: id of enrollmentConfigurationAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceEnrollmentConfigurationId, enrollmentConfigurationAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceEnrollmentConfigurationId)) requestInfo.PathParameters.Add("deviceEnrollmentConfiguration_id", deviceEnrollmentConfigurationId); - if (!String.IsNullOrEmpty(enrollmentConfigurationAssignmentId)) requestInfo.PathParameters.Add("enrollmentConfigurationAssignment_id", enrollmentConfigurationAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceEnrollmentConfigurationIdOption = new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration"); + deviceEnrollmentConfigurationIdOption.IsRequired = true; + command.AddOption(deviceEnrollmentConfigurationIdOption); + var enrollmentConfigurationAssignmentIdOption = new Option("--enrollmentconfigurationassignment-id", description: "key: id of enrollmentConfigurationAssignment"); + enrollmentConfigurationAssignmentIdOption.IsRequired = true; + command.AddOption(enrollmentConfigurationAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceEnrollmentConfigurationId, enrollmentConfigurationAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of group assignments for the device configuration profile"; // Create options for all the parameters - command.AddOption(new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration")); - command.AddOption(new Option("--enrollmentconfigurationassignment-id", description: "key: id of enrollmentConfigurationAssignment")); - command.AddOption(new Option("--body")); + var deviceEnrollmentConfigurationIdOption = new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration"); + deviceEnrollmentConfigurationIdOption.IsRequired = true; + command.AddOption(deviceEnrollmentConfigurationIdOption); + var enrollmentConfigurationAssignmentIdOption = new Option("--enrollmentconfigurationassignment-id", description: "key: id of enrollmentConfigurationAssignment"); + enrollmentConfigurationAssignmentIdOption.IsRequired = true; + command.AddOption(enrollmentConfigurationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceEnrollmentConfigurationId, enrollmentConfigurationAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceEnrollmentConfigurationId)) requestInfo.PathParameters.Add("deviceEnrollmentConfiguration_id", deviceEnrollmentConfigurationId); - if (!String.IsNullOrEmpty(enrollmentConfigurationAssignmentId)) requestInfo.PathParameters.Add("enrollmentConfigurationAssignment_id", enrollmentConfigurationAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/DeviceEnrollmentConfigurationRequestBuilder.cs b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/DeviceEnrollmentConfigurationRequestBuilder.cs index ee7f54d401e..f3a3ba1c495 100644 --- a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/DeviceEnrollmentConfigurationRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/DeviceEnrollmentConfigurationRequestBuilder.cs @@ -42,10 +42,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of device enrollment configurations"; // Create options for all the parameters - command.AddOption(new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration")); + var deviceEnrollmentConfigurationIdOption = new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration"); + deviceEnrollmentConfigurationIdOption.IsRequired = true; + command.AddOption(deviceEnrollmentConfigurationIdOption); command.Handler = CommandHandler.Create(async (deviceEnrollmentConfigurationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceEnrollmentConfigurationId)) requestInfo.PathParameters.Add("deviceEnrollmentConfiguration_id", deviceEnrollmentConfigurationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,14 +61,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of device enrollment configurations"; // Create options for all the parameters - command.AddOption(new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceEnrollmentConfigurationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceEnrollmentConfigurationId)) requestInfo.PathParameters.Add("deviceEnrollmentConfiguration_id", deviceEnrollmentConfigurationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceEnrollmentConfigurationIdOption = new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration"); + deviceEnrollmentConfigurationIdOption.IsRequired = true; + command.AddOption(deviceEnrollmentConfigurationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceEnrollmentConfigurationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,14 +95,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of device enrollment configurations"; // Create options for all the parameters - command.AddOption(new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration")); - command.AddOption(new Option("--body")); + var deviceEnrollmentConfigurationIdOption = new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration"); + deviceEnrollmentConfigurationIdOption.IsRequired = true; + command.AddOption(deviceEnrollmentConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceEnrollmentConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceEnrollmentConfigurationId)) requestInfo.PathParameters.Add("deviceEnrollmentConfiguration_id", deviceEnrollmentConfigurationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/SetPriority/SetPriorityRequestBuilder.cs b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/SetPriority/SetPriorityRequestBuilder.cs index 2c9244df7c4..ad31fd53758 100644 --- a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/SetPriority/SetPriorityRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/SetPriority/SetPriorityRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setPriority"; // Create options for all the parameters - command.AddOption(new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration")); - command.AddOption(new Option("--body")); + var deviceEnrollmentConfigurationIdOption = new Option("--deviceenrollmentconfiguration-id", description: "key: id of deviceEnrollmentConfiguration"); + deviceEnrollmentConfigurationIdOption.IsRequired = true; + command.AddOption(deviceEnrollmentConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceEnrollmentConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceEnrollmentConfigurationId)) requestInfo.PathParameters.Add("deviceEnrollmentConfiguration_id", deviceEnrollmentConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceManagementPartners/DeviceManagementPartnersRequestBuilder.cs b/src/generated/DeviceManagement/DeviceManagementPartners/DeviceManagementPartnersRequestBuilder.cs index acd134a64bc..1e98a5182e6 100644 --- a/src/generated/DeviceManagement/DeviceManagementPartners/DeviceManagementPartnersRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceManagementPartners/DeviceManagementPartnersRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of Device Management Partners configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of Device Management Partners configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/DeviceManagementPartners/Item/DeviceManagementPartnerRequestBuilder.cs b/src/generated/DeviceManagement/DeviceManagementPartners/Item/DeviceManagementPartnerRequestBuilder.cs index e80969d4561..b539da00707 100644 --- a/src/generated/DeviceManagement/DeviceManagementPartners/Item/DeviceManagementPartnerRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceManagementPartners/Item/DeviceManagementPartnerRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of Device Management Partners configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementpartner-id", description: "key: id of deviceManagementPartner")); + var deviceManagementPartnerIdOption = new Option("--devicemanagementpartner-id", description: "key: id of deviceManagementPartner"); + deviceManagementPartnerIdOption.IsRequired = true; + command.AddOption(deviceManagementPartnerIdOption); command.Handler = CommandHandler.Create(async (deviceManagementPartnerId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceManagementPartnerId)) requestInfo.PathParameters.Add("deviceManagementPartner_id", deviceManagementPartnerId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of Device Management Partners configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementpartner-id", description: "key: id of deviceManagementPartner")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceManagementPartnerId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceManagementPartnerId)) requestInfo.PathParameters.Add("deviceManagementPartner_id", deviceManagementPartnerId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceManagementPartnerIdOption = new Option("--devicemanagementpartner-id", description: "key: id of deviceManagementPartner"); + deviceManagementPartnerIdOption.IsRequired = true; + command.AddOption(deviceManagementPartnerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceManagementPartnerId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of Device Management Partners configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementpartner-id", description: "key: id of deviceManagementPartner")); - command.AddOption(new Option("--body")); + var deviceManagementPartnerIdOption = new Option("--devicemanagementpartner-id", description: "key: id of deviceManagementPartner"); + deviceManagementPartnerIdOption.IsRequired = true; + command.AddOption(deviceManagementPartnerIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceManagementPartnerId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceManagementPartnerId)) requestInfo.PathParameters.Add("deviceManagementPartner_id", deviceManagementPartnerId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/DeviceManagementRequestBuilder.cs b/src/generated/DeviceManagement/DeviceManagementRequestBuilder.cs index 8631ecfae81..0cdef02e5ce 100644 --- a/src/generated/DeviceManagement/DeviceManagementRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceManagementRequestBuilder.cs @@ -154,12 +154,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get deviceManagement"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -221,12 +228,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update deviceManagement"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ExchangeConnectors/ExchangeConnectorsRequestBuilder.cs b/src/generated/DeviceManagement/ExchangeConnectors/ExchangeConnectorsRequestBuilder.cs index b48440c3b09..2e84ea9c212 100644 --- a/src/generated/DeviceManagement/ExchangeConnectors/ExchangeConnectorsRequestBuilder.cs +++ b/src/generated/DeviceManagement/ExchangeConnectors/ExchangeConnectorsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of Exchange Connectors configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of Exchange Connectors configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/ExchangeConnectors/Item/DeviceManagementExchangeConnectorRequestBuilder.cs b/src/generated/DeviceManagement/ExchangeConnectors/Item/DeviceManagementExchangeConnectorRequestBuilder.cs index 2f13cdd7961..d2fbb65b02e 100644 --- a/src/generated/DeviceManagement/ExchangeConnectors/Item/DeviceManagementExchangeConnectorRequestBuilder.cs +++ b/src/generated/DeviceManagement/ExchangeConnectors/Item/DeviceManagementExchangeConnectorRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of Exchange Connectors configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementexchangeconnector-id", description: "key: id of deviceManagementExchangeConnector")); + var deviceManagementExchangeConnectorIdOption = new Option("--devicemanagementexchangeconnector-id", description: "key: id of deviceManagementExchangeConnector"); + deviceManagementExchangeConnectorIdOption.IsRequired = true; + command.AddOption(deviceManagementExchangeConnectorIdOption); command.Handler = CommandHandler.Create(async (deviceManagementExchangeConnectorId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceManagementExchangeConnectorId)) requestInfo.PathParameters.Add("deviceManagementExchangeConnector_id", deviceManagementExchangeConnectorId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of Exchange Connectors configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementexchangeconnector-id", description: "key: id of deviceManagementExchangeConnector")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceManagementExchangeConnectorId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceManagementExchangeConnectorId)) requestInfo.PathParameters.Add("deviceManagementExchangeConnector_id", deviceManagementExchangeConnectorId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceManagementExchangeConnectorIdOption = new Option("--devicemanagementexchangeconnector-id", description: "key: id of deviceManagementExchangeConnector"); + deviceManagementExchangeConnectorIdOption.IsRequired = true; + command.AddOption(deviceManagementExchangeConnectorIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceManagementExchangeConnectorId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,14 +80,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of Exchange Connectors configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementexchangeconnector-id", description: "key: id of deviceManagementExchangeConnector")); - command.AddOption(new Option("--body")); + var deviceManagementExchangeConnectorIdOption = new Option("--devicemanagementexchangeconnector-id", description: "key: id of deviceManagementExchangeConnector"); + deviceManagementExchangeConnectorIdOption.IsRequired = true; + command.AddOption(deviceManagementExchangeConnectorIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceManagementExchangeConnectorId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceManagementExchangeConnectorId)) requestInfo.PathParameters.Add("deviceManagementExchangeConnector_id", deviceManagementExchangeConnectorId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ExchangeConnectors/Item/Sync/SyncRequestBuilder.cs b/src/generated/DeviceManagement/ExchangeConnectors/Item/Sync/SyncRequestBuilder.cs index b0d96aeb037..71ecafca639 100644 --- a/src/generated/DeviceManagement/ExchangeConnectors/Item/Sync/SyncRequestBuilder.cs +++ b/src/generated/DeviceManagement/ExchangeConnectors/Item/Sync/SyncRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sync"; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementexchangeconnector-id", description: "key: id of deviceManagementExchangeConnector")); - command.AddOption(new Option("--body")); + var deviceManagementExchangeConnectorIdOption = new Option("--devicemanagementexchangeconnector-id", description: "key: id of deviceManagementExchangeConnector"); + deviceManagementExchangeConnectorIdOption.IsRequired = true; + command.AddOption(deviceManagementExchangeConnectorIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceManagementExchangeConnectorId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceManagementExchangeConnectorId)) requestInfo.PathParameters.Add("deviceManagementExchangeConnector_id", deviceManagementExchangeConnectorId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/GetEffectivePermissionsWithScope/GetEffectivePermissionsWithScopeRequestBuilder.cs b/src/generated/DeviceManagement/GetEffectivePermissionsWithScope/GetEffectivePermissionsWithScopeRequestBuilder.cs index c2460a36c83..b298d489e4a 100644 --- a/src/generated/DeviceManagement/GetEffectivePermissionsWithScope/GetEffectivePermissionsWithScopeRequestBuilder.cs +++ b/src/generated/DeviceManagement/GetEffectivePermissionsWithScope/GetEffectivePermissionsWithScopeRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Retrieves the effective permissions of the currently authenticated user"; // Create options for all the parameters - command.AddOption(new Option("--scope", description: "Usage: scope={scope}")); + var scopeOption = new Option("--scope", description: "Usage: scope={scope}"); + scopeOption.IsRequired = true; + command.AddOption(scopeOption); command.Handler = CommandHandler.Create(async (scope) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(scope)) requestInfo.PathParameters.Add("scope", scope); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/ImportedWindowsAutopilotDeviceIdentities/Import/ImportRequestBuilder.cs b/src/generated/DeviceManagement/ImportedWindowsAutopilotDeviceIdentities/Import/ImportRequestBuilder.cs index 38ddc5fe692..423bd67b99b 100644 --- a/src/generated/DeviceManagement/ImportedWindowsAutopilotDeviceIdentities/Import/ImportRequestBuilder.cs +++ b/src/generated/DeviceManagement/ImportedWindowsAutopilotDeviceIdentities/Import/ImportRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action import"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/ImportedWindowsAutopilotDeviceIdentities/ImportedWindowsAutopilotDeviceIdentitiesRequestBuilder.cs b/src/generated/DeviceManagement/ImportedWindowsAutopilotDeviceIdentities/ImportedWindowsAutopilotDeviceIdentitiesRequestBuilder.cs index f281fdf450d..e60bd0c0c24 100644 --- a/src/generated/DeviceManagement/ImportedWindowsAutopilotDeviceIdentities/ImportedWindowsAutopilotDeviceIdentitiesRequestBuilder.cs +++ b/src/generated/DeviceManagement/ImportedWindowsAutopilotDeviceIdentities/ImportedWindowsAutopilotDeviceIdentitiesRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of imported Windows autopilot devices."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,24 +70,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of imported Windows autopilot devices."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/ImportedWindowsAutopilotDeviceIdentities/Item/ImportedWindowsAutopilotDeviceIdentityRequestBuilder.cs b/src/generated/DeviceManagement/ImportedWindowsAutopilotDeviceIdentities/Item/ImportedWindowsAutopilotDeviceIdentityRequestBuilder.cs index ab38105eb81..0c6c498117f 100644 --- a/src/generated/DeviceManagement/ImportedWindowsAutopilotDeviceIdentities/Item/ImportedWindowsAutopilotDeviceIdentityRequestBuilder.cs +++ b/src/generated/DeviceManagement/ImportedWindowsAutopilotDeviceIdentities/Item/ImportedWindowsAutopilotDeviceIdentityRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of imported Windows autopilot devices."; // Create options for all the parameters - command.AddOption(new Option("--importedwindowsautopilotdeviceidentity-id", description: "key: id of importedWindowsAutopilotDeviceIdentity")); + var importedWindowsAutopilotDeviceIdentityIdOption = new Option("--importedwindowsautopilotdeviceidentity-id", description: "key: id of importedWindowsAutopilotDeviceIdentity"); + importedWindowsAutopilotDeviceIdentityIdOption.IsRequired = true; + command.AddOption(importedWindowsAutopilotDeviceIdentityIdOption); command.Handler = CommandHandler.Create(async (importedWindowsAutopilotDeviceIdentityId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(importedWindowsAutopilotDeviceIdentityId)) requestInfo.PathParameters.Add("importedWindowsAutopilotDeviceIdentity_id", importedWindowsAutopilotDeviceIdentityId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of imported Windows autopilot devices."; // Create options for all the parameters - command.AddOption(new Option("--importedwindowsautopilotdeviceidentity-id", description: "key: id of importedWindowsAutopilotDeviceIdentity")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (importedWindowsAutopilotDeviceIdentityId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(importedWindowsAutopilotDeviceIdentityId)) requestInfo.PathParameters.Add("importedWindowsAutopilotDeviceIdentity_id", importedWindowsAutopilotDeviceIdentityId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var importedWindowsAutopilotDeviceIdentityIdOption = new Option("--importedwindowsautopilotdeviceidentity-id", description: "key: id of importedWindowsAutopilotDeviceIdentity"); + importedWindowsAutopilotDeviceIdentityIdOption.IsRequired = true; + command.AddOption(importedWindowsAutopilotDeviceIdentityIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (importedWindowsAutopilotDeviceIdentityId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of imported Windows autopilot devices."; // Create options for all the parameters - command.AddOption(new Option("--importedwindowsautopilotdeviceidentity-id", description: "key: id of importedWindowsAutopilotDeviceIdentity")); - command.AddOption(new Option("--body")); + var importedWindowsAutopilotDeviceIdentityIdOption = new Option("--importedwindowsautopilotdeviceidentity-id", description: "key: id of importedWindowsAutopilotDeviceIdentity"); + importedWindowsAutopilotDeviceIdentityIdOption.IsRequired = true; + command.AddOption(importedWindowsAutopilotDeviceIdentityIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (importedWindowsAutopilotDeviceIdentityId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(importedWindowsAutopilotDeviceIdentityId)) requestInfo.PathParameters.Add("importedWindowsAutopilotDeviceIdentity_id", importedWindowsAutopilotDeviceIdentityId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/IosUpdateStatuses/IosUpdateStatusesRequestBuilder.cs b/src/generated/DeviceManagement/IosUpdateStatuses/IosUpdateStatusesRequestBuilder.cs index c43ed12abff..19d55b7cb5d 100644 --- a/src/generated/DeviceManagement/IosUpdateStatuses/IosUpdateStatusesRequestBuilder.cs +++ b/src/generated/DeviceManagement/IosUpdateStatuses/IosUpdateStatusesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The IOS software update installation statuses for this account."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The IOS software update installation statuses for this account."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/IosUpdateStatuses/Item/IosUpdateDeviceStatusRequestBuilder.cs b/src/generated/DeviceManagement/IosUpdateStatuses/Item/IosUpdateDeviceStatusRequestBuilder.cs index dc942683200..7d5f5e67d85 100644 --- a/src/generated/DeviceManagement/IosUpdateStatuses/Item/IosUpdateDeviceStatusRequestBuilder.cs +++ b/src/generated/DeviceManagement/IosUpdateStatuses/Item/IosUpdateDeviceStatusRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The IOS software update installation statuses for this account."; // Create options for all the parameters - command.AddOption(new Option("--iosupdatedevicestatus-id", description: "key: id of iosUpdateDeviceStatus")); + var iosUpdateDeviceStatusIdOption = new Option("--iosupdatedevicestatus-id", description: "key: id of iosUpdateDeviceStatus"); + iosUpdateDeviceStatusIdOption.IsRequired = true; + command.AddOption(iosUpdateDeviceStatusIdOption); command.Handler = CommandHandler.Create(async (iosUpdateDeviceStatusId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(iosUpdateDeviceStatusId)) requestInfo.PathParameters.Add("iosUpdateDeviceStatus_id", iosUpdateDeviceStatusId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The IOS software update installation statuses for this account."; // Create options for all the parameters - command.AddOption(new Option("--iosupdatedevicestatus-id", description: "key: id of iosUpdateDeviceStatus")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (iosUpdateDeviceStatusId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(iosUpdateDeviceStatusId)) requestInfo.PathParameters.Add("iosUpdateDeviceStatus_id", iosUpdateDeviceStatusId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var iosUpdateDeviceStatusIdOption = new Option("--iosupdatedevicestatus-id", description: "key: id of iosUpdateDeviceStatus"); + iosUpdateDeviceStatusIdOption.IsRequired = true; + command.AddOption(iosUpdateDeviceStatusIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (iosUpdateDeviceStatusId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The IOS software update installation statuses for this account."; // Create options for all the parameters - command.AddOption(new Option("--iosupdatedevicestatus-id", description: "key: id of iosUpdateDeviceStatus")); - command.AddOption(new Option("--body")); + var iosUpdateDeviceStatusIdOption = new Option("--iosupdatedevicestatus-id", description: "key: id of iosUpdateDeviceStatus"); + iosUpdateDeviceStatusIdOption.IsRequired = true; + command.AddOption(iosUpdateDeviceStatusIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (iosUpdateDeviceStatusId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(iosUpdateDeviceStatusId)) requestInfo.PathParameters.Add("iosUpdateDeviceStatus_id", iosUpdateDeviceStatusId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDeviceOverview/@Ref/RefRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDeviceOverview/@Ref/RefRequestBuilder.cs index d5b36d2ef3f..fb57fec7cb5 100644 --- a/src/generated/DeviceManagement/ManagedDeviceOverview/@Ref/RefRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDeviceOverview/@Ref/RefRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildDeleteCommand() { command.Description = "Device overview"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,7 +42,8 @@ public Command BuildGetCommand() { command.Description = "Device overview"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,12 +62,15 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Device overview"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDeviceOverview/ManagedDeviceOverviewRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDeviceOverview/ManagedDeviceOverviewRequestBuilder.cs index 865ff118c9a..6773a0443d1 100644 --- a/src/generated/DeviceManagement/ManagedDeviceOverview/ManagedDeviceOverviewRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDeviceOverview/ManagedDeviceOverviewRequestBuilder.cs @@ -27,12 +27,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device overview"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/BypassActivationLock/BypassActivationLockRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/BypassActivationLock/BypassActivationLockRequestBuilder.cs index 7df8976297f..8066c813057 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/BypassActivationLock/BypassActivationLockRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/BypassActivationLock/BypassActivationLockRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Bypass activation lock"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/CleanWindowsDevice/CleanWindowsDeviceRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/CleanWindowsDevice/CleanWindowsDeviceRequestBuilder.cs index 10162c73fe5..edaafc9a999 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/CleanWindowsDevice/CleanWindowsDeviceRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/CleanWindowsDevice/CleanWindowsDeviceRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Clean Windows device"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/DeleteUserFromSharedAppleDevice/DeleteUserFromSharedAppleDeviceRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/DeleteUserFromSharedAppleDevice/DeleteUserFromSharedAppleDeviceRequestBuilder.cs index e33dd9e2773..398d3c4a770 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/DeleteUserFromSharedAppleDevice/DeleteUserFromSharedAppleDeviceRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/DeleteUserFromSharedAppleDevice/DeleteUserFromSharedAppleDeviceRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Delete user from shared Apple device"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/DeviceCategory/DeviceCategoryRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/DeviceCategory/DeviceCategoryRequestBuilder.cs index 23f7d2979a2..50a9f586e53 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/DeviceCategory/DeviceCategoryRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/DeviceCategory/DeviceCategoryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device category"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device category"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device category"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/DeviceCompliancePolicyStates/DeviceCompliancePolicyStatesRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/DeviceCompliancePolicyStates/DeviceCompliancePolicyStatesRequestBuilder.cs index 3f771d130d5..1f945a464bc 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/DeviceCompliancePolicyStates/DeviceCompliancePolicyStatesRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/DeviceCompliancePolicyStates/DeviceCompliancePolicyStatesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/DeviceCompliancePolicyStates/Item/DeviceCompliancePolicyStateRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/DeviceCompliancePolicyStates/Item/DeviceCompliancePolicyStateRequestBuilder.cs index 63f52957738..9c3d9fafcac 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/DeviceCompliancePolicyStates/Item/DeviceCompliancePolicyStateRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/DeviceCompliancePolicyStates/Item/DeviceCompliancePolicyStateRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceCompliancePolicyStateIdOption = new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState"); + deviceCompliancePolicyStateIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyStateIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId, deviceCompliancePolicyStateId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceCompliancePolicyStateId)) requestInfo.PathParameters.Add("deviceCompliancePolicyState_id", deviceCompliancePolicyStateId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceId, deviceCompliancePolicyStateId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceCompliancePolicyStateId)) requestInfo.PathParameters.Add("deviceCompliancePolicyState_id", deviceCompliancePolicyStateId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceCompliancePolicyStateIdOption = new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState"); + deviceCompliancePolicyStateIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyStateIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceId, deviceCompliancePolicyStateId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceCompliancePolicyStateIdOption = new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState"); + deviceCompliancePolicyStateIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyStateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, deviceCompliancePolicyStateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceCompliancePolicyStateId)) requestInfo.PathParameters.Add("deviceCompliancePolicyState_id", deviceCompliancePolicyStateId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/DeviceConfigurationStates/DeviceConfigurationStatesRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/DeviceConfigurationStates/DeviceConfigurationStatesRequestBuilder.cs index 997c629bd79..c3929c4d76e 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/DeviceConfigurationStates/DeviceConfigurationStatesRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/DeviceConfigurationStates/DeviceConfigurationStatesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/DeviceConfigurationStates/Item/DeviceConfigurationStateRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/DeviceConfigurationStates/Item/DeviceConfigurationStateRequestBuilder.cs index 4fb38a5c1d6..d98ead045ad 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/DeviceConfigurationStates/Item/DeviceConfigurationStateRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/DeviceConfigurationStates/Item/DeviceConfigurationStateRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceConfigurationStateIdOption = new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState"); + deviceConfigurationStateIdOption.IsRequired = true; + command.AddOption(deviceConfigurationStateIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId, deviceConfigurationStateId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceConfigurationStateId)) requestInfo.PathParameters.Add("deviceConfigurationState_id", deviceConfigurationStateId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceId, deviceConfigurationStateId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceConfigurationStateId)) requestInfo.PathParameters.Add("deviceConfigurationState_id", deviceConfigurationStateId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceConfigurationStateIdOption = new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState"); + deviceConfigurationStateIdOption.IsRequired = true; + command.AddOption(deviceConfigurationStateIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceId, deviceConfigurationStateId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceConfigurationStateIdOption = new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState"); + deviceConfigurationStateIdOption.IsRequired = true; + command.AddOption(deviceConfigurationStateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, deviceConfigurationStateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceConfigurationStateId)) requestInfo.PathParameters.Add("deviceConfigurationState_id", deviceConfigurationStateId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/DisableLostMode/DisableLostModeRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/DisableLostMode/DisableLostModeRequestBuilder.cs index 44243078825..a14813baf65 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/DisableLostMode/DisableLostModeRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/DisableLostMode/DisableLostModeRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Disable lost mode"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/LocateDevice/LocateDeviceRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/LocateDevice/LocateDeviceRequestBuilder.cs index 7f638beccc6..f649ca41bde 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/LocateDevice/LocateDeviceRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/LocateDevice/LocateDeviceRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Locate a device"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/LogoutSharedAppleDeviceActiveUser/LogoutSharedAppleDeviceActiveUserRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/LogoutSharedAppleDeviceActiveUser/LogoutSharedAppleDeviceActiveUserRequestBuilder.cs index 83ceda42be9..44b0f5fedd1 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/LogoutSharedAppleDeviceActiveUser/LogoutSharedAppleDeviceActiveUserRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/LogoutSharedAppleDeviceActiveUser/LogoutSharedAppleDeviceActiveUserRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Logout shared Apple device active user"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/ManagedDeviceRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/ManagedDeviceRequestBuilder.cs index 8d923edad19..9ba296a8c5d 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/ManagedDeviceRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/ManagedDeviceRequestBuilder.cs @@ -59,10 +59,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of managed devices."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -110,14 +112,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of managed devices."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -148,14 +158,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of managed devices."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/RebootNow/RebootNowRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/RebootNow/RebootNowRequestBuilder.cs index 2247ba78929..2b38d3a950a 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/RebootNow/RebootNowRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/RebootNow/RebootNowRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Reboot device"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/RecoverPasscode/RecoverPasscodeRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/RecoverPasscode/RecoverPasscodeRequestBuilder.cs index 788af52e8ec..1594a2c44fb 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/RecoverPasscode/RecoverPasscodeRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/RecoverPasscode/RecoverPasscodeRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Recover passcode"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/RemoteLock/RemoteLockRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/RemoteLock/RemoteLockRequestBuilder.cs index 0161a6dcf5e..778618b7c6b 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/RemoteLock/RemoteLockRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/RemoteLock/RemoteLockRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Remote lock"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/RequestRemoteAssistance/RequestRemoteAssistanceRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/RequestRemoteAssistance/RequestRemoteAssistanceRequestBuilder.cs index 4fb6605add5..fe937076f69 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/RequestRemoteAssistance/RequestRemoteAssistanceRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/RequestRemoteAssistance/RequestRemoteAssistanceRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Request remote assistance"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/ResetPasscode/ResetPasscodeRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/ResetPasscode/ResetPasscodeRequestBuilder.cs index 2e3cd305f5b..1bc1dcce0a5 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/ResetPasscode/ResetPasscodeRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/ResetPasscode/ResetPasscodeRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Reset passcode"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/Retire/RetireRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/Retire/RetireRequestBuilder.cs index a91e44fcbf0..2962e198558 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/Retire/RetireRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/Retire/RetireRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Retire a device"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/ShutDown/ShutDownRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/ShutDown/ShutDownRequestBuilder.cs index 03380519475..8176719a5ac 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/ShutDown/ShutDownRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/ShutDown/ShutDownRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Shut down device"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/SyncDevice/SyncDeviceRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/SyncDevice/SyncDeviceRequestBuilder.cs index 54e718bd9b1..634c39b68cf 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/SyncDevice/SyncDeviceRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/SyncDevice/SyncDeviceRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action syncDevice"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/UpdateWindowsDeviceAccount/UpdateWindowsDeviceAccountRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/UpdateWindowsDeviceAccount/UpdateWindowsDeviceAccountRequestBuilder.cs index f7d57582ef6..0c63fa62b82 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/UpdateWindowsDeviceAccount/UpdateWindowsDeviceAccountRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/UpdateWindowsDeviceAccount/UpdateWindowsDeviceAccountRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action updateWindowsDeviceAccount"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/WindowsDefenderScan/WindowsDefenderScanRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/WindowsDefenderScan/WindowsDefenderScanRequestBuilder.cs index afc627954dc..2c560d9e477 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/WindowsDefenderScan/WindowsDefenderScanRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/WindowsDefenderScan/WindowsDefenderScanRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action windowsDefenderScan"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/WindowsDefenderUpdateSignatures/WindowsDefenderUpdateSignaturesRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/WindowsDefenderUpdateSignatures/WindowsDefenderUpdateSignaturesRequestBuilder.cs index 0dea920d592..e94da053111 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/WindowsDefenderUpdateSignatures/WindowsDefenderUpdateSignaturesRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/WindowsDefenderUpdateSignatures/WindowsDefenderUpdateSignaturesRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action windowsDefenderUpdateSignatures"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/Item/Wipe/WipeRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/Item/Wipe/WipeRequestBuilder.cs index 51762b103f5..9b102fbfb5b 100644 --- a/src/generated/DeviceManagement/ManagedDevices/Item/Wipe/WipeRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/Item/Wipe/WipeRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Wipe a device"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ManagedDevices/ManagedDevicesRequestBuilder.cs b/src/generated/DeviceManagement/ManagedDevices/ManagedDevicesRequestBuilder.cs index a080c81dae8..ed2d150e227 100644 --- a/src/generated/DeviceManagement/ManagedDevices/ManagedDevicesRequestBuilder.cs +++ b/src/generated/DeviceManagement/ManagedDevices/ManagedDevicesRequestBuilder.cs @@ -57,12 +57,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of managed devices."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,24 +84,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of managed devices."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/MobileThreatDefenseConnectors/Item/MobileThreatDefenseConnectorRequestBuilder.cs b/src/generated/DeviceManagement/MobileThreatDefenseConnectors/Item/MobileThreatDefenseConnectorRequestBuilder.cs index 58192574110..049d1548c30 100644 --- a/src/generated/DeviceManagement/MobileThreatDefenseConnectors/Item/MobileThreatDefenseConnectorRequestBuilder.cs +++ b/src/generated/DeviceManagement/MobileThreatDefenseConnectors/Item/MobileThreatDefenseConnectorRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of Mobile threat Defense connectors configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--mobilethreatdefenseconnector-id", description: "key: id of mobileThreatDefenseConnector")); + var mobileThreatDefenseConnectorIdOption = new Option("--mobilethreatdefenseconnector-id", description: "key: id of mobileThreatDefenseConnector"); + mobileThreatDefenseConnectorIdOption.IsRequired = true; + command.AddOption(mobileThreatDefenseConnectorIdOption); command.Handler = CommandHandler.Create(async (mobileThreatDefenseConnectorId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mobileThreatDefenseConnectorId)) requestInfo.PathParameters.Add("mobileThreatDefenseConnector_id", mobileThreatDefenseConnectorId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of Mobile threat Defense connectors configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--mobilethreatdefenseconnector-id", description: "key: id of mobileThreatDefenseConnector")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mobileThreatDefenseConnectorId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mobileThreatDefenseConnectorId)) requestInfo.PathParameters.Add("mobileThreatDefenseConnector_id", mobileThreatDefenseConnectorId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mobileThreatDefenseConnectorIdOption = new Option("--mobilethreatdefenseconnector-id", description: "key: id of mobileThreatDefenseConnector"); + mobileThreatDefenseConnectorIdOption.IsRequired = true; + command.AddOption(mobileThreatDefenseConnectorIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mobileThreatDefenseConnectorId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of Mobile threat Defense connectors configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--mobilethreatdefenseconnector-id", description: "key: id of mobileThreatDefenseConnector")); - command.AddOption(new Option("--body")); + var mobileThreatDefenseConnectorIdOption = new Option("--mobilethreatdefenseconnector-id", description: "key: id of mobileThreatDefenseConnector"); + mobileThreatDefenseConnectorIdOption.IsRequired = true; + command.AddOption(mobileThreatDefenseConnectorIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mobileThreatDefenseConnectorId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mobileThreatDefenseConnectorId)) requestInfo.PathParameters.Add("mobileThreatDefenseConnector_id", mobileThreatDefenseConnectorId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/MobileThreatDefenseConnectors/MobileThreatDefenseConnectorsRequestBuilder.cs b/src/generated/DeviceManagement/MobileThreatDefenseConnectors/MobileThreatDefenseConnectorsRequestBuilder.cs index 7de27564604..84c8b6087ea 100644 --- a/src/generated/DeviceManagement/MobileThreatDefenseConnectors/MobileThreatDefenseConnectorsRequestBuilder.cs +++ b/src/generated/DeviceManagement/MobileThreatDefenseConnectors/MobileThreatDefenseConnectorsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of Mobile threat Defense connectors configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of Mobile threat Defense connectors configured by the tenant."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/NotificationMessageTemplates/Item/LocalizedNotificationMessages/Item/LocalizedNotificationMessageRequestBuilder.cs b/src/generated/DeviceManagement/NotificationMessageTemplates/Item/LocalizedNotificationMessages/Item/LocalizedNotificationMessageRequestBuilder.cs index c3e0bf5ee87..6abd58d3e53 100644 --- a/src/generated/DeviceManagement/NotificationMessageTemplates/Item/LocalizedNotificationMessages/Item/LocalizedNotificationMessageRequestBuilder.cs +++ b/src/generated/DeviceManagement/NotificationMessageTemplates/Item/LocalizedNotificationMessages/Item/LocalizedNotificationMessageRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of localized messages for this Notification Message Template."; // Create options for all the parameters - command.AddOption(new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate")); - command.AddOption(new Option("--localizednotificationmessage-id", description: "key: id of localizedNotificationMessage")); + var notificationMessageTemplateIdOption = new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate"); + notificationMessageTemplateIdOption.IsRequired = true; + command.AddOption(notificationMessageTemplateIdOption); + var localizedNotificationMessageIdOption = new Option("--localizednotificationmessage-id", description: "key: id of localizedNotificationMessage"); + localizedNotificationMessageIdOption.IsRequired = true; + command.AddOption(localizedNotificationMessageIdOption); command.Handler = CommandHandler.Create(async (notificationMessageTemplateId, localizedNotificationMessageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notificationMessageTemplateId)) requestInfo.PathParameters.Add("notificationMessageTemplate_id", notificationMessageTemplateId); - if (!String.IsNullOrEmpty(localizedNotificationMessageId)) requestInfo.PathParameters.Add("localizedNotificationMessage_id", localizedNotificationMessageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of localized messages for this Notification Message Template."; // Create options for all the parameters - command.AddOption(new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate")); - command.AddOption(new Option("--localizednotificationmessage-id", description: "key: id of localizedNotificationMessage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notificationMessageTemplateId, localizedNotificationMessageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notificationMessageTemplateId)) requestInfo.PathParameters.Add("notificationMessageTemplate_id", notificationMessageTemplateId); - if (!String.IsNullOrEmpty(localizedNotificationMessageId)) requestInfo.PathParameters.Add("localizedNotificationMessage_id", localizedNotificationMessageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notificationMessageTemplateIdOption = new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate"); + notificationMessageTemplateIdOption.IsRequired = true; + command.AddOption(notificationMessageTemplateIdOption); + var localizedNotificationMessageIdOption = new Option("--localizednotificationmessage-id", description: "key: id of localizedNotificationMessage"); + localizedNotificationMessageIdOption.IsRequired = true; + command.AddOption(localizedNotificationMessageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notificationMessageTemplateId, localizedNotificationMessageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of localized messages for this Notification Message Template."; // Create options for all the parameters - command.AddOption(new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate")); - command.AddOption(new Option("--localizednotificationmessage-id", description: "key: id of localizedNotificationMessage")); - command.AddOption(new Option("--body")); + var notificationMessageTemplateIdOption = new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate"); + notificationMessageTemplateIdOption.IsRequired = true; + command.AddOption(notificationMessageTemplateIdOption); + var localizedNotificationMessageIdOption = new Option("--localizednotificationmessage-id", description: "key: id of localizedNotificationMessage"); + localizedNotificationMessageIdOption.IsRequired = true; + command.AddOption(localizedNotificationMessageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notificationMessageTemplateId, localizedNotificationMessageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notificationMessageTemplateId)) requestInfo.PathParameters.Add("notificationMessageTemplate_id", notificationMessageTemplateId); - if (!String.IsNullOrEmpty(localizedNotificationMessageId)) requestInfo.PathParameters.Add("localizedNotificationMessage_id", localizedNotificationMessageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/NotificationMessageTemplates/Item/LocalizedNotificationMessages/LocalizedNotificationMessagesRequestBuilder.cs b/src/generated/DeviceManagement/NotificationMessageTemplates/Item/LocalizedNotificationMessages/LocalizedNotificationMessagesRequestBuilder.cs index 204a960ed55..316d06ad6d5 100644 --- a/src/generated/DeviceManagement/NotificationMessageTemplates/Item/LocalizedNotificationMessages/LocalizedNotificationMessagesRequestBuilder.cs +++ b/src/generated/DeviceManagement/NotificationMessageTemplates/Item/LocalizedNotificationMessages/LocalizedNotificationMessagesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of localized messages for this Notification Message Template."; // Create options for all the parameters - command.AddOption(new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate")); - command.AddOption(new Option("--body")); + var notificationMessageTemplateIdOption = new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate"); + notificationMessageTemplateIdOption.IsRequired = true; + command.AddOption(notificationMessageTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notificationMessageTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notificationMessageTemplateId)) requestInfo.PathParameters.Add("notificationMessageTemplate_id", notificationMessageTemplateId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of localized messages for this Notification Message Template."; // Create options for all the parameters - command.AddOption(new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notificationMessageTemplateId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notificationMessageTemplateId)) requestInfo.PathParameters.Add("notificationMessageTemplate_id", notificationMessageTemplateId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notificationMessageTemplateIdOption = new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate"); + notificationMessageTemplateIdOption.IsRequired = true; + command.AddOption(notificationMessageTemplateIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notificationMessageTemplateId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/NotificationMessageTemplates/Item/NotificationMessageTemplateRequestBuilder.cs b/src/generated/DeviceManagement/NotificationMessageTemplates/Item/NotificationMessageTemplateRequestBuilder.cs index efbea6f2444..28f2696d94c 100644 --- a/src/generated/DeviceManagement/NotificationMessageTemplates/Item/NotificationMessageTemplateRequestBuilder.cs +++ b/src/generated/DeviceManagement/NotificationMessageTemplates/Item/NotificationMessageTemplateRequestBuilder.cs @@ -28,10 +28,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The Notification Message Templates."; // Create options for all the parameters - command.AddOption(new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate")); + var notificationMessageTemplateIdOption = new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate"); + notificationMessageTemplateIdOption.IsRequired = true; + command.AddOption(notificationMessageTemplateIdOption); command.Handler = CommandHandler.Create(async (notificationMessageTemplateId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notificationMessageTemplateId)) requestInfo.PathParameters.Add("notificationMessageTemplate_id", notificationMessageTemplateId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +47,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The Notification Message Templates."; // Create options for all the parameters - command.AddOption(new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notificationMessageTemplateId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notificationMessageTemplateId)) requestInfo.PathParameters.Add("notificationMessageTemplate_id", notificationMessageTemplateId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notificationMessageTemplateIdOption = new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate"); + notificationMessageTemplateIdOption.IsRequired = true; + command.AddOption(notificationMessageTemplateIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notificationMessageTemplateId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,14 +88,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The Notification Message Templates."; // Create options for all the parameters - command.AddOption(new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate")); - command.AddOption(new Option("--body")); + var notificationMessageTemplateIdOption = new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate"); + notificationMessageTemplateIdOption.IsRequired = true; + command.AddOption(notificationMessageTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notificationMessageTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notificationMessageTemplateId)) requestInfo.PathParameters.Add("notificationMessageTemplate_id", notificationMessageTemplateId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/NotificationMessageTemplates/Item/SendTestMessage/SendTestMessageRequestBuilder.cs b/src/generated/DeviceManagement/NotificationMessageTemplates/Item/SendTestMessage/SendTestMessageRequestBuilder.cs index 0390fe2c425..1fe705b343a 100644 --- a/src/generated/DeviceManagement/NotificationMessageTemplates/Item/SendTestMessage/SendTestMessageRequestBuilder.cs +++ b/src/generated/DeviceManagement/NotificationMessageTemplates/Item/SendTestMessage/SendTestMessageRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Sends test message using the specified notificationMessageTemplate in the default locale"; // Create options for all the parameters - command.AddOption(new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate")); + var notificationMessageTemplateIdOption = new Option("--notificationmessagetemplate-id", description: "key: id of notificationMessageTemplate"); + notificationMessageTemplateIdOption.IsRequired = true; + command.AddOption(notificationMessageTemplateIdOption); command.Handler = CommandHandler.Create(async (notificationMessageTemplateId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(notificationMessageTemplateId)) requestInfo.PathParameters.Add("notificationMessageTemplate_id", notificationMessageTemplateId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/NotificationMessageTemplates/NotificationMessageTemplatesRequestBuilder.cs b/src/generated/DeviceManagement/NotificationMessageTemplates/NotificationMessageTemplatesRequestBuilder.cs index 408a4c82afd..e323ce9bea3 100644 --- a/src/generated/DeviceManagement/NotificationMessageTemplates/NotificationMessageTemplatesRequestBuilder.cs +++ b/src/generated/DeviceManagement/NotificationMessageTemplates/NotificationMessageTemplatesRequestBuilder.cs @@ -38,12 +38,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The Notification Message Templates."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +65,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The Notification Message Templates."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/RemoteAssistancePartners/Item/BeginOnboarding/BeginOnboardingRequestBuilder.cs b/src/generated/DeviceManagement/RemoteAssistancePartners/Item/BeginOnboarding/BeginOnboardingRequestBuilder.cs index 7165891c5f6..12c7b488c33 100644 --- a/src/generated/DeviceManagement/RemoteAssistancePartners/Item/BeginOnboarding/BeginOnboardingRequestBuilder.cs +++ b/src/generated/DeviceManagement/RemoteAssistancePartners/Item/BeginOnboarding/BeginOnboardingRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "A request to start onboarding. Must be coupled with the appropriate TeamViewer account information"; // Create options for all the parameters - command.AddOption(new Option("--remoteassistancepartner-id", description: "key: id of remoteAssistancePartner")); + var remoteAssistancePartnerIdOption = new Option("--remoteassistancepartner-id", description: "key: id of remoteAssistancePartner"); + remoteAssistancePartnerIdOption.IsRequired = true; + command.AddOption(remoteAssistancePartnerIdOption); command.Handler = CommandHandler.Create(async (remoteAssistancePartnerId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(remoteAssistancePartnerId)) requestInfo.PathParameters.Add("remoteAssistancePartner_id", remoteAssistancePartnerId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/RemoteAssistancePartners/Item/Disconnect/DisconnectRequestBuilder.cs b/src/generated/DeviceManagement/RemoteAssistancePartners/Item/Disconnect/DisconnectRequestBuilder.cs index f48f145c798..d238e280013 100644 --- a/src/generated/DeviceManagement/RemoteAssistancePartners/Item/Disconnect/DisconnectRequestBuilder.cs +++ b/src/generated/DeviceManagement/RemoteAssistancePartners/Item/Disconnect/DisconnectRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "A request to remove the active TeamViewer connector"; // Create options for all the parameters - command.AddOption(new Option("--remoteassistancepartner-id", description: "key: id of remoteAssistancePartner")); + var remoteAssistancePartnerIdOption = new Option("--remoteassistancepartner-id", description: "key: id of remoteAssistancePartner"); + remoteAssistancePartnerIdOption.IsRequired = true; + command.AddOption(remoteAssistancePartnerIdOption); command.Handler = CommandHandler.Create(async (remoteAssistancePartnerId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(remoteAssistancePartnerId)) requestInfo.PathParameters.Add("remoteAssistancePartner_id", remoteAssistancePartnerId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/RemoteAssistancePartners/Item/RemoteAssistancePartnerRequestBuilder.cs b/src/generated/DeviceManagement/RemoteAssistancePartners/Item/RemoteAssistancePartnerRequestBuilder.cs index 64840ff96ba..3445c58158b 100644 --- a/src/generated/DeviceManagement/RemoteAssistancePartners/Item/RemoteAssistancePartnerRequestBuilder.cs +++ b/src/generated/DeviceManagement/RemoteAssistancePartners/Item/RemoteAssistancePartnerRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The remote assist partners."; // Create options for all the parameters - command.AddOption(new Option("--remoteassistancepartner-id", description: "key: id of remoteAssistancePartner")); + var remoteAssistancePartnerIdOption = new Option("--remoteassistancepartner-id", description: "key: id of remoteAssistancePartner"); + remoteAssistancePartnerIdOption.IsRequired = true; + command.AddOption(remoteAssistancePartnerIdOption); command.Handler = CommandHandler.Create(async (remoteAssistancePartnerId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(remoteAssistancePartnerId)) requestInfo.PathParameters.Add("remoteAssistancePartner_id", remoteAssistancePartnerId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,14 +59,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The remote assist partners."; // Create options for all the parameters - command.AddOption(new Option("--remoteassistancepartner-id", description: "key: id of remoteAssistancePartner")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (remoteAssistancePartnerId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(remoteAssistancePartnerId)) requestInfo.PathParameters.Add("remoteAssistancePartner_id", remoteAssistancePartnerId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var remoteAssistancePartnerIdOption = new Option("--remoteassistancepartner-id", description: "key: id of remoteAssistancePartner"); + remoteAssistancePartnerIdOption.IsRequired = true; + command.AddOption(remoteAssistancePartnerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (remoteAssistancePartnerId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,14 +93,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The remote assist partners."; // Create options for all the parameters - command.AddOption(new Option("--remoteassistancepartner-id", description: "key: id of remoteAssistancePartner")); - command.AddOption(new Option("--body")); + var remoteAssistancePartnerIdOption = new Option("--remoteassistancepartner-id", description: "key: id of remoteAssistancePartner"); + remoteAssistancePartnerIdOption.IsRequired = true; + command.AddOption(remoteAssistancePartnerIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (remoteAssistancePartnerId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(remoteAssistancePartnerId)) requestInfo.PathParameters.Add("remoteAssistancePartner_id", remoteAssistancePartnerId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/RemoteAssistancePartners/RemoteAssistancePartnersRequestBuilder.cs b/src/generated/DeviceManagement/RemoteAssistancePartners/RemoteAssistancePartnersRequestBuilder.cs index 4509164b58e..daf473aa2ad 100644 --- a/src/generated/DeviceManagement/RemoteAssistancePartners/RemoteAssistancePartnersRequestBuilder.cs +++ b/src/generated/DeviceManagement/RemoteAssistancePartners/RemoteAssistancePartnersRequestBuilder.cs @@ -38,12 +38,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The remote assist partners."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +65,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The remote assist partners."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/Reports/ExportJobs/ExportJobsRequestBuilder.cs b/src/generated/DeviceManagement/Reports/ExportJobs/ExportJobsRequestBuilder.cs index a1e0604c9e7..fdae0cd6920 100644 --- a/src/generated/DeviceManagement/Reports/ExportJobs/ExportJobsRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/ExportJobs/ExportJobsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Entity representing a job to export a report"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Entity representing a job to export a report"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/Reports/ExportJobs/Item/DeviceManagementExportJobRequestBuilder.cs b/src/generated/DeviceManagement/Reports/ExportJobs/Item/DeviceManagementExportJobRequestBuilder.cs index 046c8a1f976..75f153f13d5 100644 --- a/src/generated/DeviceManagement/Reports/ExportJobs/Item/DeviceManagementExportJobRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/ExportJobs/Item/DeviceManagementExportJobRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Entity representing a job to export a report"; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementexportjob-id", description: "key: id of deviceManagementExportJob")); + var deviceManagementExportJobIdOption = new Option("--devicemanagementexportjob-id", description: "key: id of deviceManagementExportJob"); + deviceManagementExportJobIdOption.IsRequired = true; + command.AddOption(deviceManagementExportJobIdOption); command.Handler = CommandHandler.Create(async (deviceManagementExportJobId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceManagementExportJobId)) requestInfo.PathParameters.Add("deviceManagementExportJob_id", deviceManagementExportJobId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Entity representing a job to export a report"; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementexportjob-id", description: "key: id of deviceManagementExportJob")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceManagementExportJobId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceManagementExportJobId)) requestInfo.PathParameters.Add("deviceManagementExportJob_id", deviceManagementExportJobId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceManagementExportJobIdOption = new Option("--devicemanagementexportjob-id", description: "key: id of deviceManagementExportJob"); + deviceManagementExportJobIdOption.IsRequired = true; + command.AddOption(deviceManagementExportJobIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceManagementExportJobId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Entity representing a job to export a report"; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementexportjob-id", description: "key: id of deviceManagementExportJob")); - command.AddOption(new Option("--body")); + var deviceManagementExportJobIdOption = new Option("--devicemanagementexportjob-id", description: "key: id of deviceManagementExportJob"); + deviceManagementExportJobIdOption.IsRequired = true; + command.AddOption(deviceManagementExportJobIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceManagementExportJobId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceManagementExportJobId)) requestInfo.PathParameters.Add("deviceManagementExportJob_id", deviceManagementExportJobId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/Reports/GetCachedReport/GetCachedReportRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetCachedReport/GetCachedReportRequestBuilder.cs index 7a79ca513af..1b8a384b30b 100644 --- a/src/generated/DeviceManagement/Reports/GetCachedReport/GetCachedReportRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetCachedReport/GetCachedReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getCachedReport"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetCompliancePolicyNonComplianceReport/GetCompliancePolicyNonComplianceReportRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetCompliancePolicyNonComplianceReport/GetCompliancePolicyNonComplianceReportRequestBuilder.cs index 2935fda0c97..3262a7bd291 100644 --- a/src/generated/DeviceManagement/Reports/GetCompliancePolicyNonComplianceReport/GetCompliancePolicyNonComplianceReportRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetCompliancePolicyNonComplianceReport/GetCompliancePolicyNonComplianceReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getCompliancePolicyNonComplianceReport"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetCompliancePolicyNonComplianceSummaryReport/GetCompliancePolicyNonComplianceSummaryReportRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetCompliancePolicyNonComplianceSummaryReport/GetCompliancePolicyNonComplianceSummaryReportRequestBuilder.cs index b56cd058ebe..09e5214503a 100644 --- a/src/generated/DeviceManagement/Reports/GetCompliancePolicyNonComplianceSummaryReport/GetCompliancePolicyNonComplianceSummaryReportRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetCompliancePolicyNonComplianceSummaryReport/GetCompliancePolicyNonComplianceSummaryReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getCompliancePolicyNonComplianceSummaryReport"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetComplianceSettingNonComplianceReport/GetComplianceSettingNonComplianceReportRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetComplianceSettingNonComplianceReport/GetComplianceSettingNonComplianceReportRequestBuilder.cs index 84d1b0b27c9..1d37be7f9b7 100644 --- a/src/generated/DeviceManagement/Reports/GetComplianceSettingNonComplianceReport/GetComplianceSettingNonComplianceReportRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetComplianceSettingNonComplianceReport/GetComplianceSettingNonComplianceReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getComplianceSettingNonComplianceReport"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetConfigurationPolicyNonComplianceReport/GetConfigurationPolicyNonComplianceReportRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetConfigurationPolicyNonComplianceReport/GetConfigurationPolicyNonComplianceReportRequestBuilder.cs index 4a31a60d4a8..6de24793d59 100644 --- a/src/generated/DeviceManagement/Reports/GetConfigurationPolicyNonComplianceReport/GetConfigurationPolicyNonComplianceReportRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetConfigurationPolicyNonComplianceReport/GetConfigurationPolicyNonComplianceReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getConfigurationPolicyNonComplianceReport"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetConfigurationPolicyNonComplianceSummaryReport/GetConfigurationPolicyNonComplianceSummaryReportRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetConfigurationPolicyNonComplianceSummaryReport/GetConfigurationPolicyNonComplianceSummaryReportRequestBuilder.cs index 90209ead1bc..e617cf59c1c 100644 --- a/src/generated/DeviceManagement/Reports/GetConfigurationPolicyNonComplianceSummaryReport/GetConfigurationPolicyNonComplianceSummaryReportRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetConfigurationPolicyNonComplianceSummaryReport/GetConfigurationPolicyNonComplianceSummaryReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getConfigurationPolicyNonComplianceSummaryReport"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetConfigurationSettingNonComplianceReport/GetConfigurationSettingNonComplianceReportRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetConfigurationSettingNonComplianceReport/GetConfigurationSettingNonComplianceReportRequestBuilder.cs index ae8a1125330..aeb117cf25f 100644 --- a/src/generated/DeviceManagement/Reports/GetConfigurationSettingNonComplianceReport/GetConfigurationSettingNonComplianceReportRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetConfigurationSettingNonComplianceReport/GetConfigurationSettingNonComplianceReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getConfigurationSettingNonComplianceReport"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetDeviceManagementIntentPerSettingContributingProfiles/GetDeviceManagementIntentPerSettingContributingProfilesRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetDeviceManagementIntentPerSettingContributingProfiles/GetDeviceManagementIntentPerSettingContributingProfilesRequestBuilder.cs index 60b7d95cea9..9c70aed92a2 100644 --- a/src/generated/DeviceManagement/Reports/GetDeviceManagementIntentPerSettingContributingProfiles/GetDeviceManagementIntentPerSettingContributingProfilesRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetDeviceManagementIntentPerSettingContributingProfiles/GetDeviceManagementIntentPerSettingContributingProfilesRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getDeviceManagementIntentPerSettingContributingProfiles"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetDeviceManagementIntentSettingsReport/GetDeviceManagementIntentSettingsReportRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetDeviceManagementIntentSettingsReport/GetDeviceManagementIntentSettingsReportRequestBuilder.cs index 01a3bdef12f..7bb27a55087 100644 --- a/src/generated/DeviceManagement/Reports/GetDeviceManagementIntentSettingsReport/GetDeviceManagementIntentSettingsReportRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetDeviceManagementIntentSettingsReport/GetDeviceManagementIntentSettingsReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getDeviceManagementIntentSettingsReport"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetDeviceNonComplianceReport/GetDeviceNonComplianceReportRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetDeviceNonComplianceReport/GetDeviceNonComplianceReportRequestBuilder.cs index fe916914ca1..7a7bcb03f4a 100644 --- a/src/generated/DeviceManagement/Reports/GetDeviceNonComplianceReport/GetDeviceNonComplianceReportRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetDeviceNonComplianceReport/GetDeviceNonComplianceReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getDeviceNonComplianceReport"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetHistoricalReport/GetHistoricalReportRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetHistoricalReport/GetHistoricalReportRequestBuilder.cs index 640c4b37d16..c7a25cfb20c 100644 --- a/src/generated/DeviceManagement/Reports/GetHistoricalReport/GetHistoricalReportRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetHistoricalReport/GetHistoricalReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getHistoricalReport"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetPolicyNonComplianceMetadata/GetPolicyNonComplianceMetadataRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetPolicyNonComplianceMetadata/GetPolicyNonComplianceMetadataRequestBuilder.cs index 4adc0012f27..ddd1c7f8ce3 100644 --- a/src/generated/DeviceManagement/Reports/GetPolicyNonComplianceMetadata/GetPolicyNonComplianceMetadataRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetPolicyNonComplianceMetadata/GetPolicyNonComplianceMetadataRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getPolicyNonComplianceMetadata"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetPolicyNonComplianceReport/GetPolicyNonComplianceReportRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetPolicyNonComplianceReport/GetPolicyNonComplianceReportRequestBuilder.cs index 84a813233f4..343daf49983 100644 --- a/src/generated/DeviceManagement/Reports/GetPolicyNonComplianceReport/GetPolicyNonComplianceReportRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetPolicyNonComplianceReport/GetPolicyNonComplianceReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getPolicyNonComplianceReport"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetPolicyNonComplianceSummaryReport/GetPolicyNonComplianceSummaryReportRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetPolicyNonComplianceSummaryReport/GetPolicyNonComplianceSummaryReportRequestBuilder.cs index 05454d370ef..74e8e07a6fd 100644 --- a/src/generated/DeviceManagement/Reports/GetPolicyNonComplianceSummaryReport/GetPolicyNonComplianceSummaryReportRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetPolicyNonComplianceSummaryReport/GetPolicyNonComplianceSummaryReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getPolicyNonComplianceSummaryReport"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetReportFilters/GetReportFiltersRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetReportFilters/GetReportFiltersRequestBuilder.cs index f2cd1bd3bc5..37a68c8375e 100644 --- a/src/generated/DeviceManagement/Reports/GetReportFilters/GetReportFiltersRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetReportFilters/GetReportFiltersRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getReportFilters"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/GetSettingNonComplianceReport/GetSettingNonComplianceReportRequestBuilder.cs b/src/generated/DeviceManagement/Reports/GetSettingNonComplianceReport/GetSettingNonComplianceReportRequestBuilder.cs index 6af818dc65c..e32bb1a9303 100644 --- a/src/generated/DeviceManagement/Reports/GetSettingNonComplianceReport/GetSettingNonComplianceReportRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/GetSettingNonComplianceReport/GetSettingNonComplianceReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSettingNonComplianceReport"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (body, output) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/DeviceManagement/Reports/ReportsRequestBuilder.cs b/src/generated/DeviceManagement/Reports/ReportsRequestBuilder.cs index de21338b5cb..37f6875eb57 100644 --- a/src/generated/DeviceManagement/Reports/ReportsRequestBuilder.cs +++ b/src/generated/DeviceManagement/Reports/ReportsRequestBuilder.cs @@ -44,7 +44,8 @@ public Command BuildDeleteCommand() { command.Description = "Reports singleton"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -71,12 +72,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Reports singleton"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -185,12 +193,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Reports singleton"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ResourceOperations/Item/ResourceOperationRequestBuilder.cs b/src/generated/DeviceManagement/ResourceOperations/Item/ResourceOperationRequestBuilder.cs index aa4730b8642..27419ce88c3 100644 --- a/src/generated/DeviceManagement/ResourceOperations/Item/ResourceOperationRequestBuilder.cs +++ b/src/generated/DeviceManagement/ResourceOperations/Item/ResourceOperationRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The Resource Operations."; // Create options for all the parameters - command.AddOption(new Option("--resourceoperation-id", description: "key: id of resourceOperation")); + var resourceOperationIdOption = new Option("--resourceoperation-id", description: "key: id of resourceOperation"); + resourceOperationIdOption.IsRequired = true; + command.AddOption(resourceOperationIdOption); command.Handler = CommandHandler.Create(async (resourceOperationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(resourceOperationId)) requestInfo.PathParameters.Add("resourceOperation_id", resourceOperationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The Resource Operations."; // Create options for all the parameters - command.AddOption(new Option("--resourceoperation-id", description: "key: id of resourceOperation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (resourceOperationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(resourceOperationId)) requestInfo.PathParameters.Add("resourceOperation_id", resourceOperationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var resourceOperationIdOption = new Option("--resourceoperation-id", description: "key: id of resourceOperation"); + resourceOperationIdOption.IsRequired = true; + command.AddOption(resourceOperationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (resourceOperationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The Resource Operations."; // Create options for all the parameters - command.AddOption(new Option("--resourceoperation-id", description: "key: id of resourceOperation")); - command.AddOption(new Option("--body")); + var resourceOperationIdOption = new Option("--resourceoperation-id", description: "key: id of resourceOperation"); + resourceOperationIdOption.IsRequired = true; + command.AddOption(resourceOperationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (resourceOperationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(resourceOperationId)) requestInfo.PathParameters.Add("resourceOperation_id", resourceOperationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/ResourceOperations/ResourceOperationsRequestBuilder.cs b/src/generated/DeviceManagement/ResourceOperations/ResourceOperationsRequestBuilder.cs index c1bc2af9d5d..71fdca0cf5e 100644 --- a/src/generated/DeviceManagement/ResourceOperations/ResourceOperationsRequestBuilder.cs +++ b/src/generated/DeviceManagement/ResourceOperations/ResourceOperationsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The Resource Operations."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The Resource Operations."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/RoleAssignments/Item/DeviceAndAppManagementRoleAssignmentRequestBuilder.cs b/src/generated/DeviceManagement/RoleAssignments/Item/DeviceAndAppManagementRoleAssignmentRequestBuilder.cs index c7de24ed88e..1173c167dca 100644 --- a/src/generated/DeviceManagement/RoleAssignments/Item/DeviceAndAppManagementRoleAssignmentRequestBuilder.cs +++ b/src/generated/DeviceManagement/RoleAssignments/Item/DeviceAndAppManagementRoleAssignmentRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The Role Assignments."; // Create options for all the parameters - command.AddOption(new Option("--deviceandappmanagementroleassignment-id", description: "key: id of deviceAndAppManagementRoleAssignment")); + var deviceAndAppManagementRoleAssignmentIdOption = new Option("--deviceandappmanagementroleassignment-id", description: "key: id of deviceAndAppManagementRoleAssignment"); + deviceAndAppManagementRoleAssignmentIdOption.IsRequired = true; + command.AddOption(deviceAndAppManagementRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (deviceAndAppManagementRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceAndAppManagementRoleAssignmentId)) requestInfo.PathParameters.Add("deviceAndAppManagementRoleAssignment_id", deviceAndAppManagementRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The Role Assignments."; // Create options for all the parameters - command.AddOption(new Option("--deviceandappmanagementroleassignment-id", description: "key: id of deviceAndAppManagementRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceAndAppManagementRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceAndAppManagementRoleAssignmentId)) requestInfo.PathParameters.Add("deviceAndAppManagementRoleAssignment_id", deviceAndAppManagementRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceAndAppManagementRoleAssignmentIdOption = new Option("--deviceandappmanagementroleassignment-id", description: "key: id of deviceAndAppManagementRoleAssignment"); + deviceAndAppManagementRoleAssignmentIdOption.IsRequired = true; + command.AddOption(deviceAndAppManagementRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceAndAppManagementRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The Role Assignments."; // Create options for all the parameters - command.AddOption(new Option("--deviceandappmanagementroleassignment-id", description: "key: id of deviceAndAppManagementRoleAssignment")); - command.AddOption(new Option("--body")); + var deviceAndAppManagementRoleAssignmentIdOption = new Option("--deviceandappmanagementroleassignment-id", description: "key: id of deviceAndAppManagementRoleAssignment"); + deviceAndAppManagementRoleAssignmentIdOption.IsRequired = true; + command.AddOption(deviceAndAppManagementRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceAndAppManagementRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceAndAppManagementRoleAssignmentId)) requestInfo.PathParameters.Add("deviceAndAppManagementRoleAssignment_id", deviceAndAppManagementRoleAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/RoleAssignments/RoleAssignmentsRequestBuilder.cs b/src/generated/DeviceManagement/RoleAssignments/RoleAssignmentsRequestBuilder.cs index 8deefec0a7c..c92858aa4d9 100644 --- a/src/generated/DeviceManagement/RoleAssignments/RoleAssignmentsRequestBuilder.cs +++ b/src/generated/DeviceManagement/RoleAssignments/RoleAssignmentsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The Role Assignments."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The Role Assignments."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/Item/RoleAssignmentRequestBuilder.cs b/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/Item/RoleAssignmentRequestBuilder.cs index 5f522b1786e..d9a9ffece81 100644 --- a/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/Item/RoleAssignmentRequestBuilder.cs +++ b/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/Item/RoleAssignmentRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "List of Role assignments for this role definition."; // Create options for all the parameters - command.AddOption(new Option("--roledefinition-id", description: "key: id of roleDefinition")); - command.AddOption(new Option("--roleassignment-id", description: "key: id of roleAssignment")); + var roleDefinitionIdOption = new Option("--roledefinition-id", description: "key: id of roleDefinition"); + roleDefinitionIdOption.IsRequired = true; + command.AddOption(roleDefinitionIdOption); + var roleAssignmentIdOption = new Option("--roleassignment-id", description: "key: id of roleAssignment"); + roleAssignmentIdOption.IsRequired = true; + command.AddOption(roleAssignmentIdOption); command.Handler = CommandHandler.Create(async (roleDefinitionId, roleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(roleDefinitionId)) requestInfo.PathParameters.Add("roleDefinition_id", roleDefinitionId); - if (!String.IsNullOrEmpty(roleAssignmentId)) requestInfo.PathParameters.Add("roleAssignment_id", roleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "List of Role assignments for this role definition."; // Create options for all the parameters - command.AddOption(new Option("--roledefinition-id", description: "key: id of roleDefinition")); - command.AddOption(new Option("--roleassignment-id", description: "key: id of roleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (roleDefinitionId, roleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(roleDefinitionId)) requestInfo.PathParameters.Add("roleDefinition_id", roleDefinitionId); - if (!String.IsNullOrEmpty(roleAssignmentId)) requestInfo.PathParameters.Add("roleAssignment_id", roleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var roleDefinitionIdOption = new Option("--roledefinition-id", description: "key: id of roleDefinition"); + roleDefinitionIdOption.IsRequired = true; + command.AddOption(roleDefinitionIdOption); + var roleAssignmentIdOption = new Option("--roleassignment-id", description: "key: id of roleAssignment"); + roleAssignmentIdOption.IsRequired = true; + command.AddOption(roleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (roleDefinitionId, roleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "List of Role assignments for this role definition."; // Create options for all the parameters - command.AddOption(new Option("--roledefinition-id", description: "key: id of roleDefinition")); - command.AddOption(new Option("--roleassignment-id", description: "key: id of roleAssignment")); - command.AddOption(new Option("--body")); + var roleDefinitionIdOption = new Option("--roledefinition-id", description: "key: id of roleDefinition"); + roleDefinitionIdOption.IsRequired = true; + command.AddOption(roleDefinitionIdOption); + var roleAssignmentIdOption = new Option("--roleassignment-id", description: "key: id of roleAssignment"); + roleAssignmentIdOption.IsRequired = true; + command.AddOption(roleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (roleDefinitionId, roleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(roleDefinitionId)) requestInfo.PathParameters.Add("roleDefinition_id", roleDefinitionId); - if (!String.IsNullOrEmpty(roleAssignmentId)) requestInfo.PathParameters.Add("roleAssignment_id", roleAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/Item/RoleDefinition/@Ref/RefRequestBuilder.cs b/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/Item/RoleDefinition/@Ref/RefRequestBuilder.cs index ac8e18da383..3193a641f0f 100644 --- a/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/Item/RoleDefinition/@Ref/RefRequestBuilder.cs +++ b/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/Item/RoleDefinition/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Role definition this assignment is part of."; // Create options for all the parameters - command.AddOption(new Option("--roledefinition-id", description: "key: id of roleDefinition")); - command.AddOption(new Option("--roleassignment-id", description: "key: id of roleAssignment")); + var roleDefinitionIdOption = new Option("--roledefinition-id", description: "key: id of roleDefinition"); + roleDefinitionIdOption.IsRequired = true; + command.AddOption(roleDefinitionIdOption); + var roleAssignmentIdOption = new Option("--roleassignment-id", description: "key: id of roleAssignment"); + roleAssignmentIdOption.IsRequired = true; + command.AddOption(roleAssignmentIdOption); command.Handler = CommandHandler.Create(async (roleDefinitionId, roleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(roleDefinitionId)) requestInfo.PathParameters.Add("roleDefinition_id", roleDefinitionId); - if (!String.IsNullOrEmpty(roleAssignmentId)) requestInfo.PathParameters.Add("roleAssignment_id", roleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Role definition this assignment is part of."; // Create options for all the parameters - command.AddOption(new Option("--roledefinition-id", description: "key: id of roleDefinition")); - command.AddOption(new Option("--roleassignment-id", description: "key: id of roleAssignment")); + var roleDefinitionIdOption = new Option("--roledefinition-id", description: "key: id of roleDefinition"); + roleDefinitionIdOption.IsRequired = true; + command.AddOption(roleDefinitionIdOption); + var roleAssignmentIdOption = new Option("--roleassignment-id", description: "key: id of roleAssignment"); + roleAssignmentIdOption.IsRequired = true; + command.AddOption(roleAssignmentIdOption); command.Handler = CommandHandler.Create(async (roleDefinitionId, roleAssignmentId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(roleDefinitionId)) requestInfo.PathParameters.Add("roleDefinition_id", roleDefinitionId); - if (!String.IsNullOrEmpty(roleAssignmentId)) requestInfo.PathParameters.Add("roleAssignment_id", roleAssignmentId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Role definition this assignment is part of."; // Create options for all the parameters - command.AddOption(new Option("--roledefinition-id", description: "key: id of roleDefinition")); - command.AddOption(new Option("--roleassignment-id", description: "key: id of roleAssignment")); - command.AddOption(new Option("--body")); + var roleDefinitionIdOption = new Option("--roledefinition-id", description: "key: id of roleDefinition"); + roleDefinitionIdOption.IsRequired = true; + command.AddOption(roleDefinitionIdOption); + var roleAssignmentIdOption = new Option("--roleassignment-id", description: "key: id of roleAssignment"); + roleAssignmentIdOption.IsRequired = true; + command.AddOption(roleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (roleDefinitionId, roleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(roleDefinitionId)) requestInfo.PathParameters.Add("roleDefinition_id", roleDefinitionId); - if (!String.IsNullOrEmpty(roleAssignmentId)) requestInfo.PathParameters.Add("roleAssignment_id", roleAssignmentId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/Item/RoleDefinition/RoleDefinitionRequestBuilder.cs b/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/Item/RoleDefinition/RoleDefinitionRequestBuilder.cs index 8e3c6d9d8c3..4024f25f4b2 100644 --- a/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/Item/RoleDefinition/RoleDefinitionRequestBuilder.cs +++ b/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/Item/RoleDefinition/RoleDefinitionRequestBuilder.cs @@ -27,16 +27,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Role definition this assignment is part of."; // Create options for all the parameters - command.AddOption(new Option("--roledefinition-id", description: "key: id of roleDefinition")); - command.AddOption(new Option("--roleassignment-id", description: "key: id of roleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (roleDefinitionId, roleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(roleDefinitionId)) requestInfo.PathParameters.Add("roleDefinition_id", roleDefinitionId); - if (!String.IsNullOrEmpty(roleAssignmentId)) requestInfo.PathParameters.Add("roleAssignment_id", roleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var roleDefinitionIdOption = new Option("--roledefinition-id", description: "key: id of roleDefinition"); + roleDefinitionIdOption.IsRequired = true; + command.AddOption(roleDefinitionIdOption); + var roleAssignmentIdOption = new Option("--roleassignment-id", description: "key: id of roleAssignment"); + roleAssignmentIdOption.IsRequired = true; + command.AddOption(roleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (roleDefinitionId, roleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/RoleAssignmentsRequestBuilder.cs b/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/RoleAssignmentsRequestBuilder.cs index 6caea3afdf7..dc5edd13603 100644 --- a/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/RoleAssignmentsRequestBuilder.cs +++ b/src/generated/DeviceManagement/RoleDefinitions/Item/RoleAssignments/RoleAssignmentsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "List of Role assignments for this role definition."; // Create options for all the parameters - command.AddOption(new Option("--roledefinition-id", description: "key: id of roleDefinition")); - command.AddOption(new Option("--body")); + var roleDefinitionIdOption = new Option("--roledefinition-id", description: "key: id of roleDefinition"); + roleDefinitionIdOption.IsRequired = true; + command.AddOption(roleDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (roleDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(roleDefinitionId)) requestInfo.PathParameters.Add("roleDefinition_id", roleDefinitionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "List of Role assignments for this role definition."; // Create options for all the parameters - command.AddOption(new Option("--roledefinition-id", description: "key: id of roleDefinition")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (roleDefinitionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(roleDefinitionId)) requestInfo.PathParameters.Add("roleDefinition_id", roleDefinitionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var roleDefinitionIdOption = new Option("--roledefinition-id", description: "key: id of roleDefinition"); + roleDefinitionIdOption.IsRequired = true; + command.AddOption(roleDefinitionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (roleDefinitionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/RoleDefinitions/Item/RoleDefinitionRequestBuilder.cs b/src/generated/DeviceManagement/RoleDefinitions/Item/RoleDefinitionRequestBuilder.cs index 19e407ee6ae..0e90d66dc0c 100644 --- a/src/generated/DeviceManagement/RoleDefinitions/Item/RoleDefinitionRequestBuilder.cs +++ b/src/generated/DeviceManagement/RoleDefinitions/Item/RoleDefinitionRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The Role Definitions."; // Create options for all the parameters - command.AddOption(new Option("--roledefinition-id", description: "key: id of roleDefinition")); + var roleDefinitionIdOption = new Option("--roledefinition-id", description: "key: id of roleDefinition"); + roleDefinitionIdOption.IsRequired = true; + command.AddOption(roleDefinitionIdOption); command.Handler = CommandHandler.Create(async (roleDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(roleDefinitionId)) requestInfo.PathParameters.Add("roleDefinition_id", roleDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The Role Definitions."; // Create options for all the parameters - command.AddOption(new Option("--roledefinition-id", description: "key: id of roleDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (roleDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(roleDefinitionId)) requestInfo.PathParameters.Add("roleDefinition_id", roleDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var roleDefinitionIdOption = new Option("--roledefinition-id", description: "key: id of roleDefinition"); + roleDefinitionIdOption.IsRequired = true; + command.AddOption(roleDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (roleDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,14 +80,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The Role Definitions."; // Create options for all the parameters - command.AddOption(new Option("--roledefinition-id", description: "key: id of roleDefinition")); - command.AddOption(new Option("--body")); + var roleDefinitionIdOption = new Option("--roledefinition-id", description: "key: id of roleDefinition"); + roleDefinitionIdOption.IsRequired = true; + command.AddOption(roleDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (roleDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(roleDefinitionId)) requestInfo.PathParameters.Add("roleDefinition_id", roleDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/RoleDefinitions/RoleDefinitionsRequestBuilder.cs b/src/generated/DeviceManagement/RoleDefinitions/RoleDefinitionsRequestBuilder.cs index 14239c3a0b9..3e0e31d5379 100644 --- a/src/generated/DeviceManagement/RoleDefinitions/RoleDefinitionsRequestBuilder.cs +++ b/src/generated/DeviceManagement/RoleDefinitions/RoleDefinitionsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The Role Definitions."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The Role Definitions."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/SoftwareUpdateStatusSummary/@Ref/RefRequestBuilder.cs b/src/generated/DeviceManagement/SoftwareUpdateStatusSummary/@Ref/RefRequestBuilder.cs index f30818a144e..2eaff5fd184 100644 --- a/src/generated/DeviceManagement/SoftwareUpdateStatusSummary/@Ref/RefRequestBuilder.cs +++ b/src/generated/DeviceManagement/SoftwareUpdateStatusSummary/@Ref/RefRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildDeleteCommand() { command.Description = "The software update status summary."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,7 +42,8 @@ public Command BuildGetCommand() { command.Description = "The software update status summary."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,12 +62,15 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The software update status summary."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/SoftwareUpdateStatusSummary/SoftwareUpdateStatusSummaryRequestBuilder.cs b/src/generated/DeviceManagement/SoftwareUpdateStatusSummary/SoftwareUpdateStatusSummaryRequestBuilder.cs index 87aadbe6c99..b586bf350ac 100644 --- a/src/generated/DeviceManagement/SoftwareUpdateStatusSummary/SoftwareUpdateStatusSummaryRequestBuilder.cs +++ b/src/generated/DeviceManagement/SoftwareUpdateStatusSummary/SoftwareUpdateStatusSummaryRequestBuilder.cs @@ -27,12 +27,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The software update status summary."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/TelecomExpenseManagementPartners/Item/TelecomExpenseManagementPartnerRequestBuilder.cs b/src/generated/DeviceManagement/TelecomExpenseManagementPartners/Item/TelecomExpenseManagementPartnerRequestBuilder.cs index e13b7269b0c..53ef472b91b 100644 --- a/src/generated/DeviceManagement/TelecomExpenseManagementPartners/Item/TelecomExpenseManagementPartnerRequestBuilder.cs +++ b/src/generated/DeviceManagement/TelecomExpenseManagementPartners/Item/TelecomExpenseManagementPartnerRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The telecom expense management partners."; // Create options for all the parameters - command.AddOption(new Option("--telecomexpensemanagementpartner-id", description: "key: id of telecomExpenseManagementPartner")); + var telecomExpenseManagementPartnerIdOption = new Option("--telecomexpensemanagementpartner-id", description: "key: id of telecomExpenseManagementPartner"); + telecomExpenseManagementPartnerIdOption.IsRequired = true; + command.AddOption(telecomExpenseManagementPartnerIdOption); command.Handler = CommandHandler.Create(async (telecomExpenseManagementPartnerId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(telecomExpenseManagementPartnerId)) requestInfo.PathParameters.Add("telecomExpenseManagementPartner_id", telecomExpenseManagementPartnerId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The telecom expense management partners."; // Create options for all the parameters - command.AddOption(new Option("--telecomexpensemanagementpartner-id", description: "key: id of telecomExpenseManagementPartner")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (telecomExpenseManagementPartnerId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(telecomExpenseManagementPartnerId)) requestInfo.PathParameters.Add("telecomExpenseManagementPartner_id", telecomExpenseManagementPartnerId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var telecomExpenseManagementPartnerIdOption = new Option("--telecomexpensemanagementpartner-id", description: "key: id of telecomExpenseManagementPartner"); + telecomExpenseManagementPartnerIdOption.IsRequired = true; + command.AddOption(telecomExpenseManagementPartnerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (telecomExpenseManagementPartnerId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The telecom expense management partners."; // Create options for all the parameters - command.AddOption(new Option("--telecomexpensemanagementpartner-id", description: "key: id of telecomExpenseManagementPartner")); - command.AddOption(new Option("--body")); + var telecomExpenseManagementPartnerIdOption = new Option("--telecomexpensemanagementpartner-id", description: "key: id of telecomExpenseManagementPartner"); + telecomExpenseManagementPartnerIdOption.IsRequired = true; + command.AddOption(telecomExpenseManagementPartnerIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (telecomExpenseManagementPartnerId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(telecomExpenseManagementPartnerId)) requestInfo.PathParameters.Add("telecomExpenseManagementPartner_id", telecomExpenseManagementPartnerId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/TelecomExpenseManagementPartners/TelecomExpenseManagementPartnersRequestBuilder.cs b/src/generated/DeviceManagement/TelecomExpenseManagementPartners/TelecomExpenseManagementPartnersRequestBuilder.cs index dafa18a0fb5..63a8961e810 100644 --- a/src/generated/DeviceManagement/TelecomExpenseManagementPartners/TelecomExpenseManagementPartnersRequestBuilder.cs +++ b/src/generated/DeviceManagement/TelecomExpenseManagementPartners/TelecomExpenseManagementPartnersRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The telecom expense management partners."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The telecom expense management partners."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/AcceptanceStatusesRequestBuilder.cs b/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/AcceptanceStatusesRequestBuilder.cs index 3408b875a19..38ac035a61e 100644 --- a/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/AcceptanceStatusesRequestBuilder.cs +++ b/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/AcceptanceStatusesRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of acceptance statuses for this T&C policy."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--body")); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (termsAndConditionsId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of acceptance statuses for this T&C policy."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (termsAndConditionsId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (termsAndConditionsId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/Item/TermsAndConditions/@Ref/RefRequestBuilder.cs b/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/Item/TermsAndConditions/@Ref/RefRequestBuilder.cs index add3e4c17d0..92301e4c60d 100644 --- a/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/Item/TermsAndConditions/@Ref/RefRequestBuilder.cs +++ b/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/Item/TermsAndConditions/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Navigation link to the terms and conditions that are assigned."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--termsandconditionsacceptancestatus-id", description: "key: id of termsAndConditionsAcceptanceStatus")); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var termsAndConditionsAcceptanceStatusIdOption = new Option("--termsandconditionsacceptancestatus-id", description: "key: id of termsAndConditionsAcceptanceStatus"); + termsAndConditionsAcceptanceStatusIdOption.IsRequired = true; + command.AddOption(termsAndConditionsAcceptanceStatusIdOption); command.Handler = CommandHandler.Create(async (termsAndConditionsId, termsAndConditionsAcceptanceStatusId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); - if (!String.IsNullOrEmpty(termsAndConditionsAcceptanceStatusId)) requestInfo.PathParameters.Add("termsAndConditionsAcceptanceStatus_id", termsAndConditionsAcceptanceStatusId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Navigation link to the terms and conditions that are assigned."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--termsandconditionsacceptancestatus-id", description: "key: id of termsAndConditionsAcceptanceStatus")); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var termsAndConditionsAcceptanceStatusIdOption = new Option("--termsandconditionsacceptancestatus-id", description: "key: id of termsAndConditionsAcceptanceStatus"); + termsAndConditionsAcceptanceStatusIdOption.IsRequired = true; + command.AddOption(termsAndConditionsAcceptanceStatusIdOption); command.Handler = CommandHandler.Create(async (termsAndConditionsId, termsAndConditionsAcceptanceStatusId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); - if (!String.IsNullOrEmpty(termsAndConditionsAcceptanceStatusId)) requestInfo.PathParameters.Add("termsAndConditionsAcceptanceStatus_id", termsAndConditionsAcceptanceStatusId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Navigation link to the terms and conditions that are assigned."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--termsandconditionsacceptancestatus-id", description: "key: id of termsAndConditionsAcceptanceStatus")); - command.AddOption(new Option("--body")); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var termsAndConditionsAcceptanceStatusIdOption = new Option("--termsandconditionsacceptancestatus-id", description: "key: id of termsAndConditionsAcceptanceStatus"); + termsAndConditionsAcceptanceStatusIdOption.IsRequired = true; + command.AddOption(termsAndConditionsAcceptanceStatusIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (termsAndConditionsId, termsAndConditionsAcceptanceStatusId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); - if (!String.IsNullOrEmpty(termsAndConditionsAcceptanceStatusId)) requestInfo.PathParameters.Add("termsAndConditionsAcceptanceStatus_id", termsAndConditionsAcceptanceStatusId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/Item/TermsAndConditions/TermsAndConditionsRequestBuilder.cs b/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/Item/TermsAndConditions/TermsAndConditionsRequestBuilder.cs index 5092d06342d..cb5ac52a0ad 100644 --- a/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/Item/TermsAndConditions/TermsAndConditionsRequestBuilder.cs +++ b/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/Item/TermsAndConditions/TermsAndConditionsRequestBuilder.cs @@ -27,16 +27,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Navigation link to the terms and conditions that are assigned."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--termsandconditionsacceptancestatus-id", description: "key: id of termsAndConditionsAcceptanceStatus")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (termsAndConditionsId, termsAndConditionsAcceptanceStatusId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); - if (!String.IsNullOrEmpty(termsAndConditionsAcceptanceStatusId)) requestInfo.PathParameters.Add("termsAndConditionsAcceptanceStatus_id", termsAndConditionsAcceptanceStatusId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var termsAndConditionsAcceptanceStatusIdOption = new Option("--termsandconditionsacceptancestatus-id", description: "key: id of termsAndConditionsAcceptanceStatus"); + termsAndConditionsAcceptanceStatusIdOption.IsRequired = true; + command.AddOption(termsAndConditionsAcceptanceStatusIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (termsAndConditionsId, termsAndConditionsAcceptanceStatusId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/Item/TermsAndConditionsAcceptanceStatusRequestBuilder.cs b/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/Item/TermsAndConditionsAcceptanceStatusRequestBuilder.cs index fdda62c5504..779a32c583b 100644 --- a/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/Item/TermsAndConditionsAcceptanceStatusRequestBuilder.cs +++ b/src/generated/DeviceManagement/TermsAndConditions/Item/AcceptanceStatuses/Item/TermsAndConditionsAcceptanceStatusRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of acceptance statuses for this T&C policy."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--termsandconditionsacceptancestatus-id", description: "key: id of termsAndConditionsAcceptanceStatus")); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var termsAndConditionsAcceptanceStatusIdOption = new Option("--termsandconditionsacceptancestatus-id", description: "key: id of termsAndConditionsAcceptanceStatus"); + termsAndConditionsAcceptanceStatusIdOption.IsRequired = true; + command.AddOption(termsAndConditionsAcceptanceStatusIdOption); command.Handler = CommandHandler.Create(async (termsAndConditionsId, termsAndConditionsAcceptanceStatusId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); - if (!String.IsNullOrEmpty(termsAndConditionsAcceptanceStatusId)) requestInfo.PathParameters.Add("termsAndConditionsAcceptanceStatus_id", termsAndConditionsAcceptanceStatusId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of acceptance statuses for this T&C policy."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--termsandconditionsacceptancestatus-id", description: "key: id of termsAndConditionsAcceptanceStatus")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (termsAndConditionsId, termsAndConditionsAcceptanceStatusId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); - if (!String.IsNullOrEmpty(termsAndConditionsAcceptanceStatusId)) requestInfo.PathParameters.Add("termsAndConditionsAcceptanceStatus_id", termsAndConditionsAcceptanceStatusId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var termsAndConditionsAcceptanceStatusIdOption = new Option("--termsandconditionsacceptancestatus-id", description: "key: id of termsAndConditionsAcceptanceStatus"); + termsAndConditionsAcceptanceStatusIdOption.IsRequired = true; + command.AddOption(termsAndConditionsAcceptanceStatusIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (termsAndConditionsId, termsAndConditionsAcceptanceStatusId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of acceptance statuses for this T&C policy."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--termsandconditionsacceptancestatus-id", description: "key: id of termsAndConditionsAcceptanceStatus")); - command.AddOption(new Option("--body")); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var termsAndConditionsAcceptanceStatusIdOption = new Option("--termsandconditionsacceptancestatus-id", description: "key: id of termsAndConditionsAcceptanceStatus"); + termsAndConditionsAcceptanceStatusIdOption.IsRequired = true; + command.AddOption(termsAndConditionsAcceptanceStatusIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (termsAndConditionsId, termsAndConditionsAcceptanceStatusId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); - if (!String.IsNullOrEmpty(termsAndConditionsAcceptanceStatusId)) requestInfo.PathParameters.Add("termsAndConditionsAcceptanceStatus_id", termsAndConditionsAcceptanceStatusId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/TermsAndConditions/Item/Assignments/AssignmentsRequestBuilder.cs b/src/generated/DeviceManagement/TermsAndConditions/Item/Assignments/AssignmentsRequestBuilder.cs index 33aec9b6b3c..648813b7e75 100644 --- a/src/generated/DeviceManagement/TermsAndConditions/Item/Assignments/AssignmentsRequestBuilder.cs +++ b/src/generated/DeviceManagement/TermsAndConditions/Item/Assignments/AssignmentsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of assignments for this T&C policy."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--body")); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (termsAndConditionsId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of assignments for this T&C policy."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (termsAndConditionsId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (termsAndConditionsId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/TermsAndConditions/Item/Assignments/Item/TermsAndConditionsAssignmentRequestBuilder.cs b/src/generated/DeviceManagement/TermsAndConditions/Item/Assignments/Item/TermsAndConditionsAssignmentRequestBuilder.cs index 52db8fc19e4..0bb745c7b53 100644 --- a/src/generated/DeviceManagement/TermsAndConditions/Item/Assignments/Item/TermsAndConditionsAssignmentRequestBuilder.cs +++ b/src/generated/DeviceManagement/TermsAndConditions/Item/Assignments/Item/TermsAndConditionsAssignmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of assignments for this T&C policy."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--termsandconditionsassignment-id", description: "key: id of termsAndConditionsAssignment")); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var termsAndConditionsAssignmentIdOption = new Option("--termsandconditionsassignment-id", description: "key: id of termsAndConditionsAssignment"); + termsAndConditionsAssignmentIdOption.IsRequired = true; + command.AddOption(termsAndConditionsAssignmentIdOption); command.Handler = CommandHandler.Create(async (termsAndConditionsId, termsAndConditionsAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); - if (!String.IsNullOrEmpty(termsAndConditionsAssignmentId)) requestInfo.PathParameters.Add("termsAndConditionsAssignment_id", termsAndConditionsAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of assignments for this T&C policy."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--termsandconditionsassignment-id", description: "key: id of termsAndConditionsAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (termsAndConditionsId, termsAndConditionsAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); - if (!String.IsNullOrEmpty(termsAndConditionsAssignmentId)) requestInfo.PathParameters.Add("termsAndConditionsAssignment_id", termsAndConditionsAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var termsAndConditionsAssignmentIdOption = new Option("--termsandconditionsassignment-id", description: "key: id of termsAndConditionsAssignment"); + termsAndConditionsAssignmentIdOption.IsRequired = true; + command.AddOption(termsAndConditionsAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (termsAndConditionsId, termsAndConditionsAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of assignments for this T&C policy."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--termsandconditionsassignment-id", description: "key: id of termsAndConditionsAssignment")); - command.AddOption(new Option("--body")); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var termsAndConditionsAssignmentIdOption = new Option("--termsandconditionsassignment-id", description: "key: id of termsAndConditionsAssignment"); + termsAndConditionsAssignmentIdOption.IsRequired = true; + command.AddOption(termsAndConditionsAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (termsAndConditionsId, termsAndConditionsAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); - if (!String.IsNullOrEmpty(termsAndConditionsAssignmentId)) requestInfo.PathParameters.Add("termsAndConditionsAssignment_id", termsAndConditionsAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/TermsAndConditions/Item/TermsAndConditionsRequestBuilder.cs b/src/generated/DeviceManagement/TermsAndConditions/Item/TermsAndConditionsRequestBuilder.cs index f6d1b26a4c5..2f5f102c227 100644 --- a/src/generated/DeviceManagement/TermsAndConditions/Item/TermsAndConditionsRequestBuilder.cs +++ b/src/generated/DeviceManagement/TermsAndConditions/Item/TermsAndConditionsRequestBuilder.cs @@ -42,10 +42,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The terms and conditions associated with device management of the company."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); command.Handler = CommandHandler.Create(async (termsAndConditionsId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,14 +61,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The terms and conditions associated with device management of the company."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (termsAndConditionsId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (termsAndConditionsId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,14 +95,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The terms and conditions associated with device management of the company."; // Create options for all the parameters - command.AddOption(new Option("--termsandconditions-id", description: "key: id of termsAndConditions")); - command.AddOption(new Option("--body")); + var termsAndConditionsIdOption = new Option("--termsandconditions-id", description: "key: id of termsAndConditions"); + termsAndConditionsIdOption.IsRequired = true; + command.AddOption(termsAndConditionsIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (termsAndConditionsId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(termsAndConditionsId)) requestInfo.PathParameters.Add("termsAndConditions_id", termsAndConditionsId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/TermsAndConditions/TermsAndConditionsRequestBuilder.cs b/src/generated/DeviceManagement/TermsAndConditions/TermsAndConditionsRequestBuilder.cs index 74ddeecc8b6..d838bbe311e 100644 --- a/src/generated/DeviceManagement/TermsAndConditions/TermsAndConditionsRequestBuilder.cs +++ b/src/generated/DeviceManagement/TermsAndConditions/TermsAndConditionsRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The terms and conditions associated with device management of the company."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,24 +61,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The terms and conditions associated with device management of the company."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/TroubleshootingEvents/Item/DeviceManagementTroubleshootingEventRequestBuilder.cs b/src/generated/DeviceManagement/TroubleshootingEvents/Item/DeviceManagementTroubleshootingEventRequestBuilder.cs index 9018ef6d78e..a16f0423737 100644 --- a/src/generated/DeviceManagement/TroubleshootingEvents/Item/DeviceManagementTroubleshootingEventRequestBuilder.cs +++ b/src/generated/DeviceManagement/TroubleshootingEvents/Item/DeviceManagementTroubleshootingEventRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of troubleshooting events for the tenant."; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent")); + var deviceManagementTroubleshootingEventIdOption = new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent"); + deviceManagementTroubleshootingEventIdOption.IsRequired = true; + command.AddOption(deviceManagementTroubleshootingEventIdOption); command.Handler = CommandHandler.Create(async (deviceManagementTroubleshootingEventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceManagementTroubleshootingEventId)) requestInfo.PathParameters.Add("deviceManagementTroubleshootingEvent_id", deviceManagementTroubleshootingEventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of troubleshooting events for the tenant."; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceManagementTroubleshootingEventId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceManagementTroubleshootingEventId)) requestInfo.PathParameters.Add("deviceManagementTroubleshootingEvent_id", deviceManagementTroubleshootingEventId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceManagementTroubleshootingEventIdOption = new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent"); + deviceManagementTroubleshootingEventIdOption.IsRequired = true; + command.AddOption(deviceManagementTroubleshootingEventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceManagementTroubleshootingEventId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of troubleshooting events for the tenant."; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent")); - command.AddOption(new Option("--body")); + var deviceManagementTroubleshootingEventIdOption = new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent"); + deviceManagementTroubleshootingEventIdOption.IsRequired = true; + command.AddOption(deviceManagementTroubleshootingEventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceManagementTroubleshootingEventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceManagementTroubleshootingEventId)) requestInfo.PathParameters.Add("deviceManagementTroubleshootingEvent_id", deviceManagementTroubleshootingEventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/TroubleshootingEvents/TroubleshootingEventsRequestBuilder.cs b/src/generated/DeviceManagement/TroubleshootingEvents/TroubleshootingEventsRequestBuilder.cs index 362a1dd80d7..a9035b23195 100644 --- a/src/generated/DeviceManagement/TroubleshootingEvents/TroubleshootingEventsRequestBuilder.cs +++ b/src/generated/DeviceManagement/TroubleshootingEvents/TroubleshootingEventsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of troubleshooting events for the tenant."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of troubleshooting events for the tenant."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/VerifyWindowsEnrollmentAutoDiscoveryWithDomainName/VerifyWindowsEnrollmentAutoDiscoveryWithDomainNameRequestBuilder.cs b/src/generated/DeviceManagement/VerifyWindowsEnrollmentAutoDiscoveryWithDomainName/VerifyWindowsEnrollmentAutoDiscoveryWithDomainNameRequestBuilder.cs index a31457ed3bb..2f29075489d 100644 --- a/src/generated/DeviceManagement/VerifyWindowsEnrollmentAutoDiscoveryWithDomainName/VerifyWindowsEnrollmentAutoDiscoveryWithDomainNameRequestBuilder.cs +++ b/src/generated/DeviceManagement/VerifyWindowsEnrollmentAutoDiscoveryWithDomainName/VerifyWindowsEnrollmentAutoDiscoveryWithDomainNameRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function verifyWindowsEnrollmentAutoDiscovery"; // Create options for all the parameters - command.AddOption(new Option("--domainname", description: "Usage: domainName={domainName}")); + var domainNameOption = new Option("--domainname", description: "Usage: domainName={domainName}"); + domainNameOption.IsRequired = true; + command.AddOption(domainNameOption); command.Handler = CommandHandler.Create(async (domainName) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(domainName)) requestInfo.PathParameters.Add("domainName", domainName); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/AssignUserToDevice/AssignUserToDeviceRequestBuilder.cs b/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/AssignUserToDevice/AssignUserToDeviceRequestBuilder.cs index f69f1b8f923..3e450708f6a 100644 --- a/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/AssignUserToDevice/AssignUserToDeviceRequestBuilder.cs +++ b/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/AssignUserToDevice/AssignUserToDeviceRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Assigns user to Autopilot devices."; // Create options for all the parameters - command.AddOption(new Option("--windowsautopilotdeviceidentity-id", description: "key: id of windowsAutopilotDeviceIdentity")); - command.AddOption(new Option("--body")); + var windowsAutopilotDeviceIdentityIdOption = new Option("--windowsautopilotdeviceidentity-id", description: "key: id of windowsAutopilotDeviceIdentity"); + windowsAutopilotDeviceIdentityIdOption.IsRequired = true; + command.AddOption(windowsAutopilotDeviceIdentityIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (windowsAutopilotDeviceIdentityId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(windowsAutopilotDeviceIdentityId)) requestInfo.PathParameters.Add("windowsAutopilotDeviceIdentity_id", windowsAutopilotDeviceIdentityId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/UnassignUserFromDevice/UnassignUserFromDeviceRequestBuilder.cs b/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/UnassignUserFromDevice/UnassignUserFromDeviceRequestBuilder.cs index 6162bfac5c5..3d575990558 100644 --- a/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/UnassignUserFromDevice/UnassignUserFromDeviceRequestBuilder.cs +++ b/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/UnassignUserFromDevice/UnassignUserFromDeviceRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Unassigns the user from an Autopilot device."; // Create options for all the parameters - command.AddOption(new Option("--windowsautopilotdeviceidentity-id", description: "key: id of windowsAutopilotDeviceIdentity")); + var windowsAutopilotDeviceIdentityIdOption = new Option("--windowsautopilotdeviceidentity-id", description: "key: id of windowsAutopilotDeviceIdentity"); + windowsAutopilotDeviceIdentityIdOption.IsRequired = true; + command.AddOption(windowsAutopilotDeviceIdentityIdOption); command.Handler = CommandHandler.Create(async (windowsAutopilotDeviceIdentityId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(windowsAutopilotDeviceIdentityId)) requestInfo.PathParameters.Add("windowsAutopilotDeviceIdentity_id", windowsAutopilotDeviceIdentityId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/UpdateDeviceProperties/UpdateDevicePropertiesRequestBuilder.cs b/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/UpdateDeviceProperties/UpdateDevicePropertiesRequestBuilder.cs index d8dcfe93aff..ffe886efd9e 100644 --- a/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/UpdateDeviceProperties/UpdateDevicePropertiesRequestBuilder.cs +++ b/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/UpdateDeviceProperties/UpdateDevicePropertiesRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Updates properties on Autopilot devices."; // Create options for all the parameters - command.AddOption(new Option("--windowsautopilotdeviceidentity-id", description: "key: id of windowsAutopilotDeviceIdentity")); - command.AddOption(new Option("--body")); + var windowsAutopilotDeviceIdentityIdOption = new Option("--windowsautopilotdeviceidentity-id", description: "key: id of windowsAutopilotDeviceIdentity"); + windowsAutopilotDeviceIdentityIdOption.IsRequired = true; + command.AddOption(windowsAutopilotDeviceIdentityIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (windowsAutopilotDeviceIdentityId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(windowsAutopilotDeviceIdentityId)) requestInfo.PathParameters.Add("windowsAutopilotDeviceIdentity_id", windowsAutopilotDeviceIdentityId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/WindowsAutopilotDeviceIdentityRequestBuilder.cs b/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/WindowsAutopilotDeviceIdentityRequestBuilder.cs index 6a7b900fb73..8c2eb95bd5d 100644 --- a/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/WindowsAutopilotDeviceIdentityRequestBuilder.cs +++ b/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/Item/WindowsAutopilotDeviceIdentityRequestBuilder.cs @@ -35,10 +35,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The Windows autopilot device identities contained collection."; // Create options for all the parameters - command.AddOption(new Option("--windowsautopilotdeviceidentity-id", description: "key: id of windowsAutopilotDeviceIdentity")); + var windowsAutopilotDeviceIdentityIdOption = new Option("--windowsautopilotdeviceidentity-id", description: "key: id of windowsAutopilotDeviceIdentity"); + windowsAutopilotDeviceIdentityIdOption.IsRequired = true; + command.AddOption(windowsAutopilotDeviceIdentityIdOption); command.Handler = CommandHandler.Create(async (windowsAutopilotDeviceIdentityId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(windowsAutopilotDeviceIdentityId)) requestInfo.PathParameters.Add("windowsAutopilotDeviceIdentity_id", windowsAutopilotDeviceIdentityId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,14 +54,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The Windows autopilot device identities contained collection."; // Create options for all the parameters - command.AddOption(new Option("--windowsautopilotdeviceidentity-id", description: "key: id of windowsAutopilotDeviceIdentity")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (windowsAutopilotDeviceIdentityId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(windowsAutopilotDeviceIdentityId)) requestInfo.PathParameters.Add("windowsAutopilotDeviceIdentity_id", windowsAutopilotDeviceIdentityId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var windowsAutopilotDeviceIdentityIdOption = new Option("--windowsautopilotdeviceidentity-id", description: "key: id of windowsAutopilotDeviceIdentity"); + windowsAutopilotDeviceIdentityIdOption.IsRequired = true; + command.AddOption(windowsAutopilotDeviceIdentityIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (windowsAutopilotDeviceIdentityId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,14 +88,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The Windows autopilot device identities contained collection."; // Create options for all the parameters - command.AddOption(new Option("--windowsautopilotdeviceidentity-id", description: "key: id of windowsAutopilotDeviceIdentity")); - command.AddOption(new Option("--body")); + var windowsAutopilotDeviceIdentityIdOption = new Option("--windowsautopilotdeviceidentity-id", description: "key: id of windowsAutopilotDeviceIdentity"); + windowsAutopilotDeviceIdentityIdOption.IsRequired = true; + command.AddOption(windowsAutopilotDeviceIdentityIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (windowsAutopilotDeviceIdentityId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(windowsAutopilotDeviceIdentityId)) requestInfo.PathParameters.Add("windowsAutopilotDeviceIdentity_id", windowsAutopilotDeviceIdentityId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/WindowsAutopilotDeviceIdentitiesRequestBuilder.cs b/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/WindowsAutopilotDeviceIdentitiesRequestBuilder.cs index df3620955e8..fea3bf38018 100644 --- a/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/WindowsAutopilotDeviceIdentitiesRequestBuilder.cs +++ b/src/generated/DeviceManagement/WindowsAutopilotDeviceIdentities/WindowsAutopilotDeviceIdentitiesRequestBuilder.cs @@ -39,12 +39,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The Windows autopilot device identities contained collection."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,24 +66,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The Windows autopilot device identities contained collection."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/WindowsInformationProtectionAppLearningSummaries/Item/WindowsInformationProtectionAppLearningSummaryRequestBuilder.cs b/src/generated/DeviceManagement/WindowsInformationProtectionAppLearningSummaries/Item/WindowsInformationProtectionAppLearningSummaryRequestBuilder.cs index a59a48d75d2..7687c9416a1 100644 --- a/src/generated/DeviceManagement/WindowsInformationProtectionAppLearningSummaries/Item/WindowsInformationProtectionAppLearningSummaryRequestBuilder.cs +++ b/src/generated/DeviceManagement/WindowsInformationProtectionAppLearningSummaries/Item/WindowsInformationProtectionAppLearningSummaryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The windows information protection app learning summaries."; // Create options for all the parameters - command.AddOption(new Option("--windowsinformationprotectionapplearningsummary-id", description: "key: id of windowsInformationProtectionAppLearningSummary")); + var windowsInformationProtectionAppLearningSummaryIdOption = new Option("--windowsinformationprotectionapplearningsummary-id", description: "key: id of windowsInformationProtectionAppLearningSummary"); + windowsInformationProtectionAppLearningSummaryIdOption.IsRequired = true; + command.AddOption(windowsInformationProtectionAppLearningSummaryIdOption); command.Handler = CommandHandler.Create(async (windowsInformationProtectionAppLearningSummaryId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(windowsInformationProtectionAppLearningSummaryId)) requestInfo.PathParameters.Add("windowsInformationProtectionAppLearningSummary_id", windowsInformationProtectionAppLearningSummaryId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The windows information protection app learning summaries."; // Create options for all the parameters - command.AddOption(new Option("--windowsinformationprotectionapplearningsummary-id", description: "key: id of windowsInformationProtectionAppLearningSummary")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (windowsInformationProtectionAppLearningSummaryId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(windowsInformationProtectionAppLearningSummaryId)) requestInfo.PathParameters.Add("windowsInformationProtectionAppLearningSummary_id", windowsInformationProtectionAppLearningSummaryId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var windowsInformationProtectionAppLearningSummaryIdOption = new Option("--windowsinformationprotectionapplearningsummary-id", description: "key: id of windowsInformationProtectionAppLearningSummary"); + windowsInformationProtectionAppLearningSummaryIdOption.IsRequired = true; + command.AddOption(windowsInformationProtectionAppLearningSummaryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (windowsInformationProtectionAppLearningSummaryId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The windows information protection app learning summaries."; // Create options for all the parameters - command.AddOption(new Option("--windowsinformationprotectionapplearningsummary-id", description: "key: id of windowsInformationProtectionAppLearningSummary")); - command.AddOption(new Option("--body")); + var windowsInformationProtectionAppLearningSummaryIdOption = new Option("--windowsinformationprotectionapplearningsummary-id", description: "key: id of windowsInformationProtectionAppLearningSummary"); + windowsInformationProtectionAppLearningSummaryIdOption.IsRequired = true; + command.AddOption(windowsInformationProtectionAppLearningSummaryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (windowsInformationProtectionAppLearningSummaryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(windowsInformationProtectionAppLearningSummaryId)) requestInfo.PathParameters.Add("windowsInformationProtectionAppLearningSummary_id", windowsInformationProtectionAppLearningSummaryId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/WindowsInformationProtectionAppLearningSummaries/WindowsInformationProtectionAppLearningSummariesRequestBuilder.cs b/src/generated/DeviceManagement/WindowsInformationProtectionAppLearningSummaries/WindowsInformationProtectionAppLearningSummariesRequestBuilder.cs index 34d32ac5b92..da25b26fc42 100644 --- a/src/generated/DeviceManagement/WindowsInformationProtectionAppLearningSummaries/WindowsInformationProtectionAppLearningSummariesRequestBuilder.cs +++ b/src/generated/DeviceManagement/WindowsInformationProtectionAppLearningSummaries/WindowsInformationProtectionAppLearningSummariesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The windows information protection app learning summaries."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The windows information protection app learning summaries."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DeviceManagement/WindowsInformationProtectionNetworkLearningSummaries/Item/WindowsInformationProtectionNetworkLearningSummaryRequestBuilder.cs b/src/generated/DeviceManagement/WindowsInformationProtectionNetworkLearningSummaries/Item/WindowsInformationProtectionNetworkLearningSummaryRequestBuilder.cs index 432612ac4a7..ae74f5e76a9 100644 --- a/src/generated/DeviceManagement/WindowsInformationProtectionNetworkLearningSummaries/Item/WindowsInformationProtectionNetworkLearningSummaryRequestBuilder.cs +++ b/src/generated/DeviceManagement/WindowsInformationProtectionNetworkLearningSummaries/Item/WindowsInformationProtectionNetworkLearningSummaryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The windows information protection network learning summaries."; // Create options for all the parameters - command.AddOption(new Option("--windowsinformationprotectionnetworklearningsummary-id", description: "key: id of windowsInformationProtectionNetworkLearningSummary")); + var windowsInformationProtectionNetworkLearningSummaryIdOption = new Option("--windowsinformationprotectionnetworklearningsummary-id", description: "key: id of windowsInformationProtectionNetworkLearningSummary"); + windowsInformationProtectionNetworkLearningSummaryIdOption.IsRequired = true; + command.AddOption(windowsInformationProtectionNetworkLearningSummaryIdOption); command.Handler = CommandHandler.Create(async (windowsInformationProtectionNetworkLearningSummaryId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(windowsInformationProtectionNetworkLearningSummaryId)) requestInfo.PathParameters.Add("windowsInformationProtectionNetworkLearningSummary_id", windowsInformationProtectionNetworkLearningSummaryId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The windows information protection network learning summaries."; // Create options for all the parameters - command.AddOption(new Option("--windowsinformationprotectionnetworklearningsummary-id", description: "key: id of windowsInformationProtectionNetworkLearningSummary")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (windowsInformationProtectionNetworkLearningSummaryId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(windowsInformationProtectionNetworkLearningSummaryId)) requestInfo.PathParameters.Add("windowsInformationProtectionNetworkLearningSummary_id", windowsInformationProtectionNetworkLearningSummaryId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var windowsInformationProtectionNetworkLearningSummaryIdOption = new Option("--windowsinformationprotectionnetworklearningsummary-id", description: "key: id of windowsInformationProtectionNetworkLearningSummary"); + windowsInformationProtectionNetworkLearningSummaryIdOption.IsRequired = true; + command.AddOption(windowsInformationProtectionNetworkLearningSummaryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (windowsInformationProtectionNetworkLearningSummaryId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The windows information protection network learning summaries."; // Create options for all the parameters - command.AddOption(new Option("--windowsinformationprotectionnetworklearningsummary-id", description: "key: id of windowsInformationProtectionNetworkLearningSummary")); - command.AddOption(new Option("--body")); + var windowsInformationProtectionNetworkLearningSummaryIdOption = new Option("--windowsinformationprotectionnetworklearningsummary-id", description: "key: id of windowsInformationProtectionNetworkLearningSummary"); + windowsInformationProtectionNetworkLearningSummaryIdOption.IsRequired = true; + command.AddOption(windowsInformationProtectionNetworkLearningSummaryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (windowsInformationProtectionNetworkLearningSummaryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(windowsInformationProtectionNetworkLearningSummaryId)) requestInfo.PathParameters.Add("windowsInformationProtectionNetworkLearningSummary_id", windowsInformationProtectionNetworkLearningSummaryId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DeviceManagement/WindowsInformationProtectionNetworkLearningSummaries/WindowsInformationProtectionNetworkLearningSummariesRequestBuilder.cs b/src/generated/DeviceManagement/WindowsInformationProtectionNetworkLearningSummaries/WindowsInformationProtectionNetworkLearningSummariesRequestBuilder.cs index 89d30f0c639..d5097ee00b3 100644 --- a/src/generated/DeviceManagement/WindowsInformationProtectionNetworkLearningSummaries/WindowsInformationProtectionNetworkLearningSummariesRequestBuilder.cs +++ b/src/generated/DeviceManagement/WindowsInformationProtectionNetworkLearningSummaries/WindowsInformationProtectionNetworkLearningSummariesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The windows information protection network learning summaries."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The windows information protection network learning summaries."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/DevicesRequestBuilder.cs b/src/generated/Devices/DevicesRequestBuilder.cs index ad32861dcea..a6a9ddae870 100644 --- a/src/generated/Devices/DevicesRequestBuilder.cs +++ b/src/generated/Devices/DevicesRequestBuilder.cs @@ -49,12 +49,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to devices"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,24 +88,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from devices"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs b/src/generated/Devices/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs index aab14691aa6..fd78d58cd8a 100644 --- a/src/generated/Devices/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs +++ b/src/generated/Devices/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getAvailableExtensionProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/GetByIds/GetByIdsRequestBuilder.cs b/src/generated/Devices/GetByIds/GetByIdsRequestBuilder.cs index 62d016f2810..418c0105dcb 100644 --- a/src/generated/Devices/GetByIds/GetByIdsRequestBuilder.cs +++ b/src/generated/Devices/GetByIds/GetByIdsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getByIds"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs b/src/generated/Devices/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs index aa7cf964849..a2928a44518 100644 --- a/src/generated/Devices/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs +++ b/src/generated/Devices/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--body")); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs b/src/generated/Devices/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs index 3910a675937..c6515da97a9 100644 --- a/src/generated/Devices/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs +++ b/src/generated/Devices/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--body")); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/Item/DeviceRequestBuilder.cs b/src/generated/Devices/Item/DeviceRequestBuilder.cs index 1874b3acf08..1f406b3ce91 100644 --- a/src/generated/Devices/Item/DeviceRequestBuilder.cs +++ b/src/generated/Devices/Item/DeviceRequestBuilder.cs @@ -48,10 +48,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from devices"; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); command.Handler = CommandHandler.Create(async (deviceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -72,14 +74,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from devices by key"; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -117,14 +127,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in devices"; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--body")); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Devices/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Devices/Item/Extensions/ExtensionsRequestBuilder.cs index 6b70ca10269..3f4136471af 100644 --- a/src/generated/Devices/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Devices/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the device. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--body")); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the device. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Devices/Item/Extensions/Item/ExtensionRequestBuilder.cs index 6bbb4a79fee..503af427726 100644 --- a/src/generated/Devices/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Devices/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the device. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (deviceId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the device. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the device. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Devices/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs b/src/generated/Devices/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs index be7412cc5a3..7aed5ae5f6f 100644 --- a/src/generated/Devices/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs +++ b/src/generated/Devices/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--body")); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs b/src/generated/Devices/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs index 6b413d5e1ad..7ecb6a78d72 100644 --- a/src/generated/Devices/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs +++ b/src/generated/Devices/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--body")); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/Item/MemberOf/@Ref/RefRequestBuilder.cs b/src/generated/Devices/Item/MemberOf/@Ref/RefRequestBuilder.cs index 730ed5532ac..2d6b6bd29d2 100644 --- a/src/generated/Devices/Item/MemberOf/@Ref/RefRequestBuilder.cs +++ b/src/generated/Devices/Item/MemberOf/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Groups that this device is a member of. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Groups that this device is a member of. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--body")); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/Item/MemberOf/MemberOfRequestBuilder.cs b/src/generated/Devices/Item/MemberOf/MemberOfRequestBuilder.cs index 28a6bfa1f5b..f968eda1e83 100644 --- a/src/generated/Devices/Item/MemberOf/MemberOfRequestBuilder.cs +++ b/src/generated/Devices/Item/MemberOf/MemberOfRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Groups that this device is a member of. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/Item/RegisteredOwners/@Ref/RefRequestBuilder.cs b/src/generated/Devices/Item/RegisteredOwners/@Ref/RefRequestBuilder.cs index 5a64bf6a9f9..9e63e7cbc29 100644 --- a/src/generated/Devices/Item/RegisteredOwners/@Ref/RefRequestBuilder.cs +++ b/src/generated/Devices/Item/RegisteredOwners/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user that cloud joined the device or registered their personal device. The registered owner is set at the time of registration. Currently, there can be only one owner. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The user that cloud joined the device or registered their personal device. The registered owner is set at the time of registration. Currently, there can be only one owner. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--body")); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/Item/RegisteredOwners/RegisteredOwnersRequestBuilder.cs b/src/generated/Devices/Item/RegisteredOwners/RegisteredOwnersRequestBuilder.cs index 8bdd5f8240b..64ed0a164b1 100644 --- a/src/generated/Devices/Item/RegisteredOwners/RegisteredOwnersRequestBuilder.cs +++ b/src/generated/Devices/Item/RegisteredOwners/RegisteredOwnersRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user that cloud joined the device or registered their personal device. The registered owner is set at the time of registration. Currently, there can be only one owner. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/Item/RegisteredUsers/@Ref/RefRequestBuilder.cs b/src/generated/Devices/Item/RegisteredUsers/@Ref/RefRequestBuilder.cs index 1f31451d167..2f93f249b46 100644 --- a/src/generated/Devices/Item/RegisteredUsers/@Ref/RefRequestBuilder.cs +++ b/src/generated/Devices/Item/RegisteredUsers/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of registered users of the device. For cloud joined devices and registered personal devices, registered users are set to the same value as registered owners at the time of registration. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Collection of registered users of the device. For cloud joined devices and registered personal devices, registered users are set to the same value as registered owners at the time of registration. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--body")); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/Item/RegisteredUsers/RegisteredUsersRequestBuilder.cs b/src/generated/Devices/Item/RegisteredUsers/RegisteredUsersRequestBuilder.cs index a372a7557e0..36149f5eb48 100644 --- a/src/generated/Devices/Item/RegisteredUsers/RegisteredUsersRequestBuilder.cs +++ b/src/generated/Devices/Item/RegisteredUsers/RegisteredUsersRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of registered users of the device. For cloud joined devices and registered personal devices, registered users are set to the same value as registered owners at the time of registration. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/Item/Restore/RestoreRequestBuilder.cs b/src/generated/Devices/Item/Restore/RestoreRequestBuilder.cs index 10e621b9ffb..a273c88835a 100644 --- a/src/generated/Devices/Item/Restore/RestoreRequestBuilder.cs +++ b/src/generated/Devices/Item/Restore/RestoreRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restore"; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); command.Handler = CommandHandler.Create(async (deviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Devices/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs b/src/generated/Devices/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs index ec6ba9ba2aa..e24c479439e 100644 --- a/src/generated/Devices/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs +++ b/src/generated/Devices/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs @@ -19,28 +19,43 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Groups that the device is a member of. This operation is transitive. Supports $expand. + /// Groups that this device is a member of. This operation is transitive. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Groups that the device is a member of. This operation is transitive. Supports $expand."; + command.Description = "Groups that this device is a member of. This operation is transitive. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -53,20 +68,24 @@ public Command BuildGetCommand() { return command; } /// - /// Groups that the device is a member of. This operation is transitive. Supports $expand. + /// Groups that this device is a member of. This operation is transitive. Supports $expand. /// public Command BuildPostCommand() { var command = new Command("post"); - command.Description = "Groups that the device is a member of. This operation is transitive. Supports $expand."; + command.Description = "Groups that this device is a member of. This operation is transitive. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--body")); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,7 +111,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// Groups that the device is a member of. This operation is transitive. Supports $expand. + /// Groups that this device is a member of. This operation is transitive. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -113,7 +132,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Groups that the device is a member of. This operation is transitive. Supports $expand. + /// Groups that this device is a member of. This operation is transitive. Supports $expand. /// /// Request headers /// Request options @@ -131,7 +150,7 @@ public RequestInformation CreatePostRequestInformation(ApiSdk.Devices.Item.Trans return requestInfo; } /// - /// Groups that the device is a member of. This operation is transitive. Supports $expand. + /// Groups that this device is a member of. This operation is transitive. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -143,7 +162,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Groups that the device is a member of. This operation is transitive. Supports $expand. + /// Groups that this device is a member of. This operation is transitive. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -155,7 +174,7 @@ public async Task GetAsync(Action q = default, var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Groups that the device is a member of. This operation is transitive. Supports $expand. + /// Groups that this device is a member of. This operation is transitive. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Devices/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs b/src/generated/Devices/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs index 1889fd029ef..42b7cab8496 100644 --- a/src/generated/Devices/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs +++ b/src/generated/Devices/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs @@ -20,32 +20,53 @@ public class TransitiveMemberOfRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Groups that the device is a member of. This operation is transitive. Supports $expand. + /// Groups that this device is a member of. This operation is transitive. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Groups that the device is a member of. This operation is transitive. Supports $expand."; + command.Description = "Groups that this device is a member of. This operation is transitive. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--device-id", description: "key: id of device")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceId)) requestInfo.PathParameters.Add("device_id", deviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceIdOption = new Option("--device-id", description: "key: id of device"); + deviceIdOption.IsRequired = true; + command.AddOption(deviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,7 +99,7 @@ public TransitiveMemberOfRequestBuilder(Dictionary pathParameter RequestAdapter = requestAdapter; } /// - /// Groups that the device is a member of. This operation is transitive. Supports $expand. + /// Groups that this device is a member of. This operation is transitive. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -99,7 +120,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Groups that the device is a member of. This operation is transitive. Supports $expand. + /// Groups that this device is a member of. This operation is transitive. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -110,7 +131,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } - /// Groups that the device is a member of. This operation is transitive. Supports $expand. + /// Groups that this device is a member of. This operation is transitive. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Devices/ValidateProperties/ValidatePropertiesRequestBuilder.cs b/src/generated/Devices/ValidateProperties/ValidatePropertiesRequestBuilder.cs index 182ec8fc9e1..6b5bde90a53 100644 --- a/src/generated/Devices/ValidateProperties/ValidatePropertiesRequestBuilder.cs +++ b/src/generated/Devices/ValidateProperties/ValidatePropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validateProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Directory/AdministrativeUnits/AdministrativeUnitsRequestBuilder.cs b/src/generated/Directory/AdministrativeUnits/AdministrativeUnitsRequestBuilder.cs index e9f6452e3c3..b44df7efc22 100644 --- a/src/generated/Directory/AdministrativeUnits/AdministrativeUnitsRequestBuilder.cs +++ b/src/generated/Directory/AdministrativeUnits/AdministrativeUnitsRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Conceptual container for user and group directory objects."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +67,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Conceptual container for user and group directory objects."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Directory/AdministrativeUnits/Delta/DeltaRequestBuilder.cs b/src/generated/Directory/AdministrativeUnits/Delta/DeltaRequestBuilder.cs index a429a864e91..b703f01391d 100644 --- a/src/generated/Directory/AdministrativeUnits/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Directory/AdministrativeUnits/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Directory/AdministrativeUnits/Item/AdministrativeUnitRequestBuilder.cs b/src/generated/Directory/AdministrativeUnits/Item/AdministrativeUnitRequestBuilder.cs index dc7747eee61..f3f598df8ed 100644 --- a/src/generated/Directory/AdministrativeUnits/Item/AdministrativeUnitRequestBuilder.cs +++ b/src/generated/Directory/AdministrativeUnits/Item/AdministrativeUnitRequestBuilder.cs @@ -29,10 +29,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Conceptual container for user and group directory objects."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); command.Handler = CommandHandler.Create(async (administrativeUnitId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,14 +55,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Conceptual container for user and group directory objects."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (administrativeUnitId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (administrativeUnitId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,14 +96,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Conceptual container for user and group directory objects."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--body")); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (administrativeUnitId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Directory/AdministrativeUnits/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Directory/AdministrativeUnits/Item/Extensions/ExtensionsRequestBuilder.cs index 6ee0e796c96..efea927beaf 100644 --- a/src/generated/Directory/AdministrativeUnits/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Directory/AdministrativeUnits/Item/Extensions/ExtensionsRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The collection of open extensions defined for this Administrative Unit. Nullable."; + command.Description = "The collection of open extensions defined for this administrative unit. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--body")); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (administrativeUnitId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,32 +60,53 @@ public Command BuildCreateCommand() { return command; } /// - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The collection of open extensions defined for this Administrative Unit. Nullable."; + command.Description = "The collection of open extensions defined for this administrative unit. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (administrativeUnitId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (administrativeUnitId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,7 +132,7 @@ public ExtensionsRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// Request headers /// Request options /// Request query parameters @@ -128,7 +153,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// /// Request headers /// Request options @@ -146,7 +171,7 @@ public RequestInformation CreatePostRequestInformation(Extension body, Action - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -158,7 +183,7 @@ public async Task GetAsync(Action q = de return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -170,7 +195,7 @@ public async Task PostAsync(Extension model, Action(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Directory/AdministrativeUnits/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Directory/AdministrativeUnits/Item/Extensions/Item/ExtensionRequestBuilder.cs index ebedf8ab9ff..0dc21765785 100644 --- a/src/generated/Directory/AdministrativeUnits/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Directory/AdministrativeUnits/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -20,18 +20,21 @@ public class ExtensionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The collection of open extensions defined for this Administrative Unit. Nullable."; + command.Description = "The collection of open extensions defined for this administrative unit. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (administrativeUnitId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The collection of open extensions defined for this Administrative Unit. Nullable."; + command.Description = "The collection of open extensions defined for this administrative unit. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (administrativeUnitId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (administrativeUnitId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The collection of open extensions defined for this Administrative Unit. Nullable."; + command.Description = "The collection of open extensions defined for this administrative unit. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (administrativeUnitId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public ExtensionRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(Extension body, Action - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = default, Ac return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(Extension model, Action var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Directory/AdministrativeUnits/Item/Members/@Ref/RefRequestBuilder.cs b/src/generated/Directory/AdministrativeUnits/Item/Members/@Ref/RefRequestBuilder.cs index a972895ce18..47616ea211b 100644 --- a/src/generated/Directory/AdministrativeUnits/Item/Members/@Ref/RefRequestBuilder.cs +++ b/src/generated/Directory/AdministrativeUnits/Item/Members/@Ref/RefRequestBuilder.cs @@ -19,28 +19,43 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). + /// Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members)."; + command.Description = "Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members)."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (administrativeUnitId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (administrativeUnitId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -53,20 +68,24 @@ public Command BuildGetCommand() { return command; } /// - /// Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). + /// Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). /// public Command BuildPostCommand() { var command = new Command("post"); - command.Description = "Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members)."; + command.Description = "Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members)."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--body")); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (administrativeUnitId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,7 +111,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). + /// Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). /// Request headers /// Request options /// Request query parameters @@ -113,7 +132,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). + /// Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). /// /// Request headers /// Request options @@ -131,7 +150,7 @@ public RequestInformation CreatePostRequestInformation(ApiSdk.Directory.Administ return requestInfo; } /// - /// Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). + /// Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -143,7 +162,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). + /// Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). /// Cancellation token to use when cancelling requests /// Request headers /// @@ -155,7 +174,7 @@ public async Task GetAsync(Action q = default, var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). + /// Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Directory/AdministrativeUnits/Item/Members/MembersRequestBuilder.cs b/src/generated/Directory/AdministrativeUnits/Item/Members/MembersRequestBuilder.cs index 4aa9af26bc5..5fc9525b006 100644 --- a/src/generated/Directory/AdministrativeUnits/Item/Members/MembersRequestBuilder.cs +++ b/src/generated/Directory/AdministrativeUnits/Item/Members/MembersRequestBuilder.cs @@ -20,32 +20,53 @@ public class MembersRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). + /// Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members)."; + command.Description = "Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members)."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (administrativeUnitId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (administrativeUnitId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,7 +99,7 @@ public MembersRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). + /// Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). /// Request headers /// Request options /// Request query parameters @@ -99,7 +120,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). + /// Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -110,7 +131,7 @@ public async Task GetAsync(Action q = defau var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). + /// Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Directory/AdministrativeUnits/Item/ScopedRoleMembers/Item/ScopedRoleMembershipRequestBuilder.cs b/src/generated/Directory/AdministrativeUnits/Item/ScopedRoleMembers/Item/ScopedRoleMembershipRequestBuilder.cs index bfaf060580a..2351717895e 100644 --- a/src/generated/Directory/AdministrativeUnits/Item/ScopedRoleMembers/Item/ScopedRoleMembershipRequestBuilder.cs +++ b/src/generated/Directory/AdministrativeUnits/Item/ScopedRoleMembers/Item/ScopedRoleMembershipRequestBuilder.cs @@ -20,18 +20,21 @@ public class ScopedRoleMembershipRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership)."; + command.Description = "Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership)."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); command.Handler = CommandHandler.Create(async (administrativeUnitId, scopedRoleMembershipId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership)."; + command.Description = "Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership)."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (administrativeUnitId, scopedRoleMembershipId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (administrativeUnitId, scopedRoleMembershipId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership)."; + command.Description = "Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership)."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); - command.AddOption(new Option("--body")); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (administrativeUnitId, scopedRoleMembershipId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public ScopedRoleMembershipRequestBuilder(Dictionary pathParamet RequestAdapter = requestAdapter; } /// - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(ScopedRoleMembership bod return requestInfo; } /// - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(ScopedRoleMembership model, ActionScoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Directory/AdministrativeUnits/Item/ScopedRoleMembers/ScopedRoleMembersRequestBuilder.cs b/src/generated/Directory/AdministrativeUnits/Item/ScopedRoleMembers/ScopedRoleMembersRequestBuilder.cs index 1b86789569f..387e75d063c 100644 --- a/src/generated/Directory/AdministrativeUnits/Item/ScopedRoleMembers/ScopedRoleMembersRequestBuilder.cs +++ b/src/generated/Directory/AdministrativeUnits/Item/ScopedRoleMembers/ScopedRoleMembersRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership)."; + command.Description = "Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership)."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--body")); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (administrativeUnitId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,32 +60,53 @@ public Command BuildCreateCommand() { return command; } /// - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership)."; + command.Description = "Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership)."; // Create options for all the parameters - command.AddOption(new Option("--administrativeunit-id", description: "key: id of administrativeUnit")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (administrativeUnitId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(administrativeUnitId)) requestInfo.PathParameters.Add("administrativeUnit_id", administrativeUnitId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var administrativeUnitIdOption = new Option("--administrativeunit-id", description: "key: id of administrativeUnit"); + administrativeUnitIdOption.IsRequired = true; + command.AddOption(administrativeUnitIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (administrativeUnitId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,7 +132,7 @@ public ScopedRoleMembersRequestBuilder(Dictionary pathParameters RequestAdapter = requestAdapter; } /// - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// Request headers /// Request options /// Request query parameters @@ -128,7 +153,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// /// Request headers /// Request options @@ -146,7 +171,7 @@ public RequestInformation CreatePostRequestInformation(ScopedRoleMembership body return requestInfo; } /// - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -158,7 +183,7 @@ public async Task GetAsync(Action return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). /// Cancellation token to use when cancelling requests /// Request headers /// @@ -170,7 +195,7 @@ public async Task PostAsync(ScopedRoleMembership model, Ac var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Directory/DeletedItems/DeletedItemsRequestBuilder.cs b/src/generated/Directory/DeletedItems/DeletedItemsRequestBuilder.cs index 2857c6d66a3..c2a57c464bf 100644 --- a/src/generated/Directory/DeletedItems/DeletedItemsRequestBuilder.cs +++ b/src/generated/Directory/DeletedItems/DeletedItemsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Recently deleted items. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Recently deleted items. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Directory/DeletedItems/Item/DirectoryObjectRequestBuilder.cs b/src/generated/Directory/DeletedItems/Item/DirectoryObjectRequestBuilder.cs index 66f96e90dee..852f40ddd60 100644 --- a/src/generated/Directory/DeletedItems/Item/DirectoryObjectRequestBuilder.cs +++ b/src/generated/Directory/DeletedItems/Item/DirectoryObjectRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Recently deleted items. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); command.Handler = CommandHandler.Create(async (directoryObjectId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Recently deleted items. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (directoryObjectId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (directoryObjectId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Recently deleted items. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); - command.AddOption(new Option("--body")); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryObjectId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Directory/DirectoryRequestBuilder.cs b/src/generated/Directory/DirectoryRequestBuilder.cs index 87c9fa25000..02c124c5464 100644 --- a/src/generated/Directory/DirectoryRequestBuilder.cs +++ b/src/generated/Directory/DirectoryRequestBuilder.cs @@ -42,12 +42,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get directory"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,12 +73,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update directory"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DirectoryObjects/DirectoryObjectsRequestBuilder.cs b/src/generated/DirectoryObjects/DirectoryObjectsRequestBuilder.cs index a6b9e3e361e..54cbedec3be 100644 --- a/src/generated/DirectoryObjects/DirectoryObjectsRequestBuilder.cs +++ b/src/generated/DirectoryObjects/DirectoryObjectsRequestBuilder.cs @@ -44,12 +44,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to directoryObjects"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,24 +83,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from directoryObjects"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryObjects/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs b/src/generated/DirectoryObjects/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs index 3005b426d9d..63fc3e8405e 100644 --- a/src/generated/DirectoryObjects/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs +++ b/src/generated/DirectoryObjects/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getAvailableExtensionProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryObjects/GetByIds/GetByIdsRequestBuilder.cs b/src/generated/DirectoryObjects/GetByIds/GetByIdsRequestBuilder.cs index 5b0c0d464cf..f7d85ae8ad4 100644 --- a/src/generated/DirectoryObjects/GetByIds/GetByIdsRequestBuilder.cs +++ b/src/generated/DirectoryObjects/GetByIds/GetByIdsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getByIds"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryObjects/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs b/src/generated/DirectoryObjects/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs index 192e5247b7d..70cf42e026e 100644 --- a/src/generated/DirectoryObjects/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs +++ b/src/generated/DirectoryObjects/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); - command.AddOption(new Option("--body")); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryObjectId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryObjects/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs b/src/generated/DirectoryObjects/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs index d086dd873f3..dd3660089b7 100644 --- a/src/generated/DirectoryObjects/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs +++ b/src/generated/DirectoryObjects/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); - command.AddOption(new Option("--body")); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryObjectId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryObjects/Item/DirectoryObjectRequestBuilder.cs b/src/generated/DirectoryObjects/Item/DirectoryObjectRequestBuilder.cs index 2bee147cf2f..1dcf973e11c 100644 --- a/src/generated/DirectoryObjects/Item/DirectoryObjectRequestBuilder.cs +++ b/src/generated/DirectoryObjects/Item/DirectoryObjectRequestBuilder.cs @@ -43,10 +43,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from directoryObjects"; // Create options for all the parameters - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); command.Handler = CommandHandler.Create(async (directoryObjectId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -60,14 +62,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from directoryObjects by key"; // Create options for all the parameters - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (directoryObjectId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (directoryObjectId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,14 +108,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in directoryObjects"; // Create options for all the parameters - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); - command.AddOption(new Option("--body")); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryObjectId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DirectoryObjects/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs b/src/generated/DirectoryObjects/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs index e9d66203c69..3cae19253e8 100644 --- a/src/generated/DirectoryObjects/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs +++ b/src/generated/DirectoryObjects/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); - command.AddOption(new Option("--body")); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryObjectId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryObjects/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs b/src/generated/DirectoryObjects/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs index 0c17e22c4bd..db3492d492c 100644 --- a/src/generated/DirectoryObjects/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs +++ b/src/generated/DirectoryObjects/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); - command.AddOption(new Option("--body")); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryObjectId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryObjects/Item/Restore/RestoreRequestBuilder.cs b/src/generated/DirectoryObjects/Item/Restore/RestoreRequestBuilder.cs index fc027a1aed8..b4a8c8a30f8 100644 --- a/src/generated/DirectoryObjects/Item/Restore/RestoreRequestBuilder.cs +++ b/src/generated/DirectoryObjects/Item/Restore/RestoreRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restore"; // Create options for all the parameters - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); command.Handler = CommandHandler.Create(async (directoryObjectId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryObjects/ValidateProperties/ValidatePropertiesRequestBuilder.cs b/src/generated/DirectoryObjects/ValidateProperties/ValidatePropertiesRequestBuilder.cs index f73d343609a..254a540eda5 100644 --- a/src/generated/DirectoryObjects/ValidateProperties/ValidatePropertiesRequestBuilder.cs +++ b/src/generated/DirectoryObjects/ValidateProperties/ValidatePropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validateProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DirectoryRoleTemplates/DirectoryRoleTemplatesRequestBuilder.cs b/src/generated/DirectoryRoleTemplates/DirectoryRoleTemplatesRequestBuilder.cs index 216a4e72ee0..0fc9beaae44 100644 --- a/src/generated/DirectoryRoleTemplates/DirectoryRoleTemplatesRequestBuilder.cs +++ b/src/generated/DirectoryRoleTemplates/DirectoryRoleTemplatesRequestBuilder.cs @@ -44,12 +44,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to directoryRoleTemplates"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +83,40 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from directoryRoleTemplates"; // Create options for all the parameters - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoleTemplates/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs b/src/generated/DirectoryRoleTemplates/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs index 0a996bc002e..18867df7d0e 100644 --- a/src/generated/DirectoryRoleTemplates/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs +++ b/src/generated/DirectoryRoleTemplates/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getAvailableExtensionProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoleTemplates/GetByIds/GetByIdsRequestBuilder.cs b/src/generated/DirectoryRoleTemplates/GetByIds/GetByIdsRequestBuilder.cs index bb5ab0f5ccd..500702b86c3 100644 --- a/src/generated/DirectoryRoleTemplates/GetByIds/GetByIdsRequestBuilder.cs +++ b/src/generated/DirectoryRoleTemplates/GetByIds/GetByIdsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getByIds"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoleTemplates/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs b/src/generated/DirectoryRoleTemplates/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs index 654de2072f0..e3c537fdffd 100644 --- a/src/generated/DirectoryRoleTemplates/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs +++ b/src/generated/DirectoryRoleTemplates/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate")); - command.AddOption(new Option("--body")); + var directoryRoleTemplateIdOption = new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate"); + directoryRoleTemplateIdOption.IsRequired = true; + command.AddOption(directoryRoleTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryRoleTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(directoryRoleTemplateId)) requestInfo.PathParameters.Add("directoryRoleTemplate_id", directoryRoleTemplateId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoleTemplates/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs b/src/generated/DirectoryRoleTemplates/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs index b3d4101871f..3bb17e86679 100644 --- a/src/generated/DirectoryRoleTemplates/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs +++ b/src/generated/DirectoryRoleTemplates/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate")); - command.AddOption(new Option("--body")); + var directoryRoleTemplateIdOption = new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate"); + directoryRoleTemplateIdOption.IsRequired = true; + command.AddOption(directoryRoleTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryRoleTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(directoryRoleTemplateId)) requestInfo.PathParameters.Add("directoryRoleTemplate_id", directoryRoleTemplateId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoleTemplates/Item/DirectoryRoleTemplateRequestBuilder.cs b/src/generated/DirectoryRoleTemplates/Item/DirectoryRoleTemplateRequestBuilder.cs index 4bbb6bdf8f1..16480c5be53 100644 --- a/src/generated/DirectoryRoleTemplates/Item/DirectoryRoleTemplateRequestBuilder.cs +++ b/src/generated/DirectoryRoleTemplates/Item/DirectoryRoleTemplateRequestBuilder.cs @@ -43,10 +43,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from directoryRoleTemplates"; // Create options for all the parameters - command.AddOption(new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate")); + var directoryRoleTemplateIdOption = new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate"); + directoryRoleTemplateIdOption.IsRequired = true; + command.AddOption(directoryRoleTemplateIdOption); command.Handler = CommandHandler.Create(async (directoryRoleTemplateId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(directoryRoleTemplateId)) requestInfo.PathParameters.Add("directoryRoleTemplate_id", directoryRoleTemplateId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -60,14 +62,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from directoryRoleTemplates by key"; // Create options for all the parameters - command.AddOption(new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (directoryRoleTemplateId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(directoryRoleTemplateId)) requestInfo.PathParameters.Add("directoryRoleTemplate_id", directoryRoleTemplateId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var directoryRoleTemplateIdOption = new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate"); + directoryRoleTemplateIdOption.IsRequired = true; + command.AddOption(directoryRoleTemplateIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (directoryRoleTemplateId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,14 +108,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in directoryRoleTemplates"; // Create options for all the parameters - command.AddOption(new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate")); - command.AddOption(new Option("--body")); + var directoryRoleTemplateIdOption = new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate"); + directoryRoleTemplateIdOption.IsRequired = true; + command.AddOption(directoryRoleTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryRoleTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(directoryRoleTemplateId)) requestInfo.PathParameters.Add("directoryRoleTemplate_id", directoryRoleTemplateId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DirectoryRoleTemplates/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs b/src/generated/DirectoryRoleTemplates/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs index a956a0240e9..7ecd4d9e2c2 100644 --- a/src/generated/DirectoryRoleTemplates/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs +++ b/src/generated/DirectoryRoleTemplates/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate")); - command.AddOption(new Option("--body")); + var directoryRoleTemplateIdOption = new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate"); + directoryRoleTemplateIdOption.IsRequired = true; + command.AddOption(directoryRoleTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryRoleTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(directoryRoleTemplateId)) requestInfo.PathParameters.Add("directoryRoleTemplate_id", directoryRoleTemplateId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoleTemplates/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs b/src/generated/DirectoryRoleTemplates/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs index 153400981d3..fff04850454 100644 --- a/src/generated/DirectoryRoleTemplates/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs +++ b/src/generated/DirectoryRoleTemplates/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate")); - command.AddOption(new Option("--body")); + var directoryRoleTemplateIdOption = new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate"); + directoryRoleTemplateIdOption.IsRequired = true; + command.AddOption(directoryRoleTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryRoleTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(directoryRoleTemplateId)) requestInfo.PathParameters.Add("directoryRoleTemplate_id", directoryRoleTemplateId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoleTemplates/Item/Restore/RestoreRequestBuilder.cs b/src/generated/DirectoryRoleTemplates/Item/Restore/RestoreRequestBuilder.cs index a8add1c2ed2..b8acc2f3125 100644 --- a/src/generated/DirectoryRoleTemplates/Item/Restore/RestoreRequestBuilder.cs +++ b/src/generated/DirectoryRoleTemplates/Item/Restore/RestoreRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restore"; // Create options for all the parameters - command.AddOption(new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate")); + var directoryRoleTemplateIdOption = new Option("--directoryroletemplate-id", description: "key: id of directoryRoleTemplate"); + directoryRoleTemplateIdOption.IsRequired = true; + command.AddOption(directoryRoleTemplateIdOption); command.Handler = CommandHandler.Create(async (directoryRoleTemplateId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(directoryRoleTemplateId)) requestInfo.PathParameters.Add("directoryRoleTemplate_id", directoryRoleTemplateId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoleTemplates/ValidateProperties/ValidatePropertiesRequestBuilder.cs b/src/generated/DirectoryRoleTemplates/ValidateProperties/ValidatePropertiesRequestBuilder.cs index 8c69635d312..7357142f1a5 100644 --- a/src/generated/DirectoryRoleTemplates/ValidateProperties/ValidatePropertiesRequestBuilder.cs +++ b/src/generated/DirectoryRoleTemplates/ValidateProperties/ValidatePropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validateProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DirectoryRoles/Delta/DeltaRequestBuilder.cs b/src/generated/DirectoryRoles/Delta/DeltaRequestBuilder.cs index 196481d08a4..5e2654844cc 100644 --- a/src/generated/DirectoryRoles/Delta/DeltaRequestBuilder.cs +++ b/src/generated/DirectoryRoles/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoles/DirectoryRolesRequestBuilder.cs b/src/generated/DirectoryRoles/DirectoryRolesRequestBuilder.cs index 640563653b6..4fe436a0981 100644 --- a/src/generated/DirectoryRoles/DirectoryRolesRequestBuilder.cs +++ b/src/generated/DirectoryRoles/DirectoryRolesRequestBuilder.cs @@ -47,12 +47,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to directoryRoles"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,22 +86,40 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from directoryRoles"; // Create options for all the parameters - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoles/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs b/src/generated/DirectoryRoles/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs index d56e21faf15..c786f79f2fb 100644 --- a/src/generated/DirectoryRoles/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs +++ b/src/generated/DirectoryRoles/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getAvailableExtensionProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoles/GetByIds/GetByIdsRequestBuilder.cs b/src/generated/DirectoryRoles/GetByIds/GetByIdsRequestBuilder.cs index a4d69e4fe4b..b5836609df8 100644 --- a/src/generated/DirectoryRoles/GetByIds/GetByIdsRequestBuilder.cs +++ b/src/generated/DirectoryRoles/GetByIds/GetByIdsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getByIds"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoles/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs b/src/generated/DirectoryRoles/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs index 948c33d2895..76e678a6f9a 100644 --- a/src/generated/DirectoryRoles/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs +++ b/src/generated/DirectoryRoles/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); - command.AddOption(new Option("--body")); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryRoleId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoles/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs b/src/generated/DirectoryRoles/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs index 0de54adf907..e97436ed41a 100644 --- a/src/generated/DirectoryRoles/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs +++ b/src/generated/DirectoryRoles/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); - command.AddOption(new Option("--body")); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryRoleId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoles/Item/DirectoryRoleRequestBuilder.cs b/src/generated/DirectoryRoles/Item/DirectoryRoleRequestBuilder.cs index 18247ea17a9..2afec6a4fc6 100644 --- a/src/generated/DirectoryRoles/Item/DirectoryRoleRequestBuilder.cs +++ b/src/generated/DirectoryRoles/Item/DirectoryRoleRequestBuilder.cs @@ -45,10 +45,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from directoryRoles"; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); command.Handler = CommandHandler.Create(async (directoryRoleId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,14 +64,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from directoryRoles by key"; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (directoryRoleId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (directoryRoleId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,14 +117,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in directoryRoles"; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); - command.AddOption(new Option("--body")); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryRoleId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DirectoryRoles/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs b/src/generated/DirectoryRoles/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs index 5874cd02195..bd902d0da2c 100644 --- a/src/generated/DirectoryRoles/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs +++ b/src/generated/DirectoryRoles/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); - command.AddOption(new Option("--body")); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryRoleId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoles/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs b/src/generated/DirectoryRoles/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs index aac2280452c..46f7b534123 100644 --- a/src/generated/DirectoryRoles/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs +++ b/src/generated/DirectoryRoles/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); - command.AddOption(new Option("--body")); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryRoleId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoles/Item/Members/@Ref/RefRequestBuilder.cs b/src/generated/DirectoryRoles/Item/Members/@Ref/RefRequestBuilder.cs index 96fc8633797..44c782311d4 100644 --- a/src/generated/DirectoryRoles/Item/Members/@Ref/RefRequestBuilder.cs +++ b/src/generated/DirectoryRoles/Item/Members/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Users that are members of this directory role. HTTP Methods: GET, POST, DELETE. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (directoryRoleId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (directoryRoleId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Users that are members of this directory role. HTTP Methods: GET, POST, DELETE. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); - command.AddOption(new Option("--body")); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryRoleId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoles/Item/Members/MembersRequestBuilder.cs b/src/generated/DirectoryRoles/Item/Members/MembersRequestBuilder.cs index 57dfc9b8d41..8afa2ca0872 100644 --- a/src/generated/DirectoryRoles/Item/Members/MembersRequestBuilder.cs +++ b/src/generated/DirectoryRoles/Item/Members/MembersRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Users that are members of this directory role. HTTP Methods: GET, POST, DELETE. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (directoryRoleId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (directoryRoleId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoles/Item/Restore/RestoreRequestBuilder.cs b/src/generated/DirectoryRoles/Item/Restore/RestoreRequestBuilder.cs index f403090775f..f939bff731d 100644 --- a/src/generated/DirectoryRoles/Item/Restore/RestoreRequestBuilder.cs +++ b/src/generated/DirectoryRoles/Item/Restore/RestoreRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restore"; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); command.Handler = CommandHandler.Create(async (directoryRoleId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoles/Item/ScopedMembers/Item/ScopedRoleMembershipRequestBuilder.cs b/src/generated/DirectoryRoles/Item/ScopedMembers/Item/ScopedRoleMembershipRequestBuilder.cs index 52b5e7645a0..dff50bcb8e6 100644 --- a/src/generated/DirectoryRoles/Item/ScopedMembers/Item/ScopedRoleMembershipRequestBuilder.cs +++ b/src/generated/DirectoryRoles/Item/ScopedMembers/Item/ScopedRoleMembershipRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Members of this directory role that are scoped to administrative units. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); command.Handler = CommandHandler.Create(async (directoryRoleId, scopedRoleMembershipId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Members of this directory role that are scoped to administrative units. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (directoryRoleId, scopedRoleMembershipId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (directoryRoleId, scopedRoleMembershipId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Members of this directory role that are scoped to administrative units. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); - command.AddOption(new Option("--body")); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryRoleId, scopedRoleMembershipId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DirectoryRoles/Item/ScopedMembers/ScopedMembersRequestBuilder.cs b/src/generated/DirectoryRoles/Item/ScopedMembers/ScopedMembersRequestBuilder.cs index a1fe247762a..47c3c207c7d 100644 --- a/src/generated/DirectoryRoles/Item/ScopedMembers/ScopedMembersRequestBuilder.cs +++ b/src/generated/DirectoryRoles/Item/ScopedMembers/ScopedMembersRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Members of this directory role that are scoped to administrative units. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); - command.AddOption(new Option("--body")); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (directoryRoleId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Members of this directory role that are scoped to administrative units. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--directoryrole-id", description: "key: id of directoryRole")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (directoryRoleId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(directoryRoleId)) requestInfo.PathParameters.Add("directoryRole_id", directoryRoleId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var directoryRoleIdOption = new Option("--directoryrole-id", description: "key: id of directoryRole"); + directoryRoleIdOption.IsRequired = true; + command.AddOption(directoryRoleIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (directoryRoleId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DirectoryRoles/ValidateProperties/ValidatePropertiesRequestBuilder.cs b/src/generated/DirectoryRoles/ValidateProperties/ValidatePropertiesRequestBuilder.cs index 3fa0393dcbc..84e246eda39 100644 --- a/src/generated/DirectoryRoles/ValidateProperties/ValidatePropertiesRequestBuilder.cs +++ b/src/generated/DirectoryRoles/ValidateProperties/ValidatePropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validateProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/DomainDnsRecords/DomainDnsRecordsRequestBuilder.cs b/src/generated/DomainDnsRecords/DomainDnsRecordsRequestBuilder.cs index ed009b1f53a..23e0cbcf79c 100644 --- a/src/generated/DomainDnsRecords/DomainDnsRecordsRequestBuilder.cs +++ b/src/generated/DomainDnsRecords/DomainDnsRecordsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to domainDnsRecords"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from domainDnsRecords"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/DomainDnsRecords/Item/DomainDnsRecordRequestBuilder.cs b/src/generated/DomainDnsRecords/Item/DomainDnsRecordRequestBuilder.cs index 04134cc4c1e..306b34a66b8 100644 --- a/src/generated/DomainDnsRecords/Item/DomainDnsRecordRequestBuilder.cs +++ b/src/generated/DomainDnsRecords/Item/DomainDnsRecordRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from domainDnsRecords"; // Create options for all the parameters - command.AddOption(new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord")); + var domainDnsRecordIdOption = new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord"); + domainDnsRecordIdOption.IsRequired = true; + command.AddOption(domainDnsRecordIdOption); command.Handler = CommandHandler.Create(async (domainDnsRecordId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(domainDnsRecordId)) requestInfo.PathParameters.Add("domainDnsRecord_id", domainDnsRecordId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from domainDnsRecords by key"; // Create options for all the parameters - command.AddOption(new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (domainDnsRecordId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(domainDnsRecordId)) requestInfo.PathParameters.Add("domainDnsRecord_id", domainDnsRecordId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var domainDnsRecordIdOption = new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord"); + domainDnsRecordIdOption.IsRequired = true; + command.AddOption(domainDnsRecordIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (domainDnsRecordId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in domainDnsRecords"; // Create options for all the parameters - command.AddOption(new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord")); - command.AddOption(new Option("--body")); + var domainDnsRecordIdOption = new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord"); + domainDnsRecordIdOption.IsRequired = true; + command.AddOption(domainDnsRecordIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (domainDnsRecordId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(domainDnsRecordId)) requestInfo.PathParameters.Add("domainDnsRecord_id", domainDnsRecordId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Domains/DomainsRequestBuilder.cs b/src/generated/Domains/DomainsRequestBuilder.cs index b4f6811dc32..a4ad451b001 100644 --- a/src/generated/Domains/DomainsRequestBuilder.cs +++ b/src/generated/Domains/DomainsRequestBuilder.cs @@ -41,12 +41,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to domains"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,24 +68,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from domains"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Domains/Item/DomainNameReferences/@Ref/RefRequestBuilder.cs b/src/generated/Domains/Item/DomainNameReferences/@Ref/RefRequestBuilder.cs index 060e63b36d3..56def423233 100644 --- a/src/generated/Domains/Item/DomainNameReferences/@Ref/RefRequestBuilder.cs +++ b/src/generated/Domains/Item/DomainNameReferences/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only, Nullable"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (domainId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (domainId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Read-only, Nullable"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--body")); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (domainId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Domains/Item/DomainNameReferences/DomainNameReferencesRequestBuilder.cs b/src/generated/Domains/Item/DomainNameReferences/DomainNameReferencesRequestBuilder.cs index 723efd81a91..452352d7db5 100644 --- a/src/generated/Domains/Item/DomainNameReferences/DomainNameReferencesRequestBuilder.cs +++ b/src/generated/Domains/Item/DomainNameReferences/DomainNameReferencesRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only, Nullable"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (domainId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (domainId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Domains/Item/DomainRequestBuilder.cs b/src/generated/Domains/Item/DomainRequestBuilder.cs index 7c989b2a193..5e733060a5f 100644 --- a/src/generated/Domains/Item/DomainRequestBuilder.cs +++ b/src/generated/Domains/Item/DomainRequestBuilder.cs @@ -31,10 +31,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from domains"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); command.Handler = CommandHandler.Create(async (domainId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,14 +63,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from domains by key"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (domainId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (domainId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,14 +97,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in domains"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--body")); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (domainId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Domains/Item/ForceDelete/ForceDeleteRequestBuilder.cs b/src/generated/Domains/Item/ForceDelete/ForceDeleteRequestBuilder.cs index 2c268c5a9bf..8f622d0bf62 100644 --- a/src/generated/Domains/Item/ForceDelete/ForceDeleteRequestBuilder.cs +++ b/src/generated/Domains/Item/ForceDelete/ForceDeleteRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forceDelete"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--body")); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (domainId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Domains/Item/ServiceConfigurationRecords/Item/DomainDnsRecordRequestBuilder.cs b/src/generated/Domains/Item/ServiceConfigurationRecords/Item/DomainDnsRecordRequestBuilder.cs index 639c48513de..03a626bca2d 100644 --- a/src/generated/Domains/Item/ServiceConfigurationRecords/Item/DomainDnsRecordRequestBuilder.cs +++ b/src/generated/Domains/Item/ServiceConfigurationRecords/Item/DomainDnsRecordRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "DNS records the customer adds to the DNS zone file of the domain before the domain can be used by Microsoft Online services. Read-only, Nullable"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord")); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var domainDnsRecordIdOption = new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord"); + domainDnsRecordIdOption.IsRequired = true; + command.AddOption(domainDnsRecordIdOption); command.Handler = CommandHandler.Create(async (domainId, domainDnsRecordId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); - if (!String.IsNullOrEmpty(domainDnsRecordId)) requestInfo.PathParameters.Add("domainDnsRecord_id", domainDnsRecordId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "DNS records the customer adds to the DNS zone file of the domain before the domain can be used by Microsoft Online services. Read-only, Nullable"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (domainId, domainDnsRecordId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); - if (!String.IsNullOrEmpty(domainDnsRecordId)) requestInfo.PathParameters.Add("domainDnsRecord_id", domainDnsRecordId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var domainDnsRecordIdOption = new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord"); + domainDnsRecordIdOption.IsRequired = true; + command.AddOption(domainDnsRecordIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (domainId, domainDnsRecordId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "DNS records the customer adds to the DNS zone file of the domain before the domain can be used by Microsoft Online services. Read-only, Nullable"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord")); - command.AddOption(new Option("--body")); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var domainDnsRecordIdOption = new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord"); + domainDnsRecordIdOption.IsRequired = true; + command.AddOption(domainDnsRecordIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (domainId, domainDnsRecordId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); - if (!String.IsNullOrEmpty(domainDnsRecordId)) requestInfo.PathParameters.Add("domainDnsRecord_id", domainDnsRecordId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Domains/Item/ServiceConfigurationRecords/ServiceConfigurationRecordsRequestBuilder.cs b/src/generated/Domains/Item/ServiceConfigurationRecords/ServiceConfigurationRecordsRequestBuilder.cs index 7c6b17a808f..bd1d9e57fe9 100644 --- a/src/generated/Domains/Item/ServiceConfigurationRecords/ServiceConfigurationRecordsRequestBuilder.cs +++ b/src/generated/Domains/Item/ServiceConfigurationRecords/ServiceConfigurationRecordsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "DNS records the customer adds to the DNS zone file of the domain before the domain can be used by Microsoft Online services. Read-only, Nullable"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--body")); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (domainId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "DNS records the customer adds to the DNS zone file of the domain before the domain can be used by Microsoft Online services. Read-only, Nullable"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (domainId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (domainId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Domains/Item/VerificationDnsRecords/Item/DomainDnsRecordRequestBuilder.cs b/src/generated/Domains/Item/VerificationDnsRecords/Item/DomainDnsRecordRequestBuilder.cs index f330036a565..04bd451a281 100644 --- a/src/generated/Domains/Item/VerificationDnsRecords/Item/DomainDnsRecordRequestBuilder.cs +++ b/src/generated/Domains/Item/VerificationDnsRecords/Item/DomainDnsRecordRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "DNS records that the customer adds to the DNS zone file of the domain before the customer can complete domain ownership verification with Azure AD. Read-only, Nullable"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord")); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var domainDnsRecordIdOption = new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord"); + domainDnsRecordIdOption.IsRequired = true; + command.AddOption(domainDnsRecordIdOption); command.Handler = CommandHandler.Create(async (domainId, domainDnsRecordId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); - if (!String.IsNullOrEmpty(domainDnsRecordId)) requestInfo.PathParameters.Add("domainDnsRecord_id", domainDnsRecordId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "DNS records that the customer adds to the DNS zone file of the domain before the customer can complete domain ownership verification with Azure AD. Read-only, Nullable"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (domainId, domainDnsRecordId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); - if (!String.IsNullOrEmpty(domainDnsRecordId)) requestInfo.PathParameters.Add("domainDnsRecord_id", domainDnsRecordId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var domainDnsRecordIdOption = new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord"); + domainDnsRecordIdOption.IsRequired = true; + command.AddOption(domainDnsRecordIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (domainId, domainDnsRecordId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "DNS records that the customer adds to the DNS zone file of the domain before the customer can complete domain ownership verification with Azure AD. Read-only, Nullable"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord")); - command.AddOption(new Option("--body")); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var domainDnsRecordIdOption = new Option("--domaindnsrecord-id", description: "key: id of domainDnsRecord"); + domainDnsRecordIdOption.IsRequired = true; + command.AddOption(domainDnsRecordIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (domainId, domainDnsRecordId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); - if (!String.IsNullOrEmpty(domainDnsRecordId)) requestInfo.PathParameters.Add("domainDnsRecord_id", domainDnsRecordId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Domains/Item/VerificationDnsRecords/VerificationDnsRecordsRequestBuilder.cs b/src/generated/Domains/Item/VerificationDnsRecords/VerificationDnsRecordsRequestBuilder.cs index 8fc622199b8..e5ee227890a 100644 --- a/src/generated/Domains/Item/VerificationDnsRecords/VerificationDnsRecordsRequestBuilder.cs +++ b/src/generated/Domains/Item/VerificationDnsRecords/VerificationDnsRecordsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "DNS records that the customer adds to the DNS zone file of the domain before the customer can complete domain ownership verification with Azure AD. Read-only, Nullable"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--body")); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (domainId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "DNS records that the customer adds to the DNS zone file of the domain before the customer can complete domain ownership verification with Azure AD. Read-only, Nullable"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (domainId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (domainId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Domains/Item/Verify/VerifyRequestBuilder.cs b/src/generated/Domains/Item/Verify/VerifyRequestBuilder.cs index dde46337834..69cab5409ce 100644 --- a/src/generated/Domains/Item/Verify/VerifyRequestBuilder.cs +++ b/src/generated/Domains/Item/Verify/VerifyRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action verify"; // Create options for all the parameters - command.AddOption(new Option("--domain-id", description: "key: id of domain")); + var domainIdOption = new Option("--domain-id", description: "key: id of domain"); + domainIdOption.IsRequired = true; + command.AddOption(domainIdOption); command.Handler = CommandHandler.Create(async (domainId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(domainId)) requestInfo.PathParameters.Add("domain_id", domainId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/Bundles/BundlesRequestBuilder.cs b/src/generated/Drive/Bundles/BundlesRequestBuilder.cs index 86f4612dc7c..3ef0bdaf3a7 100644 --- a/src/generated/Drive/Bundles/BundlesRequestBuilder.cs +++ b/src/generated/Drive/Bundles/BundlesRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of [bundles][bundle] (albums and multi-select-shared sets of items). Only in personal OneDrive."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of [bundles][bundle] (albums and multi-select-shared sets of items). Only in personal OneDrive."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/Bundles/Item/Content/ContentRequestBuilder.cs b/src/generated/Drive/Bundles/Item/Content/ContentRequestBuilder.cs index 47900870bbb..72de24c0bb1 100644 --- a/src/generated/Drive/Bundles/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Drive/Bundles/Item/Content/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property bundles from drive"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (driveItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property bundles in drive"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (driveItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/Bundles/Item/DriveItemRequestBuilder.cs b/src/generated/Drive/Bundles/Item/DriveItemRequestBuilder.cs index 43c3ddd1573..188c3aeaaaa 100644 --- a/src/generated/Drive/Bundles/Item/DriveItemRequestBuilder.cs +++ b/src/generated/Drive/Bundles/Item/DriveItemRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of [bundles][bundle] (albums and multi-select-shared sets of items). Only in personal OneDrive."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of [bundles][bundle] (albums and multi-select-shared sets of items). Only in personal OneDrive."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of [bundles][bundle] (albums and multi-select-shared sets of items). Only in personal OneDrive."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/DriveRequestBuilder.cs b/src/generated/Drive/DriveRequestBuilder.cs index 4d464d8ce2f..faf3fb51eaf 100644 --- a/src/generated/Drive/DriveRequestBuilder.cs +++ b/src/generated/Drive/DriveRequestBuilder.cs @@ -49,12 +49,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get drive"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -93,12 +100,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update drive"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/Following/FollowingRequestBuilder.cs b/src/generated/Drive/Following/FollowingRequestBuilder.cs index f2167a6188f..20ebafe96f3 100644 --- a/src/generated/Drive/Following/FollowingRequestBuilder.cs +++ b/src/generated/Drive/Following/FollowingRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of items the user is following. Only in OneDrive for Business."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of items the user is following. Only in OneDrive for Business."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/Following/Item/Content/ContentRequestBuilder.cs b/src/generated/Drive/Following/Item/Content/ContentRequestBuilder.cs index 9e3dd3ad877..221ce91d86e 100644 --- a/src/generated/Drive/Following/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Drive/Following/Item/Content/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property following from drive"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (driveItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property following in drive"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (driveItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/Following/Item/DriveItemRequestBuilder.cs b/src/generated/Drive/Following/Item/DriveItemRequestBuilder.cs index 2cd42a20100..805fd5559db 100644 --- a/src/generated/Drive/Following/Item/DriveItemRequestBuilder.cs +++ b/src/generated/Drive/Following/Item/DriveItemRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of items the user is following. Only in OneDrive for Business."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of items the user is following. Only in OneDrive for Business."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of items the user is following. Only in OneDrive for Business."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/Items/Item/Content/ContentRequestBuilder.cs b/src/generated/Drive/Items/Item/Content/ContentRequestBuilder.cs index edb037b6cb1..8319eb492f7 100644 --- a/src/generated/Drive/Items/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Drive/Items/Item/Content/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property items from drive"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (driveItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property items in drive"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (driveItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/Items/Item/DriveItemRequestBuilder.cs b/src/generated/Drive/Items/Item/DriveItemRequestBuilder.cs index 70920190b45..63a0407d0bc 100644 --- a/src/generated/Drive/Items/Item/DriveItemRequestBuilder.cs +++ b/src/generated/Drive/Items/Item/DriveItemRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All items contained in the drive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All items contained in the drive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All items contained in the drive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/Items/ItemsRequestBuilder.cs b/src/generated/Drive/Items/ItemsRequestBuilder.cs index fae788eacb5..482c551aa4b 100644 --- a/src/generated/Drive/Items/ItemsRequestBuilder.cs +++ b/src/generated/Drive/Items/ItemsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All items contained in the drive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All items contained in the drive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/Columns/ColumnsRequestBuilder.cs b/src/generated/Drive/List/Columns/ColumnsRequestBuilder.cs index 934bdd65793..8492cd4aaea 100644 --- a/src/generated/Drive/List/Columns/ColumnsRequestBuilder.cs +++ b/src/generated/Drive/List/Columns/ColumnsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/Columns/Item/ColumnDefinitionRequestBuilder.cs b/src/generated/Drive/List/Columns/Item/ColumnDefinitionRequestBuilder.cs index a40688159cb..fe286ad0590 100644 --- a/src/generated/Drive/List/Columns/Item/ColumnDefinitionRequestBuilder.cs +++ b/src/generated/Drive/List/Columns/Item/ColumnDefinitionRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,14 +80,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs b/src/generated/Drive/List/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs index d9617a20fe7..dcadd73580e 100644 --- a/src/generated/Drive/List/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs +++ b/src/generated/Drive/List/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs @@ -19,16 +19,18 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -36,16 +38,18 @@ public Command BuildDeleteCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (columnDefinitionId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,20 +62,24 @@ public Command BuildGetCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -92,7 +100,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -107,7 +115,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -122,7 +130,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// /// Request headers /// Request options @@ -140,7 +148,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.Drive.List.Columns. return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -151,7 +159,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +170,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/Drive/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs b/src/generated/Drive/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs index 68c373ba5d8..3e19b157999 100644 --- a/src/generated/Drive/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs +++ b/src/generated/Drive/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs @@ -21,20 +21,28 @@ public class SourceColumnRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,7 +76,7 @@ public SourceColumnRequestBuilder(Dictionary pathParameters, IRe RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// Request query parameters @@ -89,7 +97,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -100,7 +108,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The source column for the content type column. + /// The source column for content type column. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Drive/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs index da2f391901c..547d92dabdb 100644 --- a/src/generated/Drive/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addCopy"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/ContentTypes/ContentTypesRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/ContentTypesRequestBuilder.cs index dcaa71c039f..a8239ba4996 100644 --- a/src/generated/Drive/List/ContentTypes/ContentTypesRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/ContentTypesRequestBuilder.cs @@ -52,12 +52,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,24 +79,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs index 77246143063..54854faac96 100644 --- a/src/generated/Drive/List/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (contentTypeId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs index 37c0f00359f..85b4171d611 100644 --- a/src/generated/Drive/List/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action associateWithHubSites"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/ContentTypes/Item/@Base/BaseRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/@Base/BaseRequestBuilder.cs index d7b47049b3e..1e2138ea460 100644 --- a/src/generated/Drive/List/ContentTypes/Item/@Base/BaseRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/@Base/BaseRequestBuilder.cs @@ -44,14 +44,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contentTypeId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contentTypeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs index 4baa98477c8..01748390fc4 100644 --- a/src/generated/Drive/List/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToDefaultContentLocation"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs index a9fe3fe735c..18b642cef8a 100644 --- a/src/generated/Drive/List/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function isPublished"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs index a121e991bbf..a9199c24595 100644 --- a/src/generated/Drive/List/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action publish"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs index 9d32bb361df..ab183ba244f 100644 --- a/src/generated/Drive/List/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unpublish"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs index 56481eacd21..0ba880c5a80 100644 --- a/src/generated/Drive/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action associateWithHubSites"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs index b4874a19527..97c786661e7 100644 --- a/src/generated/Drive/List/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (contentTypeId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (contentTypeId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs index a2012e4ab62..c87737873de 100644 --- a/src/generated/Drive/List/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addCopy"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs index e83d178a06b..e052063c12d 100644 --- a/src/generated/Drive/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs @@ -33,26 +33,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs index b4019f9fc7f..364622cf00a 100644 --- a/src/generated/Drive/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,32 +60,53 @@ public Command BuildCreateCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,7 +132,7 @@ public ColumnLinksRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// Request query parameters @@ -128,7 +153,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// /// Request headers /// Request options @@ -146,7 +171,7 @@ public RequestInformation CreatePostRequestInformation(ColumnLink body, Action - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -158,7 +183,7 @@ public async Task GetAsync(Action q = d return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// @@ -170,7 +195,7 @@ public async Task PostAsync(ColumnLink model, Action(requestInfo, responseHandler, cancellationToken); } - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Drive/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs index 9622ab54109..2f586fab524 100644 --- a/src/generated/Drive/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs @@ -20,18 +20,21 @@ public class ColumnLinkRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); command.Handler = CommandHandler.Create(async (contentTypeId, columnLinkId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contentTypeId, columnLinkId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contentTypeId, columnLinkId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); - command.AddOption(new Option("--body")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contentTypeId, columnLinkId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public ColumnLinkRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(ColumnLink body, Action< return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = default, A return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(ColumnLink model, ActionThe collection of columns that are required by this content type. + /// The collection of columns that are required by this content type public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Drive/List/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs index 0bb14c3378f..e83c36a8ff7 100644 --- a/src/generated/Drive/List/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (contentTypeId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (contentTypeId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs index 5028e9db453..9fe1f5251f8 100644 --- a/src/generated/Drive/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs index 6f38749089c..0b8d73305a9 100644 --- a/src/generated/Drive/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs index e7e77726457..5960dba6aa9 100644 --- a/src/generated/Drive/List/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (contentTypeId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contentTypeId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contentTypeId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contentTypeId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs index bd5e9246c85..1c04d81804e 100644 --- a/src/generated/Drive/List/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs @@ -19,18 +19,21 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (contentTypeId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -38,18 +41,21 @@ public Command BuildDeleteCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (contentTypeId, columnDefinitionId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +68,27 @@ public Command BuildGetCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contentTypeId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -98,7 +109,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -113,7 +124,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -128,7 +139,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// /// Request headers /// Request options @@ -146,7 +157,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.Drive.List.ContentT return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -157,7 +168,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +179,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/Drive/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs index ba56be0ea64..cb7e5358707 100644 --- a/src/generated/Drive/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs @@ -21,22 +21,31 @@ public class SourceColumnRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contentTypeId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contentTypeId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,7 +79,7 @@ public SourceColumnRequestBuilder(Dictionary pathParameters, IRe RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// Request query parameters @@ -91,7 +100,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -102,7 +111,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The source column for the content type column. + /// The source column for content type column. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Drive/List/ContentTypes/Item/ContentTypeRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/ContentTypeRequestBuilder.cs index eb861ce9e0e..33cd7d46bb3 100644 --- a/src/generated/Drive/List/ContentTypes/Item/ContentTypeRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/ContentTypeRequestBuilder.cs @@ -88,10 +88,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (contentTypeId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -105,14 +107,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contentTypeId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contentTypeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -131,14 +141,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs index 8da830b09ad..189a6ea7458 100644 --- a/src/generated/Drive/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToDefaultContentLocation"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs index c40f1ead2f1..60013accf46 100644 --- a/src/generated/Drive/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function isPublished"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs index bbde659a21c..2a4802b684f 100644 --- a/src/generated/Drive/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action publish"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs b/src/generated/Drive/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs index f4e281dfdd2..b1dbc2af2c9 100644 --- a/src/generated/Drive/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs +++ b/src/generated/Drive/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unpublish"; // Create options for all the parameters - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/Drive/DriveRequestBuilder.cs b/src/generated/Drive/List/Drive/DriveRequestBuilder.cs index 799d4ee971a..ef7d7edaa30 100644 --- a/src/generated/Drive/List/Drive/DriveRequestBuilder.cs +++ b/src/generated/Drive/List/Drive/DriveRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildDeleteCommand() { command.Description = "Only present on document libraries. Allows access to the list as a [drive][] resource with [driveItems][driveItem]."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,12 +42,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Only present on document libraries. Allows access to the list as a [drive][] resource with [driveItems][driveItem]."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,12 +73,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Only present on document libraries. Allows access to the list as a [drive][] resource with [driveItems][driveItem]."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/Items/Item/Analytics/@Ref/RefRequestBuilder.cs b/src/generated/Drive/List/Items/Item/Analytics/@Ref/RefRequestBuilder.cs index 7f4807c1029..a441b66e7ce 100644 --- a/src/generated/Drive/List/Items/Item/Analytics/@Ref/RefRequestBuilder.cs +++ b/src/generated/Drive/List/Items/Item/Analytics/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (listItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs b/src/generated/Drive/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs index 771d0fb5835..affde4ca93b 100644 --- a/src/generated/Drive/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs +++ b/src/generated/Drive/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs b/src/generated/Drive/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs index 8fbd9d61bc1..8a9321b920b 100644 --- a/src/generated/Drive/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs +++ b/src/generated/Drive/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property driveItem from drive"; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (listItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property driveItem in drive"; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (listItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs b/src/generated/Drive/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs index c8442ea2ceb..638e4d1af36 100644 --- a/src/generated/Drive/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs +++ b/src/generated/Drive/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/Items/Item/Fields/FieldsRequestBuilder.cs b/src/generated/Drive/List/Items/Item/Fields/FieldsRequestBuilder.cs index 956c3aec1a8..ceb4845a52f 100644 --- a/src/generated/Drive/List/Items/Item/Fields/FieldsRequestBuilder.cs +++ b/src/generated/Drive/List/Items/Item/Fields/FieldsRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs b/src/generated/Drive/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs index 465345b9777..07987d50188 100644 --- a/src/generated/Drive/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs +++ b/src/generated/Drive/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (listItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs b/src/generated/Drive/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs index f9c50b90750..80de5742b90 100644 --- a/src/generated/Drive/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs +++ b/src/generated/Drive/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}")); - command.AddOption(new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}")); - command.AddOption(new Option("--interval", description: "Usage: interval={interval}")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var intervalOption = new Option("--interval", description: "Usage: interval={interval}"); + intervalOption.IsRequired = true; + command.AddOption(intervalOption); command.Handler = CommandHandler.Create(async (listItemId, startDateTime, endDateTime, interval) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.PathParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.PathParameters.Add("endDateTime", endDateTime); - if (!String.IsNullOrEmpty(interval)) requestInfo.PathParameters.Add("interval", interval); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/Items/Item/ListItemRequestBuilder.cs b/src/generated/Drive/List/Items/Item/ListItemRequestBuilder.cs index 18b304828b9..f3065c209aa 100644 --- a/src/generated/Drive/List/Items/Item/ListItemRequestBuilder.cs +++ b/src/generated/Drive/List/Items/Item/ListItemRequestBuilder.cs @@ -39,10 +39,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -73,14 +75,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,14 +109,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs b/src/generated/Drive/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs index b51a047cf49..06974456995 100644 --- a/src/generated/Drive/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs +++ b/src/generated/Drive/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (listItemId, listItemVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (listItemId, listItemVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (listItemId, listItemVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--body")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (listItemId, listItemVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs b/src/generated/Drive/List/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs index 907d8581075..f1cc86d1eda 100644 --- a/src/generated/Drive/List/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs +++ b/src/generated/Drive/List/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs @@ -28,12 +28,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (listItemId, listItemVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,16 +58,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (listItemId, listItemVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (listItemId, listItemVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,16 +95,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--body")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (listItemId, listItemVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs b/src/generated/Drive/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs index 0432515a947..842e81b408f 100644 --- a/src/generated/Drive/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs +++ b/src/generated/Drive/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restoreVersion"; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (listItemId, listItemVersionId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/Items/Item/Versions/VersionsRequestBuilder.cs b/src/generated/Drive/List/Items/Item/Versions/VersionsRequestBuilder.cs index 2b354af1a3f..41ba796772e 100644 --- a/src/generated/Drive/List/Items/Item/Versions/VersionsRequestBuilder.cs +++ b/src/generated/Drive/List/Items/Item/Versions/VersionsRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +68,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (listItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (listItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/Items/ItemsRequestBuilder.cs b/src/generated/Drive/List/Items/ItemsRequestBuilder.cs index a0f9f3c21d2..5e7a1bffe1a 100644 --- a/src/generated/Drive/List/Items/ItemsRequestBuilder.cs +++ b/src/generated/Drive/List/Items/ItemsRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +67,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/List/ListRequestBuilder.cs b/src/generated/Drive/List/ListRequestBuilder.cs index 523ee9fc362..eb4424a2c45 100644 --- a/src/generated/Drive/List/ListRequestBuilder.cs +++ b/src/generated/Drive/List/ListRequestBuilder.cs @@ -47,7 +47,8 @@ public Command BuildDeleteCommand() { command.Description = "For drives in SharePoint, the underlying document library list. Read-only. Nullable."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -69,12 +70,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "For drives in SharePoint, the underlying document library list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -100,12 +108,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "For drives in SharePoint, the underlying document library list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/Subscriptions/Item/SubscriptionRequestBuilder.cs b/src/generated/Drive/List/Subscriptions/Item/SubscriptionRequestBuilder.cs index 415f451333f..7eb807f91c0 100644 --- a/src/generated/Drive/List/Subscriptions/Item/SubscriptionRequestBuilder.cs +++ b/src/generated/Drive/List/Subscriptions/Item/SubscriptionRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); command.Handler = CommandHandler.Create(async (subscriptionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (subscriptionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (subscriptionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); - command.AddOption(new Option("--body")); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (subscriptionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/List/Subscriptions/SubscriptionsRequestBuilder.cs b/src/generated/Drive/List/Subscriptions/SubscriptionsRequestBuilder.cs index 25e6e9dfe08..7eb14de0508 100644 --- a/src/generated/Drive/List/Subscriptions/SubscriptionsRequestBuilder.cs +++ b/src/generated/Drive/List/Subscriptions/SubscriptionsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/Recent/RecentRequestBuilder.cs b/src/generated/Drive/Recent/RecentRequestBuilder.cs index 0f4252f1965..c357a167226 100644 --- a/src/generated/Drive/Recent/RecentRequestBuilder.cs +++ b/src/generated/Drive/Recent/RecentRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function recent"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/Root/Content/ContentRequestBuilder.cs b/src/generated/Drive/Root/Content/ContentRequestBuilder.cs index 59822a5430d..befc5f61432 100644 --- a/src/generated/Drive/Root/Content/ContentRequestBuilder.cs +++ b/src/generated/Drive/Root/Content/ContentRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildGetCommand() { // Create options for all the parameters command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (output) => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -50,10 +51,13 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property root in drive"; // Create options for all the parameters - command.AddOption(new Option("--file", description: "Binary request body")); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/Root/RootRequestBuilder.cs b/src/generated/Drive/Root/RootRequestBuilder.cs index c49f1f259db..5dfc9a1e3aa 100644 --- a/src/generated/Drive/Root/RootRequestBuilder.cs +++ b/src/generated/Drive/Root/RootRequestBuilder.cs @@ -35,7 +35,8 @@ public Command BuildDeleteCommand() { command.Description = "The root folder of the drive. Read-only."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,12 +50,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The root folder of the drive. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,12 +81,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The root folder of the drive. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/SearchWithQ/SearchWithQRequestBuilder.cs b/src/generated/Drive/SearchWithQ/SearchWithQRequestBuilder.cs index 761eb45e80a..3cf2fe7e7bb 100644 --- a/src/generated/Drive/SearchWithQ/SearchWithQRequestBuilder.cs +++ b/src/generated/Drive/SearchWithQ/SearchWithQRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function search"; // Create options for all the parameters - command.AddOption(new Option("-q", description: "Usage: q={q}")); + var qOption = new Option("-q", description: "Usage: q={q}"); + qOption.IsRequired = true; + command.AddOption(qOption); command.Handler = CommandHandler.Create(async (q) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(q)) requestInfo.PathParameters.Add("q", q); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/SharedWithMe/SharedWithMeRequestBuilder.cs b/src/generated/Drive/SharedWithMe/SharedWithMeRequestBuilder.cs index 6882786c8b0..9542b1803ea 100644 --- a/src/generated/Drive/SharedWithMe/SharedWithMeRequestBuilder.cs +++ b/src/generated/Drive/SharedWithMe/SharedWithMeRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function sharedWithMe"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drive/Special/Item/Content/ContentRequestBuilder.cs b/src/generated/Drive/Special/Item/Content/ContentRequestBuilder.cs index 4cdc60445f1..081deb9455a 100644 --- a/src/generated/Drive/Special/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Drive/Special/Item/Content/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property special from drive"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (driveItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property special in drive"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (driveItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/Special/Item/DriveItemRequestBuilder.cs b/src/generated/Drive/Special/Item/DriveItemRequestBuilder.cs index 5bc96a6e0a0..74b93372faa 100644 --- a/src/generated/Drive/Special/Item/DriveItemRequestBuilder.cs +++ b/src/generated/Drive/Special/Item/DriveItemRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of common folders available in OneDrive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of common folders available in OneDrive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of common folders available in OneDrive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drive/Special/SpecialRequestBuilder.cs b/src/generated/Drive/Special/SpecialRequestBuilder.cs index 0922091d188..552cf42452e 100644 --- a/src/generated/Drive/Special/SpecialRequestBuilder.cs +++ b/src/generated/Drive/Special/SpecialRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of common folders available in OneDrive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of common folders available in OneDrive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/DrivesRequestBuilder.cs b/src/generated/Drives/DrivesRequestBuilder.cs index 37b1308d64f..ff8c28fed2c 100644 --- a/src/generated/Drives/DrivesRequestBuilder.cs +++ b/src/generated/Drives/DrivesRequestBuilder.cs @@ -42,12 +42,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to drives"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,24 +69,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from drives"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/Bundles/BundlesRequestBuilder.cs b/src/generated/Drives/Item/Bundles/BundlesRequestBuilder.cs index 8005bfb8263..38a1539f3f0 100644 --- a/src/generated/Drives/Item/Bundles/BundlesRequestBuilder.cs +++ b/src/generated/Drives/Item/Bundles/BundlesRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of [bundles][bundle] (albums and multi-select-shared sets of items). Only in personal OneDrive."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of [bundles][bundle] (albums and multi-select-shared sets of items). Only in personal OneDrive."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/Bundles/Item/Content/ContentRequestBuilder.cs b/src/generated/Drives/Item/Bundles/Item/Content/ContentRequestBuilder.cs index d6e846d73e9..85390a7653f 100644 --- a/src/generated/Drives/Item/Bundles/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Drives/Item/Bundles/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property bundles from drives"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (driveId, driveItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property bundles in drives"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (driveId, driveItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/Bundles/Item/DriveItemRequestBuilder.cs b/src/generated/Drives/Item/Bundles/Item/DriveItemRequestBuilder.cs index 4f7a629e197..5781e68689b 100644 --- a/src/generated/Drives/Item/Bundles/Item/DriveItemRequestBuilder.cs +++ b/src/generated/Drives/Item/Bundles/Item/DriveItemRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of [bundles][bundle] (albums and multi-select-shared sets of items). Only in personal OneDrive."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveId, driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of [bundles][bundle] (albums and multi-select-shared sets of items). Only in personal OneDrive."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of [bundles][bundle] (albums and multi-select-shared sets of items). Only in personal OneDrive."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/DriveRequestBuilder.cs b/src/generated/Drives/Item/DriveRequestBuilder.cs index 96c1f055c73..3b1705caa0a 100644 --- a/src/generated/Drives/Item/DriveRequestBuilder.cs +++ b/src/generated/Drives/Item/DriveRequestBuilder.cs @@ -42,10 +42,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from drives"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); command.Handler = CommandHandler.Create(async (driveId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,14 +68,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from drives by key"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,14 +122,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in drives"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/Following/FollowingRequestBuilder.cs b/src/generated/Drives/Item/Following/FollowingRequestBuilder.cs index be622c0be8c..b5cee49df61 100644 --- a/src/generated/Drives/Item/Following/FollowingRequestBuilder.cs +++ b/src/generated/Drives/Item/Following/FollowingRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of items the user is following. Only in OneDrive for Business."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of items the user is following. Only in OneDrive for Business."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/Following/Item/Content/ContentRequestBuilder.cs b/src/generated/Drives/Item/Following/Item/Content/ContentRequestBuilder.cs index d64e7acb0d1..0b286ad8d7c 100644 --- a/src/generated/Drives/Item/Following/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Drives/Item/Following/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property following from drives"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (driveId, driveItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property following in drives"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (driveId, driveItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/Following/Item/DriveItemRequestBuilder.cs b/src/generated/Drives/Item/Following/Item/DriveItemRequestBuilder.cs index 6014d941bc8..1364a1d0456 100644 --- a/src/generated/Drives/Item/Following/Item/DriveItemRequestBuilder.cs +++ b/src/generated/Drives/Item/Following/Item/DriveItemRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of items the user is following. Only in OneDrive for Business."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveId, driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of items the user is following. Only in OneDrive for Business."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of items the user is following. Only in OneDrive for Business."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/Items/Item/Content/ContentRequestBuilder.cs b/src/generated/Drives/Item/Items/Item/Content/ContentRequestBuilder.cs index ff4abe54cdc..c859dd39678 100644 --- a/src/generated/Drives/Item/Items/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Drives/Item/Items/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property items from drives"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (driveId, driveItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property items in drives"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (driveId, driveItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/Items/Item/DriveItemRequestBuilder.cs b/src/generated/Drives/Item/Items/Item/DriveItemRequestBuilder.cs index 3d074a88888..6ba24163d02 100644 --- a/src/generated/Drives/Item/Items/Item/DriveItemRequestBuilder.cs +++ b/src/generated/Drives/Item/Items/Item/DriveItemRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All items contained in the drive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveId, driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All items contained in the drive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All items contained in the drive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/Items/ItemsRequestBuilder.cs b/src/generated/Drives/Item/Items/ItemsRequestBuilder.cs index 4421a536bae..b22d45e4ec1 100644 --- a/src/generated/Drives/Item/Items/ItemsRequestBuilder.cs +++ b/src/generated/Drives/Item/Items/ItemsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All items contained in the drive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All items contained in the drive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/Columns/ColumnsRequestBuilder.cs b/src/generated/Drives/Item/List/Columns/ColumnsRequestBuilder.cs index 8706adb8e64..83f5f3f6050 100644 --- a/src/generated/Drives/Item/List/Columns/ColumnsRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Columns/ColumnsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/Columns/Item/ColumnDefinitionRequestBuilder.cs b/src/generated/Drives/Item/List/Columns/Item/ColumnDefinitionRequestBuilder.cs index b05089ef2d2..0767171e4be 100644 --- a/src/generated/Drives/Item/List/Columns/Item/ColumnDefinitionRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Columns/Item/ColumnDefinitionRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (driveId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs b/src/generated/Drives/Item/List/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs index 8fd85f962f8..987c2322818 100644 --- a/src/generated/Drives/Item/List/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs @@ -19,18 +19,21 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (driveId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -38,18 +41,21 @@ public Command BuildDeleteCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (driveId, columnDefinitionId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +68,27 @@ public Command BuildGetCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -98,7 +109,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -113,7 +124,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -128,7 +139,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// /// Request headers /// Request options @@ -146,7 +157,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.Drives.Item.List.Co return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -157,7 +168,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +179,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/Drives/Item/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs b/src/generated/Drives/Item/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs index ed59cf6955c..ca61257d620 100644 --- a/src/generated/Drives/Item/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs @@ -21,22 +21,31 @@ public class SourceColumnRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,7 +79,7 @@ public SourceColumnRequestBuilder(Dictionary pathParameters, IRe RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// Request query parameters @@ -91,7 +100,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -102,7 +111,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The source column for the content type column. + /// The source column for content type column. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Drives/Item/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs index eb887533c64..a003506dc90 100644 --- a/src/generated/Drives/Item/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addCopy"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/ContentTypes/ContentTypesRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/ContentTypesRequestBuilder.cs index b3a781e10bf..7ff82169da8 100644 --- a/src/generated/Drives/Item/List/ContentTypes/ContentTypesRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/ContentTypesRequestBuilder.cs @@ -52,14 +52,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,26 +82,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs index 7b9b2220e42..417ea26bfe5 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs index c3a566a05b4..ca43d75a480 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action associateWithHubSites"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/@Base/BaseRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/@Base/BaseRequestBuilder.cs index 5dc7401cd1e..9bdb548b562 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/@Base/BaseRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/@Base/BaseRequestBuilder.cs @@ -44,16 +44,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, contentTypeId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, contentTypeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs index bf41e5f009a..d05339438da 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToDefaultContentLocation"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs index a52d952edd1..374a8391a67 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function isPublished"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs index 4b405d81aac..5e4ebad0c61 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action publish"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs index 0eefd9599ed..9a59c3158df 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unpublish"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs index d5ab81d011b..8474b8c6444 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action associateWithHubSites"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs index f8df9c54078..186dc46b770 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs @@ -25,24 +25,40 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (driveId, contentTypeId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (driveId, contentTypeId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,16 +77,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs index b368443511e..7a6f5a87123 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addCopy"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs index 7485ee98bfe..a576845dd8e 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs @@ -33,28 +33,50 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs index 996a19c24b8..d7e32b13204 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs @@ -30,22 +30,27 @@ public List BuildCommand() { return commands; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,34 +63,56 @@ public Command BuildCreateCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -111,7 +138,7 @@ public ColumnLinksRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// Request query parameters @@ -132,7 +159,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// /// Request headers /// Request options @@ -150,7 +177,7 @@ public RequestInformation CreatePostRequestInformation(ColumnLink body, Action - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +189,7 @@ public async Task GetAsync(Action q = d return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// @@ -174,7 +201,7 @@ public async Task PostAsync(ColumnLink model, Action(requestInfo, responseHandler, cancellationToken); } - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs index b784b71c539..ed20a24ea44 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs @@ -20,20 +20,24 @@ public class ColumnLinkRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, columnLinkId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,24 +45,34 @@ public Command BuildDeleteCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, contentTypeId, columnLinkId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, contentTypeId, columnLinkId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,24 +85,30 @@ public Command BuildGetCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, columnLinkId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -109,7 +129,7 @@ public ColumnLinkRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// @@ -124,7 +144,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// Request query parameters @@ -145,7 +165,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// /// Request headers /// Request options @@ -163,7 +183,7 @@ public RequestInformation CreatePatchRequestInformation(ColumnLink body, Action< return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +194,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -186,7 +206,7 @@ public async Task GetAsync(Action q = default, A return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// @@ -198,7 +218,7 @@ public async Task PatchAsync(ColumnLink model, ActionThe collection of columns that are required by this content type. + /// The collection of columns that are required by this content type public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs index e680e1bb3f3..5657e35817a 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs @@ -25,24 +25,40 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (driveId, contentTypeId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (driveId, contentTypeId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,16 +77,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs index 5777803c33d..f97bac388a8 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs @@ -26,28 +26,50 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs index bb25fc3bcc3..2ab930a3b05 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,28 +70,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs index 0e127186ef9..800a1bd9c32 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, contentTypeId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, contentTypeId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,18 +92,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs index 49dd24e0eb4..1e74152ae8c 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs @@ -19,20 +19,24 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -40,20 +44,24 @@ public Command BuildDeleteCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, columnDefinitionId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,24 +74,30 @@ public Command BuildGetCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -104,7 +118,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -119,7 +133,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -134,7 +148,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// /// Request headers /// Request options @@ -152,7 +166,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.Drives.Item.List.Co return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -163,7 +177,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +188,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs index 66c7ef679e1..04a43c1420f 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs @@ -21,24 +21,34 @@ public class SourceColumnRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, contentTypeId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, contentTypeId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,7 +82,7 @@ public SourceColumnRequestBuilder(Dictionary pathParameters, IRe RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// Request query parameters @@ -93,7 +103,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -104,7 +114,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The source column for the content type column. + /// The source column for content type column. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/ContentTypeRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/ContentTypeRequestBuilder.cs index b20a39e58bd..a71e595f2aa 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/ContentTypeRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/ContentTypeRequestBuilder.cs @@ -88,12 +88,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -107,16 +110,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, contentTypeId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, contentTypeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -135,16 +147,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs index d05d694a9b7..ac60bbb23ea 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToDefaultContentLocation"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs index e3f28e79a82..9b6ae7db07d 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function isPublished"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs index ace5ae520ae..cedc6377ed7 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action publish"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs b/src/generated/Drives/Item/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs index a1ec4762b67..e972ea2bfa2 100644 --- a/src/generated/Drives/Item/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unpublish"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (driveId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/Drive/DriveRequestBuilder.cs b/src/generated/Drives/Item/List/Drive/DriveRequestBuilder.cs index 7d5ff4bb46b..c2dbafc7a88 100644 --- a/src/generated/Drives/Item/List/Drive/DriveRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Drive/DriveRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Only present on document libraries. Allows access to the list as a [drive][] resource with [driveItems][driveItem]."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); command.Handler = CommandHandler.Create(async (driveId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Only present on document libraries. Allows access to the list as a [drive][] resource with [driveItems][driveItem]."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Only present on document libraries. Allows access to the list as a [drive][] resource with [driveItems][driveItem]."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/Items/Item/Analytics/@Ref/RefRequestBuilder.cs b/src/generated/Drives/Item/List/Items/Item/Analytics/@Ref/RefRequestBuilder.cs index 0384d4463c1..5409490885b 100644 --- a/src/generated/Drives/Item/List/Items/Item/Analytics/@Ref/RefRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Items/Item/Analytics/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (driveId, listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (driveId, listItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs b/src/generated/Drives/Item/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs index 6ce2c49c149..3b37c252e51 100644 --- a/src/generated/Drives/Item/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs @@ -27,16 +27,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs b/src/generated/Drives/Item/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs index 443c5c120af..638be2a1b57 100644 --- a/src/generated/Drives/Item/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property driveItem from drives"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (driveId, listItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property driveItem in drives"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (driveId, listItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs b/src/generated/Drives/Item/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs index dd922fbfb42..6ec4b9009c3 100644 --- a/src/generated/Drives/Item/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (driveId, listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/Items/Item/Fields/FieldsRequestBuilder.cs b/src/generated/Drives/Item/List/Items/Item/Fields/FieldsRequestBuilder.cs index b07c8546e74..6898445f2d3 100644 --- a/src/generated/Drives/Item/List/Items/Item/Fields/FieldsRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Items/Item/Fields/FieldsRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (driveId, listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs b/src/generated/Drives/Item/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs index 3fbec40c348..06bba86a77e 100644 --- a/src/generated/Drives/Item/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (driveId, listItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs b/src/generated/Drives/Item/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs index 804a6c208cf..91a5212ade7 100644 --- a/src/generated/Drives/Item/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}")); - command.AddOption(new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}")); - command.AddOption(new Option("--interval", description: "Usage: interval={interval}")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var intervalOption = new Option("--interval", description: "Usage: interval={interval}"); + intervalOption.IsRequired = true; + command.AddOption(intervalOption); command.Handler = CommandHandler.Create(async (driveId, listItemId, startDateTime, endDateTime, interval) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.PathParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.PathParameters.Add("endDateTime", endDateTime); - if (!String.IsNullOrEmpty(interval)) requestInfo.PathParameters.Add("interval", interval); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/Items/Item/ListItemRequestBuilder.cs b/src/generated/Drives/Item/List/Items/Item/ListItemRequestBuilder.cs index fbceaf10305..4c93e218b0d 100644 --- a/src/generated/Drives/Item/List/Items/Item/ListItemRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Items/Item/ListItemRequestBuilder.cs @@ -39,12 +39,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (driveId, listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -75,16 +78,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -103,16 +115,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs b/src/generated/Drives/Item/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs index 538094424ed..232565a8075 100644 --- a/src/generated/Drives/Item/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (driveId, listItemId, listItemVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, listItemId, listItemVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, listItemId, listItemVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, listItemId, listItemVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs b/src/generated/Drives/Item/List/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs index 3ff4daf3c4f..5f751b86399 100644 --- a/src/generated/Drives/Item/List/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (driveId, listItemId, listItemVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, listItemId, listItemVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, listItemId, listItemVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, listItemId, listItemVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs b/src/generated/Drives/Item/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs index 5747cd3a698..2d9dfe9e1db 100644 --- a/src/generated/Drives/Item/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restoreVersion"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (driveId, listItemId, listItemVersionId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/Items/Item/Versions/VersionsRequestBuilder.cs b/src/generated/Drives/Item/List/Items/Item/Versions/VersionsRequestBuilder.cs index 261f2510b7b..a49e8ed0929 100644 --- a/src/generated/Drives/Item/List/Items/Item/Versions/VersionsRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Items/Item/Versions/VersionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, listItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, listItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/Items/ItemsRequestBuilder.cs b/src/generated/Drives/Item/List/Items/ItemsRequestBuilder.cs index 8237dc9563f..7d6f232b96a 100644 --- a/src/generated/Drives/Item/List/Items/ItemsRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Items/ItemsRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +70,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/List/ListRequestBuilder.cs b/src/generated/Drives/Item/List/ListRequestBuilder.cs index a49781d71f1..5d756636d16 100644 --- a/src/generated/Drives/Item/List/ListRequestBuilder.cs +++ b/src/generated/Drives/Item/List/ListRequestBuilder.cs @@ -46,10 +46,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "For drives in SharePoint, the underlying document library list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); command.Handler = CommandHandler.Create(async (driveId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -71,14 +73,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "For drives in SharePoint, the underlying document library list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -104,14 +114,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "For drives in SharePoint, the underlying document library list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/Subscriptions/Item/SubscriptionRequestBuilder.cs b/src/generated/Drives/Item/List/Subscriptions/Item/SubscriptionRequestBuilder.cs index 2fc1a2af75d..3f27aef231f 100644 --- a/src/generated/Drives/Item/List/Subscriptions/Item/SubscriptionRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Subscriptions/Item/SubscriptionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); command.Handler = CommandHandler.Create(async (driveId, subscriptionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, subscriptionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, subscriptionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, subscriptionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/List/Subscriptions/SubscriptionsRequestBuilder.cs b/src/generated/Drives/Item/List/Subscriptions/SubscriptionsRequestBuilder.cs index da3121f1887..1987397451a 100644 --- a/src/generated/Drives/Item/List/Subscriptions/SubscriptionsRequestBuilder.cs +++ b/src/generated/Drives/Item/List/Subscriptions/SubscriptionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/Recent/RecentRequestBuilder.cs b/src/generated/Drives/Item/Recent/RecentRequestBuilder.cs index fb97be12215..12af9e9e179 100644 --- a/src/generated/Drives/Item/Recent/RecentRequestBuilder.cs +++ b/src/generated/Drives/Item/Recent/RecentRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function recent"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); command.Handler = CommandHandler.Create(async (driveId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/Root/Content/ContentRequestBuilder.cs b/src/generated/Drives/Item/Root/Content/ContentRequestBuilder.cs index 2a1c83e6560..f8bc99f3d7c 100644 --- a/src/generated/Drives/Item/Root/Content/ContentRequestBuilder.cs +++ b/src/generated/Drives/Item/Root/Content/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property root from drives"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (driveId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property root in drives"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--file", description: "Binary request body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (driveId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/Root/RootRequestBuilder.cs b/src/generated/Drives/Item/Root/RootRequestBuilder.cs index aed605cc1a4..4d6e7b80f9d 100644 --- a/src/generated/Drives/Item/Root/RootRequestBuilder.cs +++ b/src/generated/Drives/Item/Root/RootRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The root folder of the drive. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); command.Handler = CommandHandler.Create(async (driveId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The root folder of the drive. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The root folder of the drive. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/SearchWithQ/SearchWithQRequestBuilder.cs b/src/generated/Drives/Item/SearchWithQ/SearchWithQRequestBuilder.cs index 806beb39531..625f80869be 100644 --- a/src/generated/Drives/Item/SearchWithQ/SearchWithQRequestBuilder.cs +++ b/src/generated/Drives/Item/SearchWithQ/SearchWithQRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function search"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("-q", description: "Usage: q={q}")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var qOption = new Option("-q", description: "Usage: q={q}"); + qOption.IsRequired = true; + command.AddOption(qOption); command.Handler = CommandHandler.Create(async (driveId, q) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(q)) requestInfo.PathParameters.Add("q", q); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/SharedWithMe/SharedWithMeRequestBuilder.cs b/src/generated/Drives/Item/SharedWithMe/SharedWithMeRequestBuilder.cs index b64747d4f37..8dfadc50ff2 100644 --- a/src/generated/Drives/Item/SharedWithMe/SharedWithMeRequestBuilder.cs +++ b/src/generated/Drives/Item/SharedWithMe/SharedWithMeRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function sharedWithMe"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); command.Handler = CommandHandler.Create(async (driveId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Drives/Item/Special/Item/Content/ContentRequestBuilder.cs b/src/generated/Drives/Item/Special/Item/Content/ContentRequestBuilder.cs index 766858b034b..890d40a1b1f 100644 --- a/src/generated/Drives/Item/Special/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Drives/Item/Special/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property special from drives"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (driveId, driveItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property special in drives"; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (driveId, driveItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/Special/Item/DriveItemRequestBuilder.cs b/src/generated/Drives/Item/Special/Item/DriveItemRequestBuilder.cs index ee1e49d99ee..116e534794f 100644 --- a/src/generated/Drives/Item/Special/Item/DriveItemRequestBuilder.cs +++ b/src/generated/Drives/Item/Special/Item/DriveItemRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of common folders available in OneDrive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveId, driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of common folders available in OneDrive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of common folders available in OneDrive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Drives/Item/Special/SpecialRequestBuilder.cs b/src/generated/Drives/Item/Special/SpecialRequestBuilder.cs index a7643a7f920..0ab39e22f76 100644 --- a/src/generated/Drives/Item/Special/SpecialRequestBuilder.cs +++ b/src/generated/Drives/Item/Special/SpecialRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of common folders available in OneDrive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of common folders available in OneDrive. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/ClassesRequestBuilder.cs b/src/generated/Education/Classes/ClassesRequestBuilder.cs index 9749da93653..17e7471e97b 100644 --- a/src/generated/Education/Classes/ClassesRequestBuilder.cs +++ b/src/generated/Education/Classes/ClassesRequestBuilder.cs @@ -45,12 +45,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to classes for education"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,24 +72,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get classes from education"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Delta/DeltaRequestBuilder.cs b/src/generated/Education/Classes/Delta/DeltaRequestBuilder.cs index e0e2210e33e..41561e35472 100644 --- a/src/generated/Education/Classes/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Education/Classes/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/AssignmentCategories/AssignmentCategoriesRequestBuilder.cs b/src/generated/Education/Classes/Item/AssignmentCategories/AssignmentCategoriesRequestBuilder.cs index 8cc4004df4f..17b4c339c2b 100644 --- a/src/generated/Education/Classes/Item/AssignmentCategories/AssignmentCategoriesRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/AssignmentCategories/AssignmentCategoriesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to assignmentCategories for education"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get assignmentCategories from education"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/AssignmentCategories/Item/EducationCategoryRequestBuilder.cs b/src/generated/Education/Classes/Item/AssignmentCategories/Item/EducationCategoryRequestBuilder.cs index f16370da0c9..a5ebe11fc79 100644 --- a/src/generated/Education/Classes/Item/AssignmentCategories/Item/EducationCategoryRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/AssignmentCategories/Item/EducationCategoryRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property assignmentCategories for education"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationcategory-id", description: "key: id of educationCategory")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationCategoryIdOption = new Option("--educationcategory-id", description: "key: id of educationCategory"); + educationCategoryIdOption.IsRequired = true; + command.AddOption(educationCategoryIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationCategoryId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationCategoryId)) requestInfo.PathParameters.Add("educationCategory_id", educationCategoryId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get assignmentCategories from education"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationcategory-id", description: "key: id of educationCategory")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationCategoryId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationCategoryId)) requestInfo.PathParameters.Add("educationCategory_id", educationCategoryId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationCategoryIdOption = new Option("--educationcategory-id", description: "key: id of educationCategory"); + educationCategoryIdOption.IsRequired = true; + command.AddOption(educationCategoryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationCategoryId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property assignmentCategories in education"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationcategory-id", description: "key: id of educationCategory")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationCategoryIdOption = new Option("--educationcategory-id", description: "key: id of educationCategory"); + educationCategoryIdOption.IsRequired = true; + command.AddOption(educationCategoryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationCategoryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationCategoryId)) requestInfo.PathParameters.Add("educationCategory_id", educationCategoryId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Classes/Item/AssignmentDefaults/AssignmentDefaultsRequestBuilder.cs b/src/generated/Education/Classes/Item/AssignmentDefaults/AssignmentDefaultsRequestBuilder.cs index a854adca17f..90fc8045b9b 100644 --- a/src/generated/Education/Classes/Item/AssignmentDefaults/AssignmentDefaultsRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/AssignmentDefaults/AssignmentDefaultsRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property assignmentDefaults for education"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); command.Handler = CommandHandler.Create(async (educationClassId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get assignmentDefaults from education"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property assignmentDefaults in education"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Classes/Item/AssignmentSettings/AssignmentSettingsRequestBuilder.cs b/src/generated/Education/Classes/Item/AssignmentSettings/AssignmentSettingsRequestBuilder.cs index 79fbaf85de0..436b63d09fc 100644 --- a/src/generated/Education/Classes/Item/AssignmentSettings/AssignmentSettingsRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/AssignmentSettings/AssignmentSettingsRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property assignmentSettings for education"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); command.Handler = CommandHandler.Create(async (educationClassId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get assignmentSettings from education"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property assignmentSettings in education"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Classes/Item/Assignments/AssignmentsRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/AssignmentsRequestBuilder.cs index daf4e611012..d66b5ecef18 100644 --- a/src/generated/Education/Classes/Item/Assignments/AssignmentsRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/AssignmentsRequestBuilder.cs @@ -42,14 +42,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All assignments associated with this class. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,26 +72,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All assignments associated with this class. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Categories/CategoriesRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Categories/CategoriesRequestBuilder.cs index 3d242002e34..157de95f717 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Categories/CategoriesRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Categories/CategoriesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Categories/Item/EducationCategoryRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Categories/Item/EducationCategoryRequestBuilder.cs index 2aa3cd2dafd..3c51b80d53a 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Categories/Item/EducationCategoryRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Categories/Item/EducationCategoryRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationcategory-id", description: "key: id of educationCategory")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationCategoryIdOption = new Option("--educationcategory-id", description: "key: id of educationCategory"); + educationCategoryIdOption.IsRequired = true; + command.AddOption(educationCategoryIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationCategoryId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationCategoryId)) requestInfo.PathParameters.Add("educationCategory_id", educationCategoryId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationcategory-id", description: "key: id of educationCategory")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationCategoryId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationCategoryId)) requestInfo.PathParameters.Add("educationCategory_id", educationCategoryId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationCategoryIdOption = new Option("--educationcategory-id", description: "key: id of educationCategory"); + educationCategoryIdOption.IsRequired = true; + command.AddOption(educationCategoryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationCategoryId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationcategory-id", description: "key: id of educationCategory")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationCategoryIdOption = new Option("--educationcategory-id", description: "key: id of educationCategory"); + educationCategoryIdOption.IsRequired = true; + command.AddOption(educationCategoryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationCategoryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationCategoryId)) requestInfo.PathParameters.Add("educationCategory_id", educationCategoryId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/EducationAssignmentRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/EducationAssignmentRequestBuilder.cs index 89dc64c478e..ba5e7e06606 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/EducationAssignmentRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/EducationAssignmentRequestBuilder.cs @@ -39,12 +39,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All assignments associated with this class. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,16 +61,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All assignments associated with this class. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,16 +98,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All assignments associated with this class. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Publish/PublishRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Publish/PublishRequestBuilder.cs index 45e5fab1afd..8d3a4842969 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Publish/PublishRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Publish/PublishRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action publish"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Resources/Item/EducationAssignmentResourceRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Resources/Item/EducationAssignmentResourceRequestBuilder.cs index d13e70364fd..92c8ee1659b 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Resources/Item/EducationAssignmentResourceRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Resources/Item/EducationAssignmentResourceRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationassignmentresource-id", description: "key: id of educationAssignmentResource")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationAssignmentResourceIdOption = new Option("--educationassignmentresource-id", description: "key: id of educationAssignmentResource"); + educationAssignmentResourceIdOption.IsRequired = true; + command.AddOption(educationAssignmentResourceIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationAssignmentResourceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationAssignmentResourceId)) requestInfo.PathParameters.Add("educationAssignmentResource_id", educationAssignmentResourceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationassignmentresource-id", description: "key: id of educationAssignmentResource")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationAssignmentResourceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationAssignmentResourceId)) requestInfo.PathParameters.Add("educationAssignmentResource_id", educationAssignmentResourceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationAssignmentResourceIdOption = new Option("--educationassignmentresource-id", description: "key: id of educationAssignmentResource"); + educationAssignmentResourceIdOption.IsRequired = true; + command.AddOption(educationAssignmentResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationAssignmentResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationassignmentresource-id", description: "key: id of educationAssignmentResource")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationAssignmentResourceIdOption = new Option("--educationassignmentresource-id", description: "key: id of educationAssignmentResource"); + educationAssignmentResourceIdOption.IsRequired = true; + command.AddOption(educationAssignmentResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationAssignmentResourceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationAssignmentResourceId)) requestInfo.PathParameters.Add("educationAssignmentResource_id", educationAssignmentResourceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Resources/ResourcesRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Resources/ResourcesRequestBuilder.cs index 7bcafa88cb5..9145998aedf 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Resources/ResourcesRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Resources/ResourcesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Rubric/RubricRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Rubric/RubricRequestBuilder.cs index 54e12e78fc7..95541b1599d 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Rubric/RubricRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Rubric/RubricRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "When set, the grading rubric attached to this assignment."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "When set, the grading rubric attached to this assignment."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "When set, the grading rubric attached to this assignment."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs index ae4a0cba108..fbdf30ce859 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setUpResourcesFolder"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/@Return/ReturnRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/@Return/ReturnRequestBuilder.cs index 9461d71a986..98318dafe71 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/@Return/ReturnRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/@Return/ReturnRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action return"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/EducationSubmissionRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/EducationSubmissionRequestBuilder.cs index db20b001baa..23bacb54707 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/EducationSubmissionRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/EducationSubmissionRequestBuilder.cs @@ -1,4 +1,5 @@ using ApiSdk.Education.Classes.Item.Assignments.Item.Submissions.Item.Outcomes; +using ApiSdk.Education.Classes.Item.Assignments.Item.Submissions.Item.Reassign; using ApiSdk.Education.Classes.Item.Assignments.Item.Submissions.Item.Resources; using ApiSdk.Education.Classes.Item.Assignments.Item.Submissions.Item.Return; using ApiSdk.Education.Classes.Item.Assignments.Item.Submissions.Item.SetUpResourcesFolder; @@ -33,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,24 +106,36 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); }); return command; } + public Command BuildReassignCommand() { + var command = new Command("reassign"); + var builder = new ApiSdk.Education.Classes.Item.Assignments.Item.Submissions.Item.Reassign.ReassignRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } public Command BuildResourcesCommand() { var command = new Command("resources"); var builder = new ApiSdk.Education.Classes.Item.Assignments.Item.Submissions.Item.Resources.ResourcesRequestBuilder(PathParameters, RequestAdapter); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Outcomes/Item/EducationOutcomeRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Outcomes/Item/EducationOutcomeRequestBuilder.cs index 081162268ba..19531f93cef 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Outcomes/Item/EducationOutcomeRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Outcomes/Item/EducationOutcomeRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-Write. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--educationoutcome-id", description: "key: id of educationOutcome")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationOutcomeIdOption = new Option("--educationoutcome-id", description: "key: id of educationOutcome"); + educationOutcomeIdOption.IsRequired = true; + command.AddOption(educationOutcomeIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, educationOutcomeId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); - if (!String.IsNullOrEmpty(educationOutcomeId)) requestInfo.PathParameters.Add("educationOutcome_id", educationOutcomeId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-Write. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--educationoutcome-id", description: "key: id of educationOutcome")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, educationOutcomeId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); - if (!String.IsNullOrEmpty(educationOutcomeId)) requestInfo.PathParameters.Add("educationOutcome_id", educationOutcomeId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationOutcomeIdOption = new Option("--educationoutcome-id", description: "key: id of educationOutcome"); + educationOutcomeIdOption.IsRequired = true; + command.AddOption(educationOutcomeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, educationOutcomeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-Write. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--educationoutcome-id", description: "key: id of educationOutcome")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationOutcomeIdOption = new Option("--educationoutcome-id", description: "key: id of educationOutcome"); + educationOutcomeIdOption.IsRequired = true; + command.AddOption(educationOutcomeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, educationOutcomeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); - if (!String.IsNullOrEmpty(educationOutcomeId)) requestInfo.PathParameters.Add("educationOutcome_id", educationOutcomeId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Outcomes/OutcomesRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Outcomes/OutcomesRequestBuilder.cs index b9f66bcd361..1308580319a 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Outcomes/OutcomesRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Outcomes/OutcomesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-Write. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-Write. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Reassign/ReassignRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Reassign/ReassignRequestBuilder.cs new file mode 100644 index 00000000000..f36c7084e73 --- /dev/null +++ b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Reassign/ReassignRequestBuilder.cs @@ -0,0 +1,122 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Classes.Item.Assignments.Item.Submissions.Item.Reassign { + /// Builds and executes requests for operations under \education\classes\{educationClass-id}\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\microsoft.graph.reassign + public class ReassignRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action reassign + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action reassign"; + // Create options for all the parameters + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new ReassignRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public ReassignRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/classes/{educationClass_id}/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/microsoft.graph.reassign"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action reassign + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action reassign + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationSubmission + public class ReassignResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationSubmission + public EducationSubmission EducationSubmission { get; set; } + /// + /// Instantiates a new reassignResponse and sets the default values. + /// + public ReassignResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationSubmission", (o,n) => { (o as ReassignResponse).EducationSubmission = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationSubmission", EducationSubmission); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Resources/Item/EducationSubmissionResourceRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Resources/Item/EducationSubmissionResourceRequestBuilder.cs index 2f1835edd82..e2e110fc944 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Resources/Item/EducationSubmissionResourceRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Resources/Item/EducationSubmissionResourceRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, educationSubmissionResourceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); - if (!String.IsNullOrEmpty(educationSubmissionResourceId)) requestInfo.PathParameters.Add("educationSubmissionResource_id", educationSubmissionResourceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, educationSubmissionResourceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); - if (!String.IsNullOrEmpty(educationSubmissionResourceId)) requestInfo.PathParameters.Add("educationSubmissionResource_id", educationSubmissionResourceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, educationSubmissionResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, educationSubmissionResourceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); - if (!String.IsNullOrEmpty(educationSubmissionResourceId)) requestInfo.PathParameters.Add("educationSubmissionResource_id", educationSubmissionResourceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Resources/ResourcesRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Resources/ResourcesRequestBuilder.cs index 172eb0c2ff9..34b5098b2a2 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Resources/ResourcesRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Resources/ResourcesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs index fc131e1f231..01ba4483f29 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setUpResourcesFolder"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Submit/SubmitRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Submit/SubmitRequestBuilder.cs index 94836cdb1c2..7afb516a790 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Submit/SubmitRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Submit/SubmitRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action submit"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/SubmittedResources/Item/EducationSubmissionResourceRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/SubmittedResources/Item/EducationSubmissionResourceRequestBuilder.cs index c46d10563bd..6acbe53b6f3 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/SubmittedResources/Item/EducationSubmissionResourceRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/SubmittedResources/Item/EducationSubmissionResourceRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, educationSubmissionResourceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); - if (!String.IsNullOrEmpty(educationSubmissionResourceId)) requestInfo.PathParameters.Add("educationSubmissionResource_id", educationSubmissionResourceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, educationSubmissionResourceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); - if (!String.IsNullOrEmpty(educationSubmissionResourceId)) requestInfo.PathParameters.Add("educationSubmissionResource_id", educationSubmissionResourceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, educationSubmissionResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, educationSubmissionResourceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); - if (!String.IsNullOrEmpty(educationSubmissionResourceId)) requestInfo.PathParameters.Add("educationSubmissionResource_id", educationSubmissionResourceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesRequestBuilder.cs index 5ee89c0a161..2fc0042f80e 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Unsubmit/UnsubmitRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Unsubmit/UnsubmitRequestBuilder.cs index 0acc987a16f..df43f9d8bf9 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Unsubmit/UnsubmitRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/Item/Unsubmit/UnsubmitRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unsubmit"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--educationsubmission-id", description: "key: id of educationSubmission")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, educationSubmissionId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - if (!String.IsNullOrEmpty(educationSubmissionId)) requestInfo.PathParameters.Add("educationSubmission_id", educationSubmissionId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/SubmissionsRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/SubmissionsRequestBuilder.cs index a2b6ac1ee86..bc57249614d 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Submissions/SubmissionsRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Submissions/SubmissionsRequestBuilder.cs @@ -27,6 +27,7 @@ public List BuildCommand() { builder.BuildGetCommand(), builder.BuildOutcomesCommand(), builder.BuildPatchCommand(), + builder.BuildReassignCommand(), builder.BuildResourcesCommand(), builder.BuildReturnCommand(), builder.BuildSetUpResourcesFolderCommand(), @@ -43,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,28 +77,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--educationassignment-id", description: "key: id of educationAssignment")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - if (!String.IsNullOrEmpty(educationAssignmentId)) requestInfo.PathParameters.Add("educationAssignment_id", educationAssignmentId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, educationAssignmentId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/EducationClassRequestBuilder.cs b/src/generated/Education/Classes/Item/EducationClassRequestBuilder.cs index 2c5da8e1ccb..43d35a942c0 100644 --- a/src/generated/Education/Classes/Item/EducationClassRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/EducationClassRequestBuilder.cs @@ -64,10 +64,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property classes for education"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); command.Handler = CommandHandler.Create(async (educationClassId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -81,14 +83,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get classes from education"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -121,14 +131,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property classes in education"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Classes/Item/Group/@Ref/RefRequestBuilder.cs b/src/generated/Education/Classes/Item/Group/@Ref/RefRequestBuilder.cs index 4e6cd2ea9e1..f2ac0c44d44 100644 --- a/src/generated/Education/Classes/Item/Group/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Group/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The underlying Microsoft 365 group object."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); command.Handler = CommandHandler.Create(async (educationClassId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The underlying Microsoft 365 group object."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); command.Handler = CommandHandler.Create(async (educationClassId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The underlying Microsoft 365 group object."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Classes/Item/Group/GroupRequestBuilder.cs b/src/generated/Education/Classes/Item/Group/GroupRequestBuilder.cs index c3641e95bb6..66947d1370b 100644 --- a/src/generated/Education/Classes/Item/Group/GroupRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Group/GroupRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The underlying Microsoft 365 group object."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Members/@Ref/RefRequestBuilder.cs b/src/generated/Education/Classes/Item/Members/@Ref/RefRequestBuilder.cs index 8bc6445ff94..4a0e46a82f7 100644 --- a/src/generated/Education/Classes/Item/Members/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Members/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All users in the class. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "All users in the class. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Members/Delta/DeltaRequestBuilder.cs b/src/generated/Education/Classes/Item/Members/Delta/DeltaRequestBuilder.cs index f1b5648f070..172ad9433e4 100644 --- a/src/generated/Education/Classes/Item/Members/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Members/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); command.Handler = CommandHandler.Create(async (educationClassId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Members/MembersRequestBuilder.cs b/src/generated/Education/Classes/Item/Members/MembersRequestBuilder.cs index 0405673b977..69af54b1760 100644 --- a/src/generated/Education/Classes/Item/Members/MembersRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Members/MembersRequestBuilder.cs @@ -27,26 +27,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All users in the class. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Schools/@Ref/RefRequestBuilder.cs b/src/generated/Education/Classes/Item/Schools/@Ref/RefRequestBuilder.cs index 147a4c82d85..5cb99438bbb 100644 --- a/src/generated/Education/Classes/Item/Schools/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Schools/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All schools that this class is associated with. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "All schools that this class is associated with. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Schools/Delta/DeltaRequestBuilder.cs b/src/generated/Education/Classes/Item/Schools/Delta/DeltaRequestBuilder.cs index 321e0e2f36a..1919abfff74 100644 --- a/src/generated/Education/Classes/Item/Schools/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Schools/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); command.Handler = CommandHandler.Create(async (educationClassId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Schools/SchoolsRequestBuilder.cs b/src/generated/Education/Classes/Item/Schools/SchoolsRequestBuilder.cs index a24e9b26738..97941e19230 100644 --- a/src/generated/Education/Classes/Item/Schools/SchoolsRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Schools/SchoolsRequestBuilder.cs @@ -27,26 +27,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All schools that this class is associated with. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Teachers/@Ref/RefRequestBuilder.cs b/src/generated/Education/Classes/Item/Teachers/@Ref/RefRequestBuilder.cs index 1b774c7fce3..4d3307df8ed 100644 --- a/src/generated/Education/Classes/Item/Teachers/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Teachers/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All teachers in the class. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "All teachers in the class. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--body")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationClassId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Teachers/Delta/DeltaRequestBuilder.cs b/src/generated/Education/Classes/Item/Teachers/Delta/DeltaRequestBuilder.cs index f9130a25217..d7739adf1bc 100644 --- a/src/generated/Education/Classes/Item/Teachers/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Teachers/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); command.Handler = CommandHandler.Create(async (educationClassId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Classes/Item/Teachers/TeachersRequestBuilder.cs b/src/generated/Education/Classes/Item/Teachers/TeachersRequestBuilder.cs index 8d5d18b3b67..ca4e02d857b 100644 --- a/src/generated/Education/Classes/Item/Teachers/TeachersRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Teachers/TeachersRequestBuilder.cs @@ -27,26 +27,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All teachers in the class. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationclass-id", description: "key: id of educationClass")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationClassId)) requestInfo.PathParameters.Add("educationClass_id", educationClassId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationClassIdOption = new Option("--educationclass-id", description: "key: id of educationClass"); + educationClassIdOption.IsRequired = true; + command.AddOption(educationClassIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationClassId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/EducationRequestBuilder.cs b/src/generated/Education/EducationRequestBuilder.cs index 01112e68b29..29c8eb1eafd 100644 --- a/src/generated/Education/EducationRequestBuilder.cs +++ b/src/generated/Education/EducationRequestBuilder.cs @@ -37,12 +37,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get education"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,6 +64,7 @@ public Command BuildGetCommand() { public Command BuildMeCommand() { var command = new Command("me"); var builder = new ApiSdk.Education.Me.MeRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildAssignmentsCommand()); command.AddCommand(builder.BuildClassesCommand()); command.AddCommand(builder.BuildDeleteCommand()); command.AddCommand(builder.BuildGetCommand()); @@ -74,12 +82,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update education"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Me/Assignments/AssignmentsRequestBuilder.cs b/src/generated/Education/Me/Assignments/AssignmentsRequestBuilder.cs new file mode 100644 index 00000000000..75f80ad8221 --- /dev/null +++ b/src/generated/Education/Me/Assignments/AssignmentsRequestBuilder.cs @@ -0,0 +1,218 @@ +using ApiSdk.Education.Me.Assignments.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments { + /// Builds and executes requests for operations under \education\me\assignments + public class AssignmentsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new EducationAssignmentRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildCategoriesCommand(), + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + builder.BuildPublishCommand(), + builder.BuildResourcesCommand(), + builder.BuildRubricCommand(), + builder.BuildSetUpResourcesFolderCommand(), + builder.BuildSubmissionsCommand(), + }; + return commands; + } + /// + /// List of assignments for the user. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "List of assignments for the user. Nullable."; + // Create options for all the parameters + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// List of assignments for the user. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "List of assignments for the user. Nullable."; + // Create options for all the parameters + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new AssignmentsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AssignmentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// List of assignments for the user. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of assignments for the user. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(EducationAssignment body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of assignments for the user. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of assignments for the user. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(EducationAssignment model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// List of assignments for the user. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/AssignmentsResponse.cs b/src/generated/Education/Me/Assignments/AssignmentsResponse.cs new file mode 100644 index 00000000000..a63932d550b --- /dev/null +++ b/src/generated/Education/Me/Assignments/AssignmentsResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Education.Me.Assignments { + public class AssignmentsResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new assignmentsResponse and sets the default values. + /// + public AssignmentsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as AssignmentsResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as AssignmentsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Categories/CategoriesRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Categories/CategoriesRequestBuilder.cs new file mode 100644 index 00000000000..5c096eff1bd --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Categories/CategoriesRequestBuilder.cs @@ -0,0 +1,218 @@ +using ApiSdk.Education.Me.Assignments.Item.Categories.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Categories { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\categories + public class CategoriesRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new EducationCategoryRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new CategoriesRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public CategoriesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/categories{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(EducationCategory body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(EducationCategory model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Categories/CategoriesResponse.cs b/src/generated/Education/Me/Assignments/Item/Categories/CategoriesResponse.cs new file mode 100644 index 00000000000..26ed38face8 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Categories/CategoriesResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Education.Me.Assignments.Item.Categories { + public class CategoriesResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new categoriesResponse and sets the default values. + /// + public CategoriesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as CategoriesResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as CategoriesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Categories/Item/EducationCategoryRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Categories/Item/EducationCategoryRequestBuilder.cs new file mode 100644 index 00000000000..3eeedb8a4a0 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Categories/Item/EducationCategoryRequestBuilder.cs @@ -0,0 +1,220 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Categories.Item { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\categories\{educationCategory-id} + public class EducationCategoryRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationCategoryIdOption = new Option("--educationcategory-id", description: "key: id of educationCategory"); + educationCategoryIdOption.IsRequired = true; + command.AddOption(educationCategoryIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationCategoryId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationCategoryIdOption = new Option("--educationcategory-id", description: "key: id of educationCategory"); + educationCategoryIdOption.IsRequired = true; + command.AddOption(educationCategoryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationCategoryId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationCategoryIdOption = new Option("--educationcategory-id", description: "key: id of educationCategory"); + educationCategoryIdOption.IsRequired = true; + command.AddOption(educationCategoryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationCategoryId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new EducationCategoryRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public EducationCategoryRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/categories/{educationCategory_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationCategory body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationCategory model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/EducationAssignmentRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/EducationAssignmentRequestBuilder.cs new file mode 100644 index 00000000000..4790c5955ad --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/EducationAssignmentRequestBuilder.cs @@ -0,0 +1,258 @@ +using ApiSdk.Education.Me.Assignments.Item.Categories; +using ApiSdk.Education.Me.Assignments.Item.Publish; +using ApiSdk.Education.Me.Assignments.Item.Resources; +using ApiSdk.Education.Me.Assignments.Item.Rubric; +using ApiSdk.Education.Me.Assignments.Item.SetUpResourcesFolder; +using ApiSdk.Education.Me.Assignments.Item.Submissions; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id} + public class EducationAssignmentRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public Command BuildCategoriesCommand() { + var command = new Command("categories"); + var builder = new ApiSdk.Education.Me.Assignments.Item.Categories.CategoriesRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + /// + /// List of assignments for the user. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "List of assignments for the user. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// List of assignments for the user. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "List of assignments for the user. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// List of assignments for the user. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "List of assignments for the user. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + public Command BuildPublishCommand() { + var command = new Command("publish"); + var builder = new ApiSdk.Education.Me.Assignments.Item.Publish.PublishRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + public Command BuildResourcesCommand() { + var command = new Command("resources"); + var builder = new ApiSdk.Education.Me.Assignments.Item.Resources.ResourcesRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + public Command BuildRubricCommand() { + var command = new Command("rubric"); + var builder = new ApiSdk.Education.Me.Assignments.Item.Rubric.RubricRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildDeleteCommand()); + command.AddCommand(builder.BuildGetCommand()); + command.AddCommand(builder.BuildPatchCommand()); + return command; + } + public Command BuildSetUpResourcesFolderCommand() { + var command = new Command("set-up-resources-folder"); + var builder = new ApiSdk.Education.Me.Assignments.Item.SetUpResourcesFolder.SetUpResourcesFolderRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + public Command BuildSubmissionsCommand() { + var command = new Command("submissions"); + var builder = new ApiSdk.Education.Me.Assignments.Item.Submissions.SubmissionsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + /// + /// Instantiates a new EducationAssignmentRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public EducationAssignmentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// List of assignments for the user. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of assignments for the user. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of assignments for the user. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationAssignment body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of assignments for the user. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of assignments for the user. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of assignments for the user. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationAssignment model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// List of assignments for the user. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Publish/PublishRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Publish/PublishRequestBuilder.cs new file mode 100644 index 00000000000..e8aedb0eb61 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Publish/PublishRequestBuilder.cs @@ -0,0 +1,116 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Publish { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\microsoft.graph.publish + public class PublishRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action publish + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action publish"; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new PublishRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public PublishRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/microsoft.graph.publish"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action publish + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action publish + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationAssignment + public class PublishResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationAssignment + public EducationAssignment EducationAssignment { get; set; } + /// + /// Instantiates a new publishResponse and sets the default values. + /// + public PublishResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationAssignment", (o,n) => { (o as PublishResponse).EducationAssignment = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationAssignment", EducationAssignment); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Resources/Item/EducationAssignmentResourceRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Resources/Item/EducationAssignmentResourceRequestBuilder.cs new file mode 100644 index 00000000000..21975ae85f9 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Resources/Item/EducationAssignmentResourceRequestBuilder.cs @@ -0,0 +1,220 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Resources.Item { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\resources\{educationAssignmentResource-id} + public class EducationAssignmentResourceRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationAssignmentResourceIdOption = new Option("--educationassignmentresource-id", description: "key: id of educationAssignmentResource"); + educationAssignmentResourceIdOption.IsRequired = true; + command.AddOption(educationAssignmentResourceIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationAssignmentResourceId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationAssignmentResourceIdOption = new Option("--educationassignmentresource-id", description: "key: id of educationAssignmentResource"); + educationAssignmentResourceIdOption.IsRequired = true; + command.AddOption(educationAssignmentResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationAssignmentResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationAssignmentResourceIdOption = new Option("--educationassignmentresource-id", description: "key: id of educationAssignmentResource"); + educationAssignmentResourceIdOption.IsRequired = true; + command.AddOption(educationAssignmentResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationAssignmentResourceId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new EducationAssignmentResourceRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public EducationAssignmentResourceRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/resources/{educationAssignmentResource_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationAssignmentResource body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationAssignmentResource model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Resources/ResourcesRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Resources/ResourcesRequestBuilder.cs new file mode 100644 index 00000000000..30ad5f81a3c --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Resources/ResourcesRequestBuilder.cs @@ -0,0 +1,218 @@ +using ApiSdk.Education.Me.Assignments.Item.Resources.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Resources { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\resources + public class ResourcesRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new EducationAssignmentResourceRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new ResourcesRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public ResourcesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/resources{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(EducationAssignmentResource body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(EducationAssignmentResource model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Resources/ResourcesResponse.cs b/src/generated/Education/Me/Assignments/Item/Resources/ResourcesResponse.cs new file mode 100644 index 00000000000..bbc5206d2c3 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Resources/ResourcesResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Education.Me.Assignments.Item.Resources { + public class ResourcesResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new resourcesResponse and sets the default values. + /// + public ResourcesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as ResourcesResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as ResourcesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Rubric/RubricRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Rubric/RubricRequestBuilder.cs new file mode 100644 index 00000000000..d0c0c88edfd --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Rubric/RubricRequestBuilder.cs @@ -0,0 +1,211 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Rubric { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\rubric + public class RubricRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// When set, the grading rubric attached to this assignment. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "When set, the grading rubric attached to this assignment."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// When set, the grading rubric attached to this assignment. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "When set, the grading rubric attached to this assignment."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// When set, the grading rubric attached to this assignment. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "When set, the grading rubric attached to this assignment."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new RubricRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public RubricRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/rubric{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// When set, the grading rubric attached to this assignment. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, the grading rubric attached to this assignment. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, the grading rubric attached to this assignment. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationRubric body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, the grading rubric attached to this assignment. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// When set, the grading rubric attached to this assignment. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// When set, the grading rubric attached to this assignment. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationRubric model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// When set, the grading rubric attached to this assignment. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs new file mode 100644 index 00000000000..d4bd6108b32 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs @@ -0,0 +1,116 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.SetUpResourcesFolder { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\microsoft.graph.setUpResourcesFolder + public class SetUpResourcesFolderRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action setUpResourcesFolder + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action setUpResourcesFolder"; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new SetUpResourcesFolderRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public SetUpResourcesFolderRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/microsoft.graph.setUpResourcesFolder"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action setUpResourcesFolder + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action setUpResourcesFolder + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationAssignment + public class SetUpResourcesFolderResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationAssignment + public EducationAssignment EducationAssignment { get; set; } + /// + /// Instantiates a new setUpResourcesFolderResponse and sets the default values. + /// + public SetUpResourcesFolderResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationAssignment", (o,n) => { (o as SetUpResourcesFolderResponse).EducationAssignment = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationAssignment", EducationAssignment); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/@Return/ReturnRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/@Return/ReturnRequestBuilder.cs new file mode 100644 index 00000000000..3eea15fefee --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/@Return/ReturnRequestBuilder.cs @@ -0,0 +1,119 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item.@Return { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\microsoft.graph.return + public class ReturnRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action return + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action return"; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new ReturnRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public ReturnRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/microsoft.graph.return"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action return + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action return + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationSubmission + public class ReturnResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationSubmission + public EducationSubmission EducationSubmission { get; set; } + /// + /// Instantiates a new returnResponse and sets the default values. + /// + public ReturnResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationSubmission", (o,n) => { (o as ReturnResponse).EducationSubmission = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationSubmission", EducationSubmission); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/EducationSubmissionRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/EducationSubmissionRequestBuilder.cs new file mode 100644 index 00000000000..dff7b211593 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/EducationSubmissionRequestBuilder.cs @@ -0,0 +1,279 @@ +using ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Outcomes; +using ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Reassign; +using ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Resources; +using ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Return; +using ApiSdk.Education.Me.Assignments.Item.Submissions.Item.SetUpResourcesFolder; +using ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Submit; +using ApiSdk.Education.Me.Assignments.Item.Submissions.Item.SubmittedResources; +using ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Unsubmit; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\submissions\{educationSubmission-id} + public class EducationSubmissionRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + public Command BuildOutcomesCommand() { + var command = new Command("outcomes"); + var builder = new ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Outcomes.OutcomesRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + public Command BuildReassignCommand() { + var command = new Command("reassign"); + var builder = new ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Reassign.ReassignRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + public Command BuildResourcesCommand() { + var command = new Command("resources"); + var builder = new ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Resources.ResourcesRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + public Command BuildReturnCommand() { + var command = new Command("return"); + var builder = new ApiSdk.Education.Me.Assignments.Item.Submissions.Item.@Return.ReturnRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + public Command BuildSetUpResourcesFolderCommand() { + var command = new Command("set-up-resources-folder"); + var builder = new ApiSdk.Education.Me.Assignments.Item.Submissions.Item.SetUpResourcesFolder.SetUpResourcesFolderRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + public Command BuildSubmitCommand() { + var command = new Command("submit"); + var builder = new ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Submit.SubmitRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + public Command BuildSubmittedResourcesCommand() { + var command = new Command("submitted-resources"); + var builder = new ApiSdk.Education.Me.Assignments.Item.Submissions.Item.SubmittedResources.SubmittedResourcesRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + public Command BuildUnsubmitCommand() { + var command = new Command("unsubmit"); + var builder = new ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Unsubmit.UnsubmitRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + /// + /// Instantiates a new EducationSubmissionRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public EducationSubmissionRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationSubmission body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationSubmission model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/Outcomes/Item/EducationOutcomeRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Outcomes/Item/EducationOutcomeRequestBuilder.cs new file mode 100644 index 00000000000..4ed1b2a6e4a --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Outcomes/Item/EducationOutcomeRequestBuilder.cs @@ -0,0 +1,229 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Outcomes.Item { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\outcomes\{educationOutcome-id} + public class EducationOutcomeRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Read-Write. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Read-Write. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationOutcomeIdOption = new Option("--educationoutcome-id", description: "key: id of educationOutcome"); + educationOutcomeIdOption.IsRequired = true; + command.AddOption(educationOutcomeIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, educationOutcomeId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Read-Write. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Read-Write. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationOutcomeIdOption = new Option("--educationoutcome-id", description: "key: id of educationOutcome"); + educationOutcomeIdOption.IsRequired = true; + command.AddOption(educationOutcomeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, educationOutcomeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Read-Write. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Read-Write. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationOutcomeIdOption = new Option("--educationoutcome-id", description: "key: id of educationOutcome"); + educationOutcomeIdOption.IsRequired = true; + command.AddOption(educationOutcomeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, educationOutcomeId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new EducationOutcomeRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public EducationOutcomeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/outcomes/{educationOutcome_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Read-Write. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-Write. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-Write. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationOutcome body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-Write. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Read-Write. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Read-Write. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationOutcome model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Read-Write. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/Outcomes/OutcomesRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Outcomes/OutcomesRequestBuilder.cs new file mode 100644 index 00000000000..59bd03bfbaf --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Outcomes/OutcomesRequestBuilder.cs @@ -0,0 +1,224 @@ +using ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Outcomes.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Outcomes { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\outcomes + public class OutcomesRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new EducationOutcomeRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// Read-Write. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Read-Write. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Read-Write. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Read-Write. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new OutcomesRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public OutcomesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/outcomes{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Read-Write. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-Write. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(EducationOutcome body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-Write. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Read-Write. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(EducationOutcome model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Read-Write. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/Outcomes/OutcomesResponse.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Outcomes/OutcomesResponse.cs new file mode 100644 index 00000000000..843c7550b4c --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Outcomes/OutcomesResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Outcomes { + public class OutcomesResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new outcomesResponse and sets the default values. + /// + public OutcomesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as OutcomesResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as OutcomesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/Reassign/ReassignRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Reassign/ReassignRequestBuilder.cs new file mode 100644 index 00000000000..0db6f2c6829 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Reassign/ReassignRequestBuilder.cs @@ -0,0 +1,119 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Reassign { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\microsoft.graph.reassign + public class ReassignRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action reassign + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action reassign"; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new ReassignRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public ReassignRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/microsoft.graph.reassign"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action reassign + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action reassign + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationSubmission + public class ReassignResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationSubmission + public EducationSubmission EducationSubmission { get; set; } + /// + /// Instantiates a new reassignResponse and sets the default values. + /// + public ReassignResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationSubmission", (o,n) => { (o as ReassignResponse).EducationSubmission = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationSubmission", EducationSubmission); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/Resources/Item/EducationSubmissionResourceRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Resources/Item/EducationSubmissionResourceRequestBuilder.cs new file mode 100644 index 00000000000..52535241445 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Resources/Item/EducationSubmissionResourceRequestBuilder.cs @@ -0,0 +1,229 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Resources.Item { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\resources\{educationSubmissionResource-id} + public class EducationSubmissionResourceRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, educationSubmissionResourceId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, educationSubmissionResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, educationSubmissionResourceId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new EducationSubmissionResourceRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public EducationSubmissionResourceRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/resources/{educationSubmissionResource_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationSubmissionResource body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationSubmissionResource model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/Resources/ResourcesRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Resources/ResourcesRequestBuilder.cs new file mode 100644 index 00000000000..d2be3089dbf --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Resources/ResourcesRequestBuilder.cs @@ -0,0 +1,224 @@ +using ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Resources.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Resources { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\resources + public class ResourcesRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new EducationSubmissionResourceRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new ResourcesRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public ResourcesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/resources{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(EducationSubmissionResource body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(EducationSubmissionResource model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/Resources/ResourcesResponse.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Resources/ResourcesResponse.cs new file mode 100644 index 00000000000..80a4fb4b34a --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Resources/ResourcesResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Resources { + public class ResourcesResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new resourcesResponse and sets the default values. + /// + public ResourcesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as ResourcesResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as ResourcesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs new file mode 100644 index 00000000000..475aad0630a --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs @@ -0,0 +1,119 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item.SetUpResourcesFolder { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\microsoft.graph.setUpResourcesFolder + public class SetUpResourcesFolderRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action setUpResourcesFolder + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action setUpResourcesFolder"; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new SetUpResourcesFolderRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public SetUpResourcesFolderRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/microsoft.graph.setUpResourcesFolder"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action setUpResourcesFolder + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action setUpResourcesFolder + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationSubmission + public class SetUpResourcesFolderResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationSubmission + public EducationSubmission EducationSubmission { get; set; } + /// + /// Instantiates a new setUpResourcesFolderResponse and sets the default values. + /// + public SetUpResourcesFolderResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationSubmission", (o,n) => { (o as SetUpResourcesFolderResponse).EducationSubmission = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationSubmission", EducationSubmission); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/Submit/SubmitRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Submit/SubmitRequestBuilder.cs new file mode 100644 index 00000000000..fd69653e5d3 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Submit/SubmitRequestBuilder.cs @@ -0,0 +1,119 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Submit { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\microsoft.graph.submit + public class SubmitRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action submit + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action submit"; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new SubmitRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public SubmitRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/microsoft.graph.submit"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action submit + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action submit + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationSubmission + public class SubmitResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationSubmission + public EducationSubmission EducationSubmission { get; set; } + /// + /// Instantiates a new submitResponse and sets the default values. + /// + public SubmitResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationSubmission", (o,n) => { (o as SubmitResponse).EducationSubmission = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationSubmission", EducationSubmission); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/SubmittedResources/Item/EducationSubmissionResourceRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/SubmittedResources/Item/EducationSubmissionResourceRequestBuilder.cs new file mode 100644 index 00000000000..4807e8d0987 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/SubmittedResources/Item/EducationSubmissionResourceRequestBuilder.cs @@ -0,0 +1,229 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item.SubmittedResources.Item { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\submittedResources\{educationSubmissionResource-id} + public class EducationSubmissionResourceRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Read-only. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, educationSubmissionResourceId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Read-only. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, educationSubmissionResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Read-only. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, educationSubmissionResourceId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new EducationSubmissionResourceRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public EducationSubmissionResourceRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/submittedResources/{educationSubmissionResource_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Read-only. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationSubmissionResource body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationSubmissionResource model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesRequestBuilder.cs new file mode 100644 index 00000000000..00aa3679070 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesRequestBuilder.cs @@ -0,0 +1,224 @@ +using ApiSdk.Education.Me.Assignments.Item.Submissions.Item.SubmittedResources.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item.SubmittedResources { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\submittedResources + public class SubmittedResourcesRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new EducationSubmissionResourceRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// Read-only. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Read-only. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new SubmittedResourcesRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public SubmittedResourcesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/submittedResources{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(EducationSubmissionResource body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(EducationSubmissionResource model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesResponse.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesResponse.cs new file mode 100644 index 00000000000..5a77f1b9299 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item.SubmittedResources { + public class SubmittedResourcesResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new submittedResourcesResponse and sets the default values. + /// + public SubmittedResourcesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as SubmittedResourcesResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as SubmittedResourcesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/Item/Unsubmit/UnsubmitRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Unsubmit/UnsubmitRequestBuilder.cs new file mode 100644 index 00000000000..104d0a1f803 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/Item/Unsubmit/UnsubmitRequestBuilder.cs @@ -0,0 +1,119 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions.Item.Unsubmit { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\microsoft.graph.unsubmit + public class UnsubmitRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action unsubmit + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action unsubmit"; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, educationSubmissionId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new UnsubmitRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public UnsubmitRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/microsoft.graph.unsubmit"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action unsubmit + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action unsubmit + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationSubmission + public class UnsubmitResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationSubmission + public EducationSubmission EducationSubmission { get; set; } + /// + /// Instantiates a new unsubmitResponse and sets the default values. + /// + public UnsubmitResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationSubmission", (o,n) => { (o as UnsubmitResponse).EducationSubmission = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationSubmission", EducationSubmission); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/SubmissionsRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Submissions/SubmissionsRequestBuilder.cs new file mode 100644 index 00000000000..33d188d83e5 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/SubmissionsRequestBuilder.cs @@ -0,0 +1,226 @@ +using ApiSdk.Education.Me.Assignments.Item.Submissions.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions { + /// Builds and executes requests for operations under \education\me\assignments\{educationAssignment-id}\submissions + public class SubmissionsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new EducationSubmissionRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildOutcomesCommand(), + builder.BuildPatchCommand(), + builder.BuildReassignCommand(), + builder.BuildResourcesCommand(), + builder.BuildReturnCommand(), + builder.BuildSetUpResourcesFolderCommand(), + builder.BuildSubmitCommand(), + builder.BuildSubmittedResourcesCommand(), + builder.BuildUnsubmitCommand(), + }; + return commands; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; + // Create options for all the parameters + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationAssignmentId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new SubmissionsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public SubmissionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/me/assignments/{educationAssignment_id}/submissions{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(EducationSubmission body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(EducationSubmission model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Education/Me/Assignments/Item/Submissions/SubmissionsResponse.cs b/src/generated/Education/Me/Assignments/Item/Submissions/SubmissionsResponse.cs new file mode 100644 index 00000000000..5c82300cac6 --- /dev/null +++ b/src/generated/Education/Me/Assignments/Item/Submissions/SubmissionsResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Education.Me.Assignments.Item.Submissions { + public class SubmissionsResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new submissionsResponse and sets the default values. + /// + public SubmissionsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as SubmissionsResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as SubmissionsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Education/Me/Classes/@Ref/RefRequestBuilder.cs b/src/generated/Education/Me/Classes/@Ref/RefRequestBuilder.cs index da05576cf36..509da506e17 100644 --- a/src/generated/Education/Me/Classes/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Me/Classes/@Ref/RefRequestBuilder.cs @@ -25,20 +25,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Classes to which the user belongs. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,12 +71,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Classes to which the user belongs. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Me/Classes/ClassesRequestBuilder.cs b/src/generated/Education/Me/Classes/ClassesRequestBuilder.cs index 7cdb4f3559c..a9c0696600f 100644 --- a/src/generated/Education/Me/Classes/ClassesRequestBuilder.cs +++ b/src/generated/Education/Me/Classes/ClassesRequestBuilder.cs @@ -27,24 +27,44 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Classes to which the user belongs. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Me/Classes/Delta/DeltaRequestBuilder.cs b/src/generated/Education/Me/Classes/Delta/DeltaRequestBuilder.cs index 1abb0de1718..dd8abcbaa40 100644 --- a/src/generated/Education/Me/Classes/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Education/Me/Classes/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Me/MeRequestBuilder.cs b/src/generated/Education/Me/MeRequestBuilder.cs index 78070a60315..20278c5401d 100644 --- a/src/generated/Education/Me/MeRequestBuilder.cs +++ b/src/generated/Education/Me/MeRequestBuilder.cs @@ -1,3 +1,4 @@ +using ApiSdk.Education.Me.Assignments; using ApiSdk.Education.Me.Classes; using ApiSdk.Education.Me.Rubrics; using ApiSdk.Education.Me.Schools; @@ -24,6 +25,13 @@ public class MeRequestBuilder { private IRequestAdapter RequestAdapter { get; set; } /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } + public Command BuildAssignmentsCommand() { + var command = new Command("assignments"); + var builder = new ApiSdk.Education.Me.Assignments.AssignmentsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } public Command BuildClassesCommand() { var command = new Command("classes"); var builder = new ApiSdk.Education.Me.Classes.ClassesRequestBuilder(PathParameters, RequestAdapter); @@ -39,7 +47,8 @@ public Command BuildDeleteCommand() { command.Description = "Delete navigation property me for education"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,12 +62,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get me from education"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,12 +93,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property me in education"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Me/Rubrics/Item/EducationRubricRequestBuilder.cs b/src/generated/Education/Me/Rubrics/Item/EducationRubricRequestBuilder.cs index a83732cace7..d6fa4d8f467 100644 --- a/src/generated/Education/Me/Rubrics/Item/EducationRubricRequestBuilder.cs +++ b/src/generated/Education/Me/Rubrics/Item/EducationRubricRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property rubrics for education"; // Create options for all the parameters - command.AddOption(new Option("--educationrubric-id", description: "key: id of educationRubric")); + var educationRubricIdOption = new Option("--educationrubric-id", description: "key: id of educationRubric"); + educationRubricIdOption.IsRequired = true; + command.AddOption(educationRubricIdOption); command.Handler = CommandHandler.Create(async (educationRubricId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationRubricId)) requestInfo.PathParameters.Add("educationRubric_id", educationRubricId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get rubrics from education"; // Create options for all the parameters - command.AddOption(new Option("--educationrubric-id", description: "key: id of educationRubric")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationRubricId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationRubricId)) requestInfo.PathParameters.Add("educationRubric_id", educationRubricId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationRubricIdOption = new Option("--educationrubric-id", description: "key: id of educationRubric"); + educationRubricIdOption.IsRequired = true; + command.AddOption(educationRubricIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationRubricId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property rubrics in education"; // Create options for all the parameters - command.AddOption(new Option("--educationrubric-id", description: "key: id of educationRubric")); - command.AddOption(new Option("--body")); + var educationRubricIdOption = new Option("--educationrubric-id", description: "key: id of educationRubric"); + educationRubricIdOption.IsRequired = true; + command.AddOption(educationRubricIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationRubricId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationRubricId)) requestInfo.PathParameters.Add("educationRubric_id", educationRubricId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Me/Rubrics/RubricsRequestBuilder.cs b/src/generated/Education/Me/Rubrics/RubricsRequestBuilder.cs index 03a2430ed0a..89774dc63fd 100644 --- a/src/generated/Education/Me/Rubrics/RubricsRequestBuilder.cs +++ b/src/generated/Education/Me/Rubrics/RubricsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to rubrics for education"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get rubrics from education"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Me/Schools/@Ref/RefRequestBuilder.cs b/src/generated/Education/Me/Schools/@Ref/RefRequestBuilder.cs index ee0ac3e5af0..9868d4925c7 100644 --- a/src/generated/Education/Me/Schools/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Me/Schools/@Ref/RefRequestBuilder.cs @@ -25,20 +25,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Schools to which the user belongs. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,12 +71,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Schools to which the user belongs. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Me/Schools/Delta/DeltaRequestBuilder.cs b/src/generated/Education/Me/Schools/Delta/DeltaRequestBuilder.cs index 3cbe7618b1a..72c44f34f9b 100644 --- a/src/generated/Education/Me/Schools/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Education/Me/Schools/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Me/Schools/SchoolsRequestBuilder.cs b/src/generated/Education/Me/Schools/SchoolsRequestBuilder.cs index 4775549e62d..fc77cf99890 100644 --- a/src/generated/Education/Me/Schools/SchoolsRequestBuilder.cs +++ b/src/generated/Education/Me/Schools/SchoolsRequestBuilder.cs @@ -27,24 +27,44 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Schools to which the user belongs. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Me/TaughtClasses/@Ref/RefRequestBuilder.cs b/src/generated/Education/Me/TaughtClasses/@Ref/RefRequestBuilder.cs index 554ef5ef2d5..9c0b43aaa73 100644 --- a/src/generated/Education/Me/TaughtClasses/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Me/TaughtClasses/@Ref/RefRequestBuilder.cs @@ -25,20 +25,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Classes for which the user is a teacher."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,12 +71,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Classes for which the user is a teacher."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Me/TaughtClasses/Delta/DeltaRequestBuilder.cs b/src/generated/Education/Me/TaughtClasses/Delta/DeltaRequestBuilder.cs index 6333cd72369..a4ba5992d97 100644 --- a/src/generated/Education/Me/TaughtClasses/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Education/Me/TaughtClasses/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Me/TaughtClasses/TaughtClassesRequestBuilder.cs b/src/generated/Education/Me/TaughtClasses/TaughtClassesRequestBuilder.cs index 43b05568340..6fe28f45458 100644 --- a/src/generated/Education/Me/TaughtClasses/TaughtClassesRequestBuilder.cs +++ b/src/generated/Education/Me/TaughtClasses/TaughtClassesRequestBuilder.cs @@ -27,24 +27,44 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Classes for which the user is a teacher."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Me/User/@Ref/RefRequestBuilder.cs b/src/generated/Education/Me/User/@Ref/RefRequestBuilder.cs index 01af5fbb5cf..e3c795f383a 100644 --- a/src/generated/Education/Me/User/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Me/User/@Ref/RefRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildDeleteCommand() { command.Description = "The directory user corresponding to this user."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,7 +42,8 @@ public Command BuildGetCommand() { command.Description = "The directory user corresponding to this user."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,12 +62,15 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The directory user corresponding to this user."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Me/User/UserRequestBuilder.cs b/src/generated/Education/Me/User/UserRequestBuilder.cs index 75b1d6a7df2..8add2b2b0c4 100644 --- a/src/generated/Education/Me/User/UserRequestBuilder.cs +++ b/src/generated/Education/Me/User/UserRequestBuilder.cs @@ -27,12 +27,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The directory user corresponding to this user."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Schools/Delta/DeltaRequestBuilder.cs b/src/generated/Education/Schools/Delta/DeltaRequestBuilder.cs index c25e2cf50aa..78c858fb8b5 100644 --- a/src/generated/Education/Schools/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Education/Schools/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Schools/Item/AdministrativeUnit/@Ref/RefRequestBuilder.cs b/src/generated/Education/Schools/Item/AdministrativeUnit/@Ref/RefRequestBuilder.cs index 2f564c9c1f7..4d9fc851366 100644 --- a/src/generated/Education/Schools/Item/AdministrativeUnit/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Schools/Item/AdministrativeUnit/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The underlying administrativeUnit for this school."; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); command.Handler = CommandHandler.Create(async (educationSchoolId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The underlying administrativeUnit for this school."; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); command.Handler = CommandHandler.Create(async (educationSchoolId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The underlying administrativeUnit for this school."; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); - command.AddOption(new Option("--body")); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationSchoolId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Schools/Item/AdministrativeUnit/AdministrativeUnitRequestBuilder.cs b/src/generated/Education/Schools/Item/AdministrativeUnit/AdministrativeUnitRequestBuilder.cs index a64df2fef95..a4a5bea6224 100644 --- a/src/generated/Education/Schools/Item/AdministrativeUnit/AdministrativeUnitRequestBuilder.cs +++ b/src/generated/Education/Schools/Item/AdministrativeUnit/AdministrativeUnitRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The underlying administrativeUnit for this school."; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationSchoolId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationSchoolId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Schools/Item/Classes/@Ref/RefRequestBuilder.cs b/src/generated/Education/Schools/Item/Classes/@Ref/RefRequestBuilder.cs index 15ccc63fe8f..754df1db351 100644 --- a/src/generated/Education/Schools/Item/Classes/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Schools/Item/Classes/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Classes taught at the school. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (educationSchoolId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (educationSchoolId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Classes taught at the school. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); - command.AddOption(new Option("--body")); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationSchoolId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Schools/Item/Classes/ClassesRequestBuilder.cs b/src/generated/Education/Schools/Item/Classes/ClassesRequestBuilder.cs index 05cda0f7969..9fc0ebeb88f 100644 --- a/src/generated/Education/Schools/Item/Classes/ClassesRequestBuilder.cs +++ b/src/generated/Education/Schools/Item/Classes/ClassesRequestBuilder.cs @@ -27,26 +27,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Classes taught at the school. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationSchoolId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationSchoolId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Schools/Item/Classes/Delta/DeltaRequestBuilder.cs b/src/generated/Education/Schools/Item/Classes/Delta/DeltaRequestBuilder.cs index 763888681b4..9c9f37ad779 100644 --- a/src/generated/Education/Schools/Item/Classes/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Education/Schools/Item/Classes/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); command.Handler = CommandHandler.Create(async (educationSchoolId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Schools/Item/EducationSchoolRequestBuilder.cs b/src/generated/Education/Schools/Item/EducationSchoolRequestBuilder.cs index 5bbcc516332..5fe1ca5b78a 100644 --- a/src/generated/Education/Schools/Item/EducationSchoolRequestBuilder.cs +++ b/src/generated/Education/Schools/Item/EducationSchoolRequestBuilder.cs @@ -43,10 +43,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property schools for education"; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); command.Handler = CommandHandler.Create(async (educationSchoolId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -60,14 +62,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get schools from education"; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationSchoolId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationSchoolId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,14 +96,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property schools in education"; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); - command.AddOption(new Option("--body")); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationSchoolId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Schools/Item/Users/@Ref/RefRequestBuilder.cs b/src/generated/Education/Schools/Item/Users/@Ref/RefRequestBuilder.cs index a0ecf2e273e..74750741eb0 100644 --- a/src/generated/Education/Schools/Item/Users/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Schools/Item/Users/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Users in the school. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (educationSchoolId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (educationSchoolId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Users in the school. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); - command.AddOption(new Option("--body")); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationSchoolId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Schools/Item/Users/Delta/DeltaRequestBuilder.cs b/src/generated/Education/Schools/Item/Users/Delta/DeltaRequestBuilder.cs index 3ad5c40d660..44d5b5a03d9 100644 --- a/src/generated/Education/Schools/Item/Users/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Education/Schools/Item/Users/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); command.Handler = CommandHandler.Create(async (educationSchoolId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Schools/Item/Users/UsersRequestBuilder.cs b/src/generated/Education/Schools/Item/Users/UsersRequestBuilder.cs index 0edff599ec6..a48a6a9bbc7 100644 --- a/src/generated/Education/Schools/Item/Users/UsersRequestBuilder.cs +++ b/src/generated/Education/Schools/Item/Users/UsersRequestBuilder.cs @@ -27,26 +27,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Users in the school. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationschool-id", description: "key: id of educationSchool")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationSchoolId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationSchoolId)) requestInfo.PathParameters.Add("educationSchool_id", educationSchoolId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationSchoolIdOption = new Option("--educationschool-id", description: "key: id of educationSchool"); + educationSchoolIdOption.IsRequired = true; + command.AddOption(educationSchoolIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationSchoolId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Schools/SchoolsRequestBuilder.cs b/src/generated/Education/Schools/SchoolsRequestBuilder.cs index 41140babc28..9700751516a 100644 --- a/src/generated/Education/Schools/SchoolsRequestBuilder.cs +++ b/src/generated/Education/Schools/SchoolsRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to schools for education"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +67,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get schools from education"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Users/Delta/DeltaRequestBuilder.cs b/src/generated/Education/Users/Delta/DeltaRequestBuilder.cs index 6d42a40f95c..7b235ee4744 100644 --- a/src/generated/Education/Users/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Education/Users/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Users/Item/Assignments/AssignmentsRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/AssignmentsRequestBuilder.cs new file mode 100644 index 00000000000..67c476cfea3 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/AssignmentsRequestBuilder.cs @@ -0,0 +1,224 @@ +using ApiSdk.Education.Users.Item.Assignments.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments + public class AssignmentsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new EducationAssignmentRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildCategoriesCommand(), + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + builder.BuildPublishCommand(), + builder.BuildResourcesCommand(), + builder.BuildRubricCommand(), + builder.BuildSetUpResourcesFolderCommand(), + builder.BuildSubmissionsCommand(), + }; + return commands; + } + /// + /// List of assignments for the user. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "List of assignments for the user. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// List of assignments for the user. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "List of assignments for the user. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new AssignmentsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AssignmentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// List of assignments for the user. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of assignments for the user. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(EducationAssignment body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of assignments for the user. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of assignments for the user. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(EducationAssignment model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// List of assignments for the user. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/AssignmentsResponse.cs b/src/generated/Education/Users/Item/Assignments/AssignmentsResponse.cs new file mode 100644 index 00000000000..e02f481215f --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/AssignmentsResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Education.Users.Item.Assignments { + public class AssignmentsResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new assignmentsResponse and sets the default values. + /// + public AssignmentsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as AssignmentsResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as AssignmentsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Categories/CategoriesRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Categories/CategoriesRequestBuilder.cs new file mode 100644 index 00000000000..52715881532 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Categories/CategoriesRequestBuilder.cs @@ -0,0 +1,224 @@ +using ApiSdk.Education.Users.Item.Assignments.Item.Categories.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Categories { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\categories + public class CategoriesRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new EducationCategoryRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new CategoriesRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public CategoriesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/categories{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(EducationCategory body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(EducationCategory model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Categories/CategoriesResponse.cs b/src/generated/Education/Users/Item/Assignments/Item/Categories/CategoriesResponse.cs new file mode 100644 index 00000000000..1635100fcf1 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Categories/CategoriesResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Categories { + public class CategoriesResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new categoriesResponse and sets the default values. + /// + public CategoriesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as CategoriesResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as CategoriesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Categories/Item/EducationCategoryRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Categories/Item/EducationCategoryRequestBuilder.cs new file mode 100644 index 00000000000..c8bc9384bc4 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Categories/Item/EducationCategoryRequestBuilder.cs @@ -0,0 +1,229 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Categories.Item { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\categories\{educationCategory-id} + public class EducationCategoryRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationCategoryIdOption = new Option("--educationcategory-id", description: "key: id of educationCategory"); + educationCategoryIdOption.IsRequired = true; + command.AddOption(educationCategoryIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationCategoryId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationCategoryIdOption = new Option("--educationcategory-id", description: "key: id of educationCategory"); + educationCategoryIdOption.IsRequired = true; + command.AddOption(educationCategoryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationCategoryId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "When set, enables users to easily find assignments of a given type. Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationCategoryIdOption = new Option("--educationcategory-id", description: "key: id of educationCategory"); + educationCategoryIdOption.IsRequired = true; + command.AddOption(educationCategoryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationCategoryId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new EducationCategoryRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public EducationCategoryRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/categories/{educationCategory_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationCategory body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationCategory model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// When set, enables users to easily find assignments of a given type. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/EducationAssignmentRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/EducationAssignmentRequestBuilder.cs new file mode 100644 index 00000000000..cd5809c3f07 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/EducationAssignmentRequestBuilder.cs @@ -0,0 +1,267 @@ +using ApiSdk.Education.Users.Item.Assignments.Item.Categories; +using ApiSdk.Education.Users.Item.Assignments.Item.Publish; +using ApiSdk.Education.Users.Item.Assignments.Item.Resources; +using ApiSdk.Education.Users.Item.Assignments.Item.Rubric; +using ApiSdk.Education.Users.Item.Assignments.Item.SetUpResourcesFolder; +using ApiSdk.Education.Users.Item.Assignments.Item.Submissions; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id} + public class EducationAssignmentRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public Command BuildCategoriesCommand() { + var command = new Command("categories"); + var builder = new ApiSdk.Education.Users.Item.Assignments.Item.Categories.CategoriesRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + /// + /// List of assignments for the user. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "List of assignments for the user. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// List of assignments for the user. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "List of assignments for the user. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// List of assignments for the user. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "List of assignments for the user. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + public Command BuildPublishCommand() { + var command = new Command("publish"); + var builder = new ApiSdk.Education.Users.Item.Assignments.Item.Publish.PublishRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + public Command BuildResourcesCommand() { + var command = new Command("resources"); + var builder = new ApiSdk.Education.Users.Item.Assignments.Item.Resources.ResourcesRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + public Command BuildRubricCommand() { + var command = new Command("rubric"); + var builder = new ApiSdk.Education.Users.Item.Assignments.Item.Rubric.RubricRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildDeleteCommand()); + command.AddCommand(builder.BuildGetCommand()); + command.AddCommand(builder.BuildPatchCommand()); + return command; + } + public Command BuildSetUpResourcesFolderCommand() { + var command = new Command("set-up-resources-folder"); + var builder = new ApiSdk.Education.Users.Item.Assignments.Item.SetUpResourcesFolder.SetUpResourcesFolderRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + public Command BuildSubmissionsCommand() { + var command = new Command("submissions"); + var builder = new ApiSdk.Education.Users.Item.Assignments.Item.Submissions.SubmissionsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + /// + /// Instantiates a new EducationAssignmentRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public EducationAssignmentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// List of assignments for the user. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of assignments for the user. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of assignments for the user. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationAssignment body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of assignments for the user. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of assignments for the user. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of assignments for the user. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationAssignment model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// List of assignments for the user. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Publish/PublishRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Publish/PublishRequestBuilder.cs new file mode 100644 index 00000000000..9971db2d9d5 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Publish/PublishRequestBuilder.cs @@ -0,0 +1,119 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Publish { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\microsoft.graph.publish + public class PublishRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action publish + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action publish"; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new PublishRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public PublishRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/microsoft.graph.publish"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action publish + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action publish + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationAssignment + public class PublishResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationAssignment + public EducationAssignment EducationAssignment { get; set; } + /// + /// Instantiates a new publishResponse and sets the default values. + /// + public PublishResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationAssignment", (o,n) => { (o as PublishResponse).EducationAssignment = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationAssignment", EducationAssignment); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Resources/Item/EducationAssignmentResourceRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Resources/Item/EducationAssignmentResourceRequestBuilder.cs new file mode 100644 index 00000000000..2a25faed509 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Resources/Item/EducationAssignmentResourceRequestBuilder.cs @@ -0,0 +1,229 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Resources.Item { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\resources\{educationAssignmentResource-id} + public class EducationAssignmentResourceRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationAssignmentResourceIdOption = new Option("--educationassignmentresource-id", description: "key: id of educationAssignmentResource"); + educationAssignmentResourceIdOption.IsRequired = true; + command.AddOption(educationAssignmentResourceIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationAssignmentResourceId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationAssignmentResourceIdOption = new Option("--educationassignmentresource-id", description: "key: id of educationAssignmentResource"); + educationAssignmentResourceIdOption.IsRequired = true; + command.AddOption(educationAssignmentResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationAssignmentResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationAssignmentResourceIdOption = new Option("--educationassignmentresource-id", description: "key: id of educationAssignmentResource"); + educationAssignmentResourceIdOption.IsRequired = true; + command.AddOption(educationAssignmentResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationAssignmentResourceId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new EducationAssignmentResourceRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public EducationAssignmentResourceRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/resources/{educationAssignmentResource_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationAssignmentResource body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationAssignmentResource model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Resources/ResourcesRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Resources/ResourcesRequestBuilder.cs new file mode 100644 index 00000000000..cc685887681 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Resources/ResourcesRequestBuilder.cs @@ -0,0 +1,224 @@ +using ApiSdk.Education.Users.Item.Assignments.Item.Resources.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Resources { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\resources + public class ResourcesRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new EducationAssignmentResourceRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new ResourcesRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public ResourcesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/resources{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(EducationAssignmentResource body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(EducationAssignmentResource model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Resources/ResourcesResponse.cs b/src/generated/Education/Users/Item/Assignments/Item/Resources/ResourcesResponse.cs new file mode 100644 index 00000000000..8580c3ed972 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Resources/ResourcesResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Resources { + public class ResourcesResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new resourcesResponse and sets the default values. + /// + public ResourcesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as ResourcesResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as ResourcesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Rubric/RubricRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Rubric/RubricRequestBuilder.cs new file mode 100644 index 00000000000..294361dc2f9 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Rubric/RubricRequestBuilder.cs @@ -0,0 +1,220 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Rubric { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\rubric + public class RubricRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// When set, the grading rubric attached to this assignment. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "When set, the grading rubric attached to this assignment."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// When set, the grading rubric attached to this assignment. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "When set, the grading rubric attached to this assignment."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// When set, the grading rubric attached to this assignment. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "When set, the grading rubric attached to this assignment."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new RubricRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public RubricRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/rubric{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// When set, the grading rubric attached to this assignment. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, the grading rubric attached to this assignment. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, the grading rubric attached to this assignment. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationRubric body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// When set, the grading rubric attached to this assignment. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// When set, the grading rubric attached to this assignment. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// When set, the grading rubric attached to this assignment. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationRubric model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// When set, the grading rubric attached to this assignment. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs new file mode 100644 index 00000000000..f1f33a14ee6 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs @@ -0,0 +1,119 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.SetUpResourcesFolder { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\microsoft.graph.setUpResourcesFolder + public class SetUpResourcesFolderRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action setUpResourcesFolder + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action setUpResourcesFolder"; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new SetUpResourcesFolderRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public SetUpResourcesFolderRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/microsoft.graph.setUpResourcesFolder"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action setUpResourcesFolder + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action setUpResourcesFolder + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationAssignment + public class SetUpResourcesFolderResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationAssignment + public EducationAssignment EducationAssignment { get; set; } + /// + /// Instantiates a new setUpResourcesFolderResponse and sets the default values. + /// + public SetUpResourcesFolderResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationAssignment", (o,n) => { (o as SetUpResourcesFolderResponse).EducationAssignment = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationAssignment", EducationAssignment); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/@Return/ReturnRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/@Return/ReturnRequestBuilder.cs new file mode 100644 index 00000000000..1203d00a4c7 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/@Return/ReturnRequestBuilder.cs @@ -0,0 +1,122 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.@Return { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\microsoft.graph.return + public class ReturnRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action return + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action return"; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new ReturnRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public ReturnRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/microsoft.graph.return"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action return + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action return + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationSubmission + public class ReturnResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationSubmission + public EducationSubmission EducationSubmission { get; set; } + /// + /// Instantiates a new returnResponse and sets the default values. + /// + public ReturnResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationSubmission", (o,n) => { (o as ReturnResponse).EducationSubmission = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationSubmission", EducationSubmission); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/EducationSubmissionRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/EducationSubmissionRequestBuilder.cs new file mode 100644 index 00000000000..4a4abf971cb --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/EducationSubmissionRequestBuilder.cs @@ -0,0 +1,288 @@ +using ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Outcomes; +using ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Reassign; +using ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Resources; +using ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Return; +using ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.SetUpResourcesFolder; +using ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Submit; +using ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.SubmittedResources; +using ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Unsubmit; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\submissions\{educationSubmission-id} + public class EducationSubmissionRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + public Command BuildOutcomesCommand() { + var command = new Command("outcomes"); + var builder = new ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Outcomes.OutcomesRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + public Command BuildReassignCommand() { + var command = new Command("reassign"); + var builder = new ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Reassign.ReassignRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + public Command BuildResourcesCommand() { + var command = new Command("resources"); + var builder = new ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Resources.ResourcesRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + public Command BuildReturnCommand() { + var command = new Command("return"); + var builder = new ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.@Return.ReturnRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + public Command BuildSetUpResourcesFolderCommand() { + var command = new Command("set-up-resources-folder"); + var builder = new ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.SetUpResourcesFolder.SetUpResourcesFolderRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + public Command BuildSubmitCommand() { + var command = new Command("submit"); + var builder = new ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Submit.SubmitRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + public Command BuildSubmittedResourcesCommand() { + var command = new Command("submitted-resources"); + var builder = new ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.SubmittedResources.SubmittedResourcesRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + public Command BuildUnsubmitCommand() { + var command = new Command("unsubmit"); + var builder = new ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Unsubmit.UnsubmitRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + /// + /// Instantiates a new EducationSubmissionRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public EducationSubmissionRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationSubmission body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationSubmission model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Outcomes/Item/EducationOutcomeRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Outcomes/Item/EducationOutcomeRequestBuilder.cs new file mode 100644 index 00000000000..59304fbe785 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Outcomes/Item/EducationOutcomeRequestBuilder.cs @@ -0,0 +1,238 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Outcomes.Item { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\outcomes\{educationOutcome-id} + public class EducationOutcomeRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Read-Write. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Read-Write. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationOutcomeIdOption = new Option("--educationoutcome-id", description: "key: id of educationOutcome"); + educationOutcomeIdOption.IsRequired = true; + command.AddOption(educationOutcomeIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, educationOutcomeId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Read-Write. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Read-Write. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationOutcomeIdOption = new Option("--educationoutcome-id", description: "key: id of educationOutcome"); + educationOutcomeIdOption.IsRequired = true; + command.AddOption(educationOutcomeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, educationOutcomeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Read-Write. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Read-Write. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationOutcomeIdOption = new Option("--educationoutcome-id", description: "key: id of educationOutcome"); + educationOutcomeIdOption.IsRequired = true; + command.AddOption(educationOutcomeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, educationOutcomeId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new EducationOutcomeRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public EducationOutcomeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/outcomes/{educationOutcome_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Read-Write. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-Write. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-Write. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationOutcome body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-Write. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Read-Write. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Read-Write. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationOutcome model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Read-Write. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Outcomes/OutcomesRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Outcomes/OutcomesRequestBuilder.cs new file mode 100644 index 00000000000..2ad4d965baa --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Outcomes/OutcomesRequestBuilder.cs @@ -0,0 +1,230 @@ +using ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Outcomes.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Outcomes { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\outcomes + public class OutcomesRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new EducationOutcomeRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// Read-Write. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Read-Write. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Read-Write. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Read-Write. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new OutcomesRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public OutcomesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/outcomes{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Read-Write. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-Write. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(EducationOutcome body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-Write. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Read-Write. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(EducationOutcome model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Read-Write. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Outcomes/OutcomesResponse.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Outcomes/OutcomesResponse.cs new file mode 100644 index 00000000000..59dee05af4d --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Outcomes/OutcomesResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Outcomes { + public class OutcomesResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new outcomesResponse and sets the default values. + /// + public OutcomesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as OutcomesResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as OutcomesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Reassign/ReassignRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Reassign/ReassignRequestBuilder.cs new file mode 100644 index 00000000000..1567673149a --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Reassign/ReassignRequestBuilder.cs @@ -0,0 +1,122 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Reassign { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\microsoft.graph.reassign + public class ReassignRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action reassign + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action reassign"; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new ReassignRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public ReassignRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/microsoft.graph.reassign"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action reassign + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action reassign + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationSubmission + public class ReassignResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationSubmission + public EducationSubmission EducationSubmission { get; set; } + /// + /// Instantiates a new reassignResponse and sets the default values. + /// + public ReassignResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationSubmission", (o,n) => { (o as ReassignResponse).EducationSubmission = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationSubmission", EducationSubmission); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Resources/Item/EducationSubmissionResourceRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Resources/Item/EducationSubmissionResourceRequestBuilder.cs new file mode 100644 index 00000000000..896e861ee08 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Resources/Item/EducationSubmissionResourceRequestBuilder.cs @@ -0,0 +1,238 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Resources.Item { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\resources\{educationSubmissionResource-id} + public class EducationSubmissionResourceRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, educationSubmissionResourceId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, educationSubmissionResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, educationSubmissionResourceId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new EducationSubmissionResourceRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public EducationSubmissionResourceRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/resources/{educationSubmissionResource_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationSubmissionResource body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationSubmissionResource model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Resources/ResourcesRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Resources/ResourcesRequestBuilder.cs new file mode 100644 index 00000000000..bf3e84989a3 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Resources/ResourcesRequestBuilder.cs @@ -0,0 +1,230 @@ +using ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Resources.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Resources { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\resources + public class ResourcesRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new EducationSubmissionResourceRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new ResourcesRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public ResourcesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/resources{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(EducationSubmissionResource body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(EducationSubmissionResource model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Resources/ResourcesResponse.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Resources/ResourcesResponse.cs new file mode 100644 index 00000000000..ed076433e56 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Resources/ResourcesResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Resources { + public class ResourcesResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new resourcesResponse and sets the default values. + /// + public ResourcesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as ResourcesResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as ResourcesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs new file mode 100644 index 00000000000..4502ad412bd --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/SetUpResourcesFolder/SetUpResourcesFolderRequestBuilder.cs @@ -0,0 +1,122 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.SetUpResourcesFolder { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\microsoft.graph.setUpResourcesFolder + public class SetUpResourcesFolderRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action setUpResourcesFolder + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action setUpResourcesFolder"; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new SetUpResourcesFolderRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public SetUpResourcesFolderRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/microsoft.graph.setUpResourcesFolder"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action setUpResourcesFolder + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action setUpResourcesFolder + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationSubmission + public class SetUpResourcesFolderResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationSubmission + public EducationSubmission EducationSubmission { get; set; } + /// + /// Instantiates a new setUpResourcesFolderResponse and sets the default values. + /// + public SetUpResourcesFolderResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationSubmission", (o,n) => { (o as SetUpResourcesFolderResponse).EducationSubmission = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationSubmission", EducationSubmission); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Submit/SubmitRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Submit/SubmitRequestBuilder.cs new file mode 100644 index 00000000000..df1fb663465 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Submit/SubmitRequestBuilder.cs @@ -0,0 +1,122 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Submit { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\microsoft.graph.submit + public class SubmitRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action submit + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action submit"; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new SubmitRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public SubmitRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/microsoft.graph.submit"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action submit + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action submit + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationSubmission + public class SubmitResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationSubmission + public EducationSubmission EducationSubmission { get; set; } + /// + /// Instantiates a new submitResponse and sets the default values. + /// + public SubmitResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationSubmission", (o,n) => { (o as SubmitResponse).EducationSubmission = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationSubmission", EducationSubmission); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/SubmittedResources/Item/EducationSubmissionResourceRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/SubmittedResources/Item/EducationSubmissionResourceRequestBuilder.cs new file mode 100644 index 00000000000..b78472a82c3 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/SubmittedResources/Item/EducationSubmissionResourceRequestBuilder.cs @@ -0,0 +1,238 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.SubmittedResources.Item { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\submittedResources\{educationSubmissionResource-id} + public class EducationSubmissionResourceRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Read-only. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, educationSubmissionResourceId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Read-only. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, educationSubmissionResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Read-only. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var educationSubmissionResourceIdOption = new Option("--educationsubmissionresource-id", description: "key: id of educationSubmissionResource"); + educationSubmissionResourceIdOption.IsRequired = true; + command.AddOption(educationSubmissionResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, educationSubmissionResourceId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new EducationSubmissionResourceRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public EducationSubmissionResourceRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/submittedResources/{educationSubmissionResource_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Read-only. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(EducationSubmissionResource body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(EducationSubmissionResource model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesRequestBuilder.cs new file mode 100644 index 00000000000..d14bb2012d3 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesRequestBuilder.cs @@ -0,0 +1,230 @@ +using ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.SubmittedResources.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.SubmittedResources { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\submittedResources + public class SubmittedResourcesRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new EducationSubmissionResourceRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// Read-only. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Read-only. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new SubmittedResourcesRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public SubmittedResourcesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/submittedResources{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(EducationSubmissionResource body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(EducationSubmissionResource model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesResponse.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesResponse.cs new file mode 100644 index 00000000000..7cdd1e61965 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/SubmittedResources/SubmittedResourcesResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.SubmittedResources { + public class SubmittedResourcesResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new submittedResourcesResponse and sets the default values. + /// + public SubmittedResourcesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as SubmittedResourcesResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as SubmittedResourcesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Unsubmit/UnsubmitRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Unsubmit/UnsubmitRequestBuilder.cs new file mode 100644 index 00000000000..2d305108949 --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/Item/Unsubmit/UnsubmitRequestBuilder.cs @@ -0,0 +1,122 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item.Unsubmit { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\submissions\{educationSubmission-id}\microsoft.graph.unsubmit + public class UnsubmitRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action unsubmit + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action unsubmit"; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var educationSubmissionIdOption = new Option("--educationsubmission-id", description: "key: id of educationSubmission"); + educationSubmissionIdOption.IsRequired = true; + command.AddOption(educationSubmissionIdOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, educationSubmissionId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new UnsubmitRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public UnsubmitRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/submissions/{educationSubmission_id}/microsoft.graph.unsubmit"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action unsubmit + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action unsubmit + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Union type wrapper for classes educationSubmission + public class UnsubmitResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Union type representation for type educationSubmission + public EducationSubmission EducationSubmission { get; set; } + /// + /// Instantiates a new unsubmitResponse and sets the default values. + /// + public UnsubmitResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"educationSubmission", (o,n) => { (o as UnsubmitResponse).EducationSubmission = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("educationSubmission", EducationSubmission); + writer.WriteAdditionalData(AdditionalData); + } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/SubmissionsRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/SubmissionsRequestBuilder.cs new file mode 100644 index 00000000000..2a2068b54ca --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/SubmissionsRequestBuilder.cs @@ -0,0 +1,232 @@ +using ApiSdk.Education.Users.Item.Assignments.Item.Submissions.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions { + /// Builds and executes requests for operations under \education\users\{educationUser-id}\assignments\{educationAssignment-id}\submissions + public class SubmissionsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new EducationSubmissionRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildOutcomesCommand(), + builder.BuildPatchCommand(), + builder.BuildReassignCommand(), + builder.BuildResourcesCommand(), + builder.BuildReturnCommand(), + builder.BuildSetUpResourcesFolderCommand(), + builder.BuildSubmitCommand(), + builder.BuildSubmittedResourcesCommand(), + builder.BuildUnsubmitCommand(), + }; + return commands; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable."; + // Create options for all the parameters + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationAssignmentIdOption = new Option("--educationassignment-id", description: "key: id of educationAssignment"); + educationAssignmentIdOption.IsRequired = true; + command.AddOption(educationAssignmentIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationAssignmentId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new SubmissionsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public SubmissionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/education/users/{educationUser_id}/assignments/{educationAssignment_id}/submissions{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(EducationSubmission body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(EducationSubmission model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Education/Users/Item/Assignments/Item/Submissions/SubmissionsResponse.cs b/src/generated/Education/Users/Item/Assignments/Item/Submissions/SubmissionsResponse.cs new file mode 100644 index 00000000000..16734a9a2fe --- /dev/null +++ b/src/generated/Education/Users/Item/Assignments/Item/Submissions/SubmissionsResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Education.Users.Item.Assignments.Item.Submissions { + public class SubmissionsResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new submissionsResponse and sets the default values. + /// + public SubmissionsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as SubmissionsResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as SubmissionsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Education/Users/Item/Classes/@Ref/RefRequestBuilder.cs b/src/generated/Education/Users/Item/Classes/@Ref/RefRequestBuilder.cs index 0ef4dd38834..c49ea6c4f60 100644 --- a/src/generated/Education/Users/Item/Classes/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Users/Item/Classes/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Classes to which the user belongs. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Classes to which the user belongs. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--body")); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationUserId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Users/Item/Classes/ClassesRequestBuilder.cs b/src/generated/Education/Users/Item/Classes/ClassesRequestBuilder.cs index d90920e686b..94e733e2347 100644 --- a/src/generated/Education/Users/Item/Classes/ClassesRequestBuilder.cs +++ b/src/generated/Education/Users/Item/Classes/ClassesRequestBuilder.cs @@ -27,26 +27,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Classes to which the user belongs. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Users/Item/Classes/Delta/DeltaRequestBuilder.cs b/src/generated/Education/Users/Item/Classes/Delta/DeltaRequestBuilder.cs index ec2a58bd007..6de9b12cd47 100644 --- a/src/generated/Education/Users/Item/Classes/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Education/Users/Item/Classes/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); command.Handler = CommandHandler.Create(async (educationUserId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Users/Item/EducationUserRequestBuilder.cs b/src/generated/Education/Users/Item/EducationUserRequestBuilder.cs index d408fdc491d..fc63d06cd6e 100644 --- a/src/generated/Education/Users/Item/EducationUserRequestBuilder.cs +++ b/src/generated/Education/Users/Item/EducationUserRequestBuilder.cs @@ -1,3 +1,4 @@ +using ApiSdk.Education.Users.Item.Assignments; using ApiSdk.Education.Users.Item.Classes; using ApiSdk.Education.Users.Item.Rubrics; using ApiSdk.Education.Users.Item.Schools; @@ -24,6 +25,13 @@ public class EducationUserRequestBuilder { private IRequestAdapter RequestAdapter { get; set; } /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } + public Command BuildAssignmentsCommand() { + var command = new Command("assignments"); + var builder = new ApiSdk.Education.Users.Item.Assignments.AssignmentsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } public Command BuildClassesCommand() { var command = new Command("classes"); var builder = new ApiSdk.Education.Users.Item.Classes.ClassesRequestBuilder(PathParameters, RequestAdapter); @@ -38,10 +46,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property users for education"; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); command.Handler = CommandHandler.Create(async (educationUserId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,14 +65,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get users from education"; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationUserId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,14 +99,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property users in education"; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--body")); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationUserId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Users/Item/Rubrics/Item/EducationRubricRequestBuilder.cs b/src/generated/Education/Users/Item/Rubrics/Item/EducationRubricRequestBuilder.cs index f834d271c2b..25261532238 100644 --- a/src/generated/Education/Users/Item/Rubrics/Item/EducationRubricRequestBuilder.cs +++ b/src/generated/Education/Users/Item/Rubrics/Item/EducationRubricRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property rubrics for education"; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--educationrubric-id", description: "key: id of educationRubric")); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationRubricIdOption = new Option("--educationrubric-id", description: "key: id of educationRubric"); + educationRubricIdOption.IsRequired = true; + command.AddOption(educationRubricIdOption); command.Handler = CommandHandler.Create(async (educationUserId, educationRubricId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); - if (!String.IsNullOrEmpty(educationRubricId)) requestInfo.PathParameters.Add("educationRubric_id", educationRubricId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get rubrics from education"; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--educationrubric-id", description: "key: id of educationRubric")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationUserId, educationRubricId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); - if (!String.IsNullOrEmpty(educationRubricId)) requestInfo.PathParameters.Add("educationRubric_id", educationRubricId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationRubricIdOption = new Option("--educationrubric-id", description: "key: id of educationRubric"); + educationRubricIdOption.IsRequired = true; + command.AddOption(educationRubricIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, educationRubricId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property rubrics in education"; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--educationrubric-id", description: "key: id of educationRubric")); - command.AddOption(new Option("--body")); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var educationRubricIdOption = new Option("--educationrubric-id", description: "key: id of educationRubric"); + educationRubricIdOption.IsRequired = true; + command.AddOption(educationRubricIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationUserId, educationRubricId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); - if (!String.IsNullOrEmpty(educationRubricId)) requestInfo.PathParameters.Add("educationRubric_id", educationRubricId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Users/Item/Rubrics/RubricsRequestBuilder.cs b/src/generated/Education/Users/Item/Rubrics/RubricsRequestBuilder.cs index 50ef41b9ecc..697cffbf034 100644 --- a/src/generated/Education/Users/Item/Rubrics/RubricsRequestBuilder.cs +++ b/src/generated/Education/Users/Item/Rubrics/RubricsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to rubrics for education"; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--body")); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationUserId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get rubrics from education"; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Users/Item/Schools/@Ref/RefRequestBuilder.cs b/src/generated/Education/Users/Item/Schools/@Ref/RefRequestBuilder.cs index 437ca86864e..96e58ead007 100644 --- a/src/generated/Education/Users/Item/Schools/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Users/Item/Schools/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Schools to which the user belongs. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Schools to which the user belongs. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--body")); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationUserId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Users/Item/Schools/Delta/DeltaRequestBuilder.cs b/src/generated/Education/Users/Item/Schools/Delta/DeltaRequestBuilder.cs index 20656d83855..5214ed48710 100644 --- a/src/generated/Education/Users/Item/Schools/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Education/Users/Item/Schools/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); command.Handler = CommandHandler.Create(async (educationUserId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Users/Item/Schools/SchoolsRequestBuilder.cs b/src/generated/Education/Users/Item/Schools/SchoolsRequestBuilder.cs index 923cd1f4e7a..853dfcd97d0 100644 --- a/src/generated/Education/Users/Item/Schools/SchoolsRequestBuilder.cs +++ b/src/generated/Education/Users/Item/Schools/SchoolsRequestBuilder.cs @@ -27,26 +27,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Schools to which the user belongs. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Users/Item/TaughtClasses/@Ref/RefRequestBuilder.cs b/src/generated/Education/Users/Item/TaughtClasses/@Ref/RefRequestBuilder.cs index 27b52bc6140..356621a9628 100644 --- a/src/generated/Education/Users/Item/TaughtClasses/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Users/Item/TaughtClasses/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Classes for which the user is a teacher."; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Classes for which the user is a teacher."; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--body")); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationUserId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Users/Item/TaughtClasses/Delta/DeltaRequestBuilder.cs b/src/generated/Education/Users/Item/TaughtClasses/Delta/DeltaRequestBuilder.cs index 0d896a81e65..f0f39e7e0e5 100644 --- a/src/generated/Education/Users/Item/TaughtClasses/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Education/Users/Item/TaughtClasses/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); command.Handler = CommandHandler.Create(async (educationUserId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Users/Item/TaughtClasses/TaughtClassesRequestBuilder.cs b/src/generated/Education/Users/Item/TaughtClasses/TaughtClassesRequestBuilder.cs index 3f849dda5d0..a435c681463 100644 --- a/src/generated/Education/Users/Item/TaughtClasses/TaughtClassesRequestBuilder.cs +++ b/src/generated/Education/Users/Item/TaughtClasses/TaughtClassesRequestBuilder.cs @@ -27,26 +27,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Classes for which the user is a teacher."; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Users/Item/User/@Ref/RefRequestBuilder.cs b/src/generated/Education/Users/Item/User/@Ref/RefRequestBuilder.cs index cb9667b36dc..1bc7170e7b7 100644 --- a/src/generated/Education/Users/Item/User/@Ref/RefRequestBuilder.cs +++ b/src/generated/Education/Users/Item/User/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The directory user corresponding to this user."; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); command.Handler = CommandHandler.Create(async (educationUserId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The directory user corresponding to this user."; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); command.Handler = CommandHandler.Create(async (educationUserId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The directory user corresponding to this user."; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--body")); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (educationUserId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Education/Users/Item/User/UserRequestBuilder.cs b/src/generated/Education/Users/Item/User/UserRequestBuilder.cs index 4583861770d..1f43340b1ea 100644 --- a/src/generated/Education/Users/Item/User/UserRequestBuilder.cs +++ b/src/generated/Education/Users/Item/User/UserRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The directory user corresponding to this user."; // Create options for all the parameters - command.AddOption(new Option("--educationuser-id", description: "key: id of educationUser")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (educationUserId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(educationUserId)) requestInfo.PathParameters.Add("educationUser_id", educationUserId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var educationUserIdOption = new Option("--educationuser-id", description: "key: id of educationUser"); + educationUserIdOption.IsRequired = true; + command.AddOption(educationUserIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (educationUserId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Education/Users/UsersRequestBuilder.cs b/src/generated/Education/Users/UsersRequestBuilder.cs index ca629855948..8ce0dc4c675 100644 --- a/src/generated/Education/Users/UsersRequestBuilder.cs +++ b/src/generated/Education/Users/UsersRequestBuilder.cs @@ -24,6 +24,7 @@ public class UsersRequestBuilder { public List BuildCommand() { var builder = new EducationUserRequestBuilder(PathParameters, RequestAdapter); var commands = new List { + builder.BuildAssignmentsCommand(), builder.BuildClassesCommand(), builder.BuildDeleteCommand(), builder.BuildGetCommand(), @@ -42,12 +43,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to users for education"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,24 +70,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get users from education"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/External/Connections/ConnectionsRequestBuilder.cs b/src/generated/External/Connections/ConnectionsRequestBuilder.cs index b0a7c876db1..74f686e80fc 100644 --- a/src/generated/External/Connections/ConnectionsRequestBuilder.cs +++ b/src/generated/External/Connections/ConnectionsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to connections for external"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get connections from external"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/External/Connections/Item/ExternalConnectionRequestBuilder.cs b/src/generated/External/Connections/Item/ExternalConnectionRequestBuilder.cs index 289fc48537e..2f551d9bbb4 100644 --- a/src/generated/External/Connections/Item/ExternalConnectionRequestBuilder.cs +++ b/src/generated/External/Connections/Item/ExternalConnectionRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property connections for external"; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); command.Handler = CommandHandler.Create(async (externalConnectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get connections from external"; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (externalConnectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (externalConnectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property connections in external"; // Create options for all the parameters - command.AddOption(new Option("--externalconnection-id", description: "key: id of externalConnection")); - command.AddOption(new Option("--body")); + var externalConnectionIdOption = new Option("--externalconnection-id", description: "key: id of externalConnection"); + externalConnectionIdOption.IsRequired = true; + command.AddOption(externalConnectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (externalConnectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(externalConnectionId)) requestInfo.PathParameters.Add("externalConnection_id", externalConnectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/External/ExternalRequestBuilder.cs b/src/generated/External/ExternalRequestBuilder.cs index 88dc1cdba32..0380f54dcee 100644 --- a/src/generated/External/ExternalRequestBuilder.cs +++ b/src/generated/External/ExternalRequestBuilder.cs @@ -34,12 +34,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get external"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,12 +65,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update external"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/GraphClient.cs b/src/generated/GraphClient.cs index 94b9925066b..219dde82194 100644 --- a/src/generated/GraphClient.cs +++ b/src/generated/GraphClient.cs @@ -35,6 +35,7 @@ using ApiSdk.GroupSettingTemplates; using ApiSdk.Identity; using ApiSdk.IdentityGovernance; +using ApiSdk.IdentityProtection; using ApiSdk.IdentityProviders; using ApiSdk.InformationProtection; using ApiSdk.Invitations; @@ -57,6 +58,7 @@ using ApiSdk.ServicePrincipals; using ApiSdk.Shares; using ApiSdk.Sites; +using ApiSdk.Solutions; using ApiSdk.SubscribedSkus; using ApiSdk.Subscriptions; using ApiSdk.Teams; @@ -221,6 +223,7 @@ public Command BuildCommand() { command.AddCommand(BuildGroupSettingTemplatesCommand()); command.AddCommand(BuildIdentityCommand()); command.AddCommand(BuildIdentityGovernanceCommand()); + command.AddCommand(BuildIdentityProtectionCommand()); command.AddCommand(BuildIdentityProvidersCommand()); command.AddCommand(BuildInformationProtectionCommand()); command.AddCommand(BuildInvitationsCommand()); @@ -243,6 +246,7 @@ public Command BuildCommand() { command.AddCommand(BuildServicePrincipalsCommand()); command.AddCommand(BuildSharesCommand()); command.AddCommand(BuildSitesCommand()); + command.AddCommand(BuildSolutionsCommand()); command.AddCommand(BuildSubscribedSkusCommand()); command.AddCommand(BuildSubscriptionsCommand()); command.AddCommand(BuildTeamsCommand()); @@ -471,7 +475,8 @@ public Command BuildGetCommand() { var command = new Command("get"); // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -535,6 +540,15 @@ public Command BuildIdentityGovernanceCommand() { command.AddCommand(builder.BuildTermsOfUseCommand()); return command; } + public Command BuildIdentityProtectionCommand() { + var command = new Command("identity-protection"); + var builder = new ApiSdk.IdentityProtection.IdentityProtectionRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildGetCommand()); + command.AddCommand(builder.BuildPatchCommand()); + command.AddCommand(builder.BuildRiskDetectionsCommand()); + command.AddCommand(builder.BuildRiskyUsersCommand()); + return command; + } public Command BuildIdentityProvidersCommand() { var command = new Command("identity-providers"); var builder = new ApiSdk.IdentityProviders.IdentityProvidersRequestBuilder(PathParameters, RequestAdapter); @@ -797,6 +811,15 @@ public Command BuildSitesCommand() { command.AddCommand(builder.BuildRemoveCommand()); return command; } + public Command BuildSolutionsCommand() { + var command = new Command("solutions"); + var builder = new ApiSdk.Solutions.SolutionsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildBookingBusinessesCommand()); + command.AddCommand(builder.BuildBookingCurrenciesCommand()); + command.AddCommand(builder.BuildGetCommand()); + command.AddCommand(builder.BuildPatchCommand()); + return command; + } public Command BuildSubscribedSkusCommand() { var command = new Command("subscribed-skus"); var builder = new ApiSdk.SubscribedSkus.SubscribedSkusRequestBuilder(PathParameters, RequestAdapter); diff --git a/src/generated/GroupLifecyclePolicies/GroupLifecyclePoliciesRequestBuilder.cs b/src/generated/GroupLifecyclePolicies/GroupLifecyclePoliciesRequestBuilder.cs index 5d5d816e3e2..e897f6ab69c 100644 --- a/src/generated/GroupLifecyclePolicies/GroupLifecyclePoliciesRequestBuilder.cs +++ b/src/generated/GroupLifecyclePolicies/GroupLifecyclePoliciesRequestBuilder.cs @@ -38,12 +38,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to groupLifecyclePolicies"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +65,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from groupLifecyclePolicies"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/GroupLifecyclePolicies/Item/AddGroup/AddGroupRequestBuilder.cs b/src/generated/GroupLifecyclePolicies/Item/AddGroup/AddGroupRequestBuilder.cs index 229ad287180..28138e234e5 100644 --- a/src/generated/GroupLifecyclePolicies/Item/AddGroup/AddGroupRequestBuilder.cs +++ b/src/generated/GroupLifecyclePolicies/Item/AddGroup/AddGroupRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addGroup"; // Create options for all the parameters - command.AddOption(new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy")); - command.AddOption(new Option("--body")); + var groupLifecyclePolicyIdOption = new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy"); + groupLifecyclePolicyIdOption.IsRequired = true; + command.AddOption(groupLifecyclePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupLifecyclePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupLifecyclePolicyId)) requestInfo.PathParameters.Add("groupLifecyclePolicy_id", groupLifecyclePolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/GroupLifecyclePolicies/Item/GroupLifecyclePolicyRequestBuilder.cs b/src/generated/GroupLifecyclePolicies/Item/GroupLifecyclePolicyRequestBuilder.cs index 5147cb173c4..03d43faae97 100644 --- a/src/generated/GroupLifecyclePolicies/Item/GroupLifecyclePolicyRequestBuilder.cs +++ b/src/generated/GroupLifecyclePolicies/Item/GroupLifecyclePolicyRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from groupLifecyclePolicies"; // Create options for all the parameters - command.AddOption(new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy")); + var groupLifecyclePolicyIdOption = new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy"); + groupLifecyclePolicyIdOption.IsRequired = true; + command.AddOption(groupLifecyclePolicyIdOption); command.Handler = CommandHandler.Create(async (groupLifecyclePolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupLifecyclePolicyId)) requestInfo.PathParameters.Add("groupLifecyclePolicy_id", groupLifecyclePolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from groupLifecyclePolicies by key"; // Create options for all the parameters - command.AddOption(new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupLifecyclePolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupLifecyclePolicyId)) requestInfo.PathParameters.Add("groupLifecyclePolicy_id", groupLifecyclePolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupLifecyclePolicyIdOption = new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy"); + groupLifecyclePolicyIdOption.IsRequired = true; + command.AddOption(groupLifecyclePolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupLifecyclePolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in groupLifecyclePolicies"; // Create options for all the parameters - command.AddOption(new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy")); - command.AddOption(new Option("--body")); + var groupLifecyclePolicyIdOption = new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy"); + groupLifecyclePolicyIdOption.IsRequired = true; + command.AddOption(groupLifecyclePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupLifecyclePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupLifecyclePolicyId)) requestInfo.PathParameters.Add("groupLifecyclePolicy_id", groupLifecyclePolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/GroupLifecyclePolicies/Item/RemoveGroup/RemoveGroupRequestBuilder.cs b/src/generated/GroupLifecyclePolicies/Item/RemoveGroup/RemoveGroupRequestBuilder.cs index e16a8583af1..c1aa1e91fff 100644 --- a/src/generated/GroupLifecyclePolicies/Item/RemoveGroup/RemoveGroupRequestBuilder.cs +++ b/src/generated/GroupLifecyclePolicies/Item/RemoveGroup/RemoveGroupRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action removeGroup"; // Create options for all the parameters - command.AddOption(new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy")); - command.AddOption(new Option("--body")); + var groupLifecyclePolicyIdOption = new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy"); + groupLifecyclePolicyIdOption.IsRequired = true; + command.AddOption(groupLifecyclePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupLifecyclePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupLifecyclePolicyId)) requestInfo.PathParameters.Add("groupLifecyclePolicy_id", groupLifecyclePolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/GroupSettingTemplates/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs b/src/generated/GroupSettingTemplates/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs index 81fa4c16703..b56c79470cd 100644 --- a/src/generated/GroupSettingTemplates/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs +++ b/src/generated/GroupSettingTemplates/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getAvailableExtensionProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/GroupSettingTemplates/GetByIds/GetByIdsRequestBuilder.cs b/src/generated/GroupSettingTemplates/GetByIds/GetByIdsRequestBuilder.cs index dd71e9abc34..88f959e5acb 100644 --- a/src/generated/GroupSettingTemplates/GetByIds/GetByIdsRequestBuilder.cs +++ b/src/generated/GroupSettingTemplates/GetByIds/GetByIdsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getByIds"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/GroupSettingTemplates/GroupSettingTemplatesRequestBuilder.cs b/src/generated/GroupSettingTemplates/GroupSettingTemplatesRequestBuilder.cs index 629d0e90802..ee677b239dd 100644 --- a/src/generated/GroupSettingTemplates/GroupSettingTemplatesRequestBuilder.cs +++ b/src/generated/GroupSettingTemplates/GroupSettingTemplatesRequestBuilder.cs @@ -44,12 +44,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to groupSettingTemplates"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,24 +83,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from groupSettingTemplates"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/GroupSettingTemplates/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs b/src/generated/GroupSettingTemplates/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs index d37483db9ca..b684f68fe48 100644 --- a/src/generated/GroupSettingTemplates/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs +++ b/src/generated/GroupSettingTemplates/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate")); - command.AddOption(new Option("--body")); + var groupSettingTemplateIdOption = new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate"); + groupSettingTemplateIdOption.IsRequired = true; + command.AddOption(groupSettingTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupSettingTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupSettingTemplateId)) requestInfo.PathParameters.Add("groupSettingTemplate_id", groupSettingTemplateId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/GroupSettingTemplates/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs b/src/generated/GroupSettingTemplates/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs index 71bf335dd0c..0bd92476b8b 100644 --- a/src/generated/GroupSettingTemplates/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs +++ b/src/generated/GroupSettingTemplates/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate")); - command.AddOption(new Option("--body")); + var groupSettingTemplateIdOption = new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate"); + groupSettingTemplateIdOption.IsRequired = true; + command.AddOption(groupSettingTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupSettingTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupSettingTemplateId)) requestInfo.PathParameters.Add("groupSettingTemplate_id", groupSettingTemplateId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/GroupSettingTemplates/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs b/src/generated/GroupSettingTemplates/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs index 7ca71cbab8b..9738283ea27 100644 --- a/src/generated/GroupSettingTemplates/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs +++ b/src/generated/GroupSettingTemplates/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate")); - command.AddOption(new Option("--body")); + var groupSettingTemplateIdOption = new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate"); + groupSettingTemplateIdOption.IsRequired = true; + command.AddOption(groupSettingTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupSettingTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupSettingTemplateId)) requestInfo.PathParameters.Add("groupSettingTemplate_id", groupSettingTemplateId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/GroupSettingTemplates/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs b/src/generated/GroupSettingTemplates/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs index dd2aeb9d7b0..b5fb5190fab 100644 --- a/src/generated/GroupSettingTemplates/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs +++ b/src/generated/GroupSettingTemplates/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate")); - command.AddOption(new Option("--body")); + var groupSettingTemplateIdOption = new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate"); + groupSettingTemplateIdOption.IsRequired = true; + command.AddOption(groupSettingTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupSettingTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupSettingTemplateId)) requestInfo.PathParameters.Add("groupSettingTemplate_id", groupSettingTemplateId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/GroupSettingTemplates/Item/GroupSettingTemplateRequestBuilder.cs b/src/generated/GroupSettingTemplates/Item/GroupSettingTemplateRequestBuilder.cs index 92bea7a27b0..2799e0ee6bf 100644 --- a/src/generated/GroupSettingTemplates/Item/GroupSettingTemplateRequestBuilder.cs +++ b/src/generated/GroupSettingTemplates/Item/GroupSettingTemplateRequestBuilder.cs @@ -43,10 +43,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from groupSettingTemplates"; // Create options for all the parameters - command.AddOption(new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate")); + var groupSettingTemplateIdOption = new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate"); + groupSettingTemplateIdOption.IsRequired = true; + command.AddOption(groupSettingTemplateIdOption); command.Handler = CommandHandler.Create(async (groupSettingTemplateId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupSettingTemplateId)) requestInfo.PathParameters.Add("groupSettingTemplate_id", groupSettingTemplateId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -60,14 +62,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from groupSettingTemplates by key"; // Create options for all the parameters - command.AddOption(new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupSettingTemplateId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupSettingTemplateId)) requestInfo.PathParameters.Add("groupSettingTemplate_id", groupSettingTemplateId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupSettingTemplateIdOption = new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate"); + groupSettingTemplateIdOption.IsRequired = true; + command.AddOption(groupSettingTemplateIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupSettingTemplateId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,14 +108,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in groupSettingTemplates"; // Create options for all the parameters - command.AddOption(new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate")); - command.AddOption(new Option("--body")); + var groupSettingTemplateIdOption = new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate"); + groupSettingTemplateIdOption.IsRequired = true; + command.AddOption(groupSettingTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupSettingTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupSettingTemplateId)) requestInfo.PathParameters.Add("groupSettingTemplate_id", groupSettingTemplateId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/GroupSettingTemplates/Item/Restore/RestoreRequestBuilder.cs b/src/generated/GroupSettingTemplates/Item/Restore/RestoreRequestBuilder.cs index e2bb003d286..de129d95193 100644 --- a/src/generated/GroupSettingTemplates/Item/Restore/RestoreRequestBuilder.cs +++ b/src/generated/GroupSettingTemplates/Item/Restore/RestoreRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restore"; // Create options for all the parameters - command.AddOption(new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate")); + var groupSettingTemplateIdOption = new Option("--groupsettingtemplate-id", description: "key: id of groupSettingTemplate"); + groupSettingTemplateIdOption.IsRequired = true; + command.AddOption(groupSettingTemplateIdOption); command.Handler = CommandHandler.Create(async (groupSettingTemplateId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupSettingTemplateId)) requestInfo.PathParameters.Add("groupSettingTemplate_id", groupSettingTemplateId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/GroupSettingTemplates/ValidateProperties/ValidatePropertiesRequestBuilder.cs b/src/generated/GroupSettingTemplates/ValidateProperties/ValidatePropertiesRequestBuilder.cs index b27f7bec96a..5b9cc769041 100644 --- a/src/generated/GroupSettingTemplates/ValidateProperties/ValidatePropertiesRequestBuilder.cs +++ b/src/generated/GroupSettingTemplates/ValidateProperties/ValidatePropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validateProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/GroupSettings/GroupSettingsRequestBuilder.cs b/src/generated/GroupSettings/GroupSettingsRequestBuilder.cs index 073f59c55a0..707b34c74d0 100644 --- a/src/generated/GroupSettings/GroupSettingsRequestBuilder.cs +++ b/src/generated/GroupSettings/GroupSettingsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to groupSettings"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from groupSettings"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/GroupSettings/Item/GroupSettingRequestBuilder.cs b/src/generated/GroupSettings/Item/GroupSettingRequestBuilder.cs index 986cf70a4b2..e566d458882 100644 --- a/src/generated/GroupSettings/Item/GroupSettingRequestBuilder.cs +++ b/src/generated/GroupSettings/Item/GroupSettingRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from groupSettings"; // Create options for all the parameters - command.AddOption(new Option("--groupsetting-id", description: "key: id of groupSetting")); + var groupSettingIdOption = new Option("--groupsetting-id", description: "key: id of groupSetting"); + groupSettingIdOption.IsRequired = true; + command.AddOption(groupSettingIdOption); command.Handler = CommandHandler.Create(async (groupSettingId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupSettingId)) requestInfo.PathParameters.Add("groupSetting_id", groupSettingId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from groupSettings by key"; // Create options for all the parameters - command.AddOption(new Option("--groupsetting-id", description: "key: id of groupSetting")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupSettingId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupSettingId)) requestInfo.PathParameters.Add("groupSetting_id", groupSettingId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupSettingIdOption = new Option("--groupsetting-id", description: "key: id of groupSetting"); + groupSettingIdOption.IsRequired = true; + command.AddOption(groupSettingIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupSettingId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in groupSettings"; // Create options for all the parameters - command.AddOption(new Option("--groupsetting-id", description: "key: id of groupSetting")); - command.AddOption(new Option("--body")); + var groupSettingIdOption = new Option("--groupsetting-id", description: "key: id of groupSetting"); + groupSettingIdOption.IsRequired = true; + command.AddOption(groupSettingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupSettingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupSettingId)) requestInfo.PathParameters.Add("groupSetting_id", groupSettingId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Delta/DeltaRequestBuilder.cs b/src/generated/Groups/Delta/DeltaRequestBuilder.cs index 40ff77b6737..ef7a99196be 100644 --- a/src/generated/Groups/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Groups/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs b/src/generated/Groups/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs index 5e25cbda913..6ec19a175b3 100644 --- a/src/generated/Groups/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs +++ b/src/generated/Groups/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getAvailableExtensionProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/GetByIds/GetByIdsRequestBuilder.cs b/src/generated/Groups/GetByIds/GetByIdsRequestBuilder.cs index 38cbee5f979..3fa7b69c8c0 100644 --- a/src/generated/Groups/GetByIds/GetByIdsRequestBuilder.cs +++ b/src/generated/Groups/GetByIds/GetByIdsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getByIds"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/GroupsRequestBuilder.cs b/src/generated/Groups/GroupsRequestBuilder.cs index 5ec06ec5a63..bccffdb7c2f 100644 --- a/src/generated/Groups/GroupsRequestBuilder.cs +++ b/src/generated/Groups/GroupsRequestBuilder.cs @@ -81,12 +81,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to groups"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -117,24 +120,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from groups"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/AcceptedSenders/@Ref/RefRequestBuilder.cs b/src/generated/Groups/Item/AcceptedSenders/@Ref/RefRequestBuilder.cs index c5297ccada2..4edbce96367 100644 --- a/src/generated/Groups/Item/AcceptedSenders/@Ref/RefRequestBuilder.cs +++ b/src/generated/Groups/Item/AcceptedSenders/@Ref/RefRequestBuilder.cs @@ -25,20 +25,33 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of users or groups that are allowed to create post's or calendar events in this group. If this list is non-empty then only users or groups listed here are allowed to post."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,14 +70,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The list of users or groups that are allowed to create post's or calendar events in this group. If this list is non-empty then only users or groups listed here are allowed to post."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/AcceptedSenders/AcceptedSendersRequestBuilder.cs b/src/generated/Groups/Item/AcceptedSenders/AcceptedSendersRequestBuilder.cs index 5a235637ec7..21e2c8a8ede 100644 --- a/src/generated/Groups/Item/AcceptedSenders/AcceptedSendersRequestBuilder.cs +++ b/src/generated/Groups/Item/AcceptedSenders/AcceptedSendersRequestBuilder.cs @@ -26,22 +26,38 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of users or groups that are allowed to create post's or calendar events in this group. If this list is non-empty then only users or groups listed here are allowed to post."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/AddFavorite/AddFavoriteRequestBuilder.cs b/src/generated/Groups/Item/AddFavorite/AddFavoriteRequestBuilder.cs index 96c59e863ce..fb300270842 100644 --- a/src/generated/Groups/Item/AddFavorite/AddFavoriteRequestBuilder.cs +++ b/src/generated/Groups/Item/AddFavorite/AddFavoriteRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addFavorite"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs b/src/generated/Groups/Item/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs index 415bcfdb7d7..a9c04f41c6a 100644 --- a/src/generated/Groups/Item/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs +++ b/src/generated/Groups/Item/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents the app roles a group has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents the app roles a group has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs b/src/generated/Groups/Item/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs index 1535cdb1c51..23aac1b8503 100644 --- a/src/generated/Groups/Item/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs +++ b/src/generated/Groups/Item/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the app roles a group has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (groupId, appRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the app roles a group has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, appRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, appRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the app roles a group has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, appRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/AssignLicense/AssignLicenseRequestBuilder.cs b/src/generated/Groups/Item/AssignLicense/AssignLicenseRequestBuilder.cs index 536a83111bf..94db896025a 100644 --- a/src/generated/Groups/Item/AssignLicense/AssignLicenseRequestBuilder.cs +++ b/src/generated/Groups/Item/AssignLicense/AssignLicenseRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assignLicense"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Groups/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index ce0139271ef..8567f934228 100644 --- a/src/generated/Groups/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (groupId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs index d7b8a2baf32..1ff05cdf57b 100644 --- a/src/generated/Groups/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +66,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs index 6d2677a9aa7..a0d8b9175b6 100644 --- a/src/generated/Groups/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); command.Handler = CommandHandler.Create(async (groupId, calendarPermissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +48,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, calendarPermissionId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, calendarPermissionId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,16 +80,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, calendarPermissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarRequestBuilder.cs index 92b3fe10972..754bdd4f306 100644 --- a/src/generated/Groups/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarRequestBuilder.cs @@ -55,10 +55,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The group's calendar. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -79,12 +81,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The group's calendar. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -116,14 +123,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The group's calendar. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs index 09c77a47cb0..bbc145e9ed3 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs @@ -50,14 +50,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,26 +80,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Delta/Delta.cs b/src/generated/Groups/Item/Calendar/CalendarView/Delta/Delta.cs index ad8af1876f2..47652cdd59c 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Delta/Delta.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Groups.Item.Calendar.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs index 55fdaef0c40..6447128b490 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs index 4cbcf461590..710b0dd7e2e 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs index 6ff1138d075..3e53beed9e2 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,26 +76,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 44fc91631e7..8b8507c9d3a 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs index e0f88d69cb7..2e9d297da6b 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 24c4d103ede..a99fb2841dc 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (groupId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Calendar/CalendarRequestBuilder.cs index da93b74f308..11d94d53272 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Calendar/CalendarRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,14 +58,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,16 +96,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 1c83459d451..c6d3ff904a4 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs index 678a67f0ff3..6ac6a84440f 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs index d5e1118271e..d64829353aa 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index 0ef043ed83c..a9156fb2b55 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs index e657cd23e05..c816f4d2b19 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs @@ -74,12 +74,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -112,18 +115,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, startDateTime, endDateTime, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, startDateTime, endDateTime, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -156,16 +169,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs index d4802621c1a..a1c44e2a415 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +69,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs index 08accd577ad..97df93138b0 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs index db30ce057ab..d2c0ad4f085 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Delta/Delta.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Delta/Delta.cs index edee99f5527..ef42e7a1d7e 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Delta/Delta.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Groups.Item.Calendar.CalendarView.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs index f5376cc1215..b88848479bd 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/InstancesRequestBuilder.cs index 96c4885374d..d7e272d22a2 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/InstancesRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index 4f3766167fc..712e79564b8 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index 4acf7696a60..da81db13074 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index 4db63051b7b..21ffb2ab928 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index b8aa38864bb..0d155612bc5 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/EventRequestBuilder.cs index 6f75743cf6b..17e7f4f54ba 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index 5250ec02411..b4d21377b20 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 37856daa7e7..4877521d024 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index b0387b71c4c..745c84c32b2 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 0a13b743554..00be729c8ae 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 0b59524c70c..5c680be1245 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 3145fa42d57..de993b80d9c 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index b3b79363cd2..76474a39ae7 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 12b6fce7e92..08fabca9337 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Groups/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index a0a04dbe1f9..2b2d89cbd09 100644 --- a/src/generated/Groups/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Delta/Delta.cs b/src/generated/Groups/Item/Calendar/Events/Delta/Delta.cs index 5a819de70a7..7d86bae2c26 100644 --- a/src/generated/Groups/Item/Calendar/Events/Delta/Delta.cs +++ b/src/generated/Groups/Item/Calendar/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Groups.Item.Calendar.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Groups/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs index 39129005936..ec14ab36d08 100644 --- a/src/generated/Groups/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/Events/EventsRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/EventsRequestBuilder.cs index 22292adc597..bd4d896cebe 100644 --- a/src/generated/Groups/Item/Calendar/Events/EventsRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/EventsRequestBuilder.cs @@ -50,14 +50,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,22 +80,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs index 51ad48dcfaa..08f66081031 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Attachments/AttachmentsRequestBuilder.cs index fa535fa4dc7..a580fcd06ab 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,26 +76,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index ed01a202dd0..ec2d189d5e0 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs index 04a7c290f6e..0be578cb2f4 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 854fc101509..f2820c24372 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (groupId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Calendar/CalendarRequestBuilder.cs index 1b35ad1a76a..f19992cafb6 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Calendar/CalendarRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,14 +58,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,16 +96,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 5237b19ca0d..7ca258d5236 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs index f87d1af0020..c394beca5fc 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs index 00a59bb0ff7..fc02124b0ce 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index 9bad0d0b2e0..8dd137a0a0e 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/EventRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/EventRequestBuilder.cs index 54a4110a99c..220f1efed69 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/EventRequestBuilder.cs @@ -74,12 +74,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -112,14 +115,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -152,16 +161,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Extensions/ExtensionsRequestBuilder.cs index c85882c2793..d748d26d194 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +69,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs index d2edb70b305..dd6fd7d7e75 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs index 01e29b62b84..82af62d9bde 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Delta/Delta.cs b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Delta/Delta.cs index b2cc1a2f997..f862d9dc676 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Delta/Delta.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Groups.Item.Calendar.Events.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Delta/DeltaRequestBuilder.cs index f39c636c177..93bdcd99f77 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Instances/InstancesRequestBuilder.cs index b926e26f620..c8a850909d3 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Instances/InstancesRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index 419c4de6432..7c277bd8b04 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index dc373d31467..3f1cfb37be9 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index 94833153ada..6c80c99a7df 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index d0db1c9734b..54748dd6a0c 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/EventRequestBuilder.cs index 6002ff51f43..189824bbfbb 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index 7c8949dc14a..3b414a205a9 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index b5cb2e7b6ba..3fae3b87961 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 5d12ae80c9b..d8b3650bad9 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 7d7c4ca99b2..9eb96ec897c 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index f4fea683cf5..527c980dd83 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index e4b7f3f2857..f707d75b98e 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 7aeb9975c2e..565aad96946 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 79d4607302d..138b2571670 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Groups/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index bde6b95453c..849127a5a3c 100644 --- a/src/generated/Groups/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Groups/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index a0b3b99bbd4..e4521f04106 100644 --- a/src/generated/Groups/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 308ad657a2e..947cb1cfdfc 100644 --- a/src/generated/Groups/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 2be7ececef7..711b9f8abb5 100644 --- a/src/generated/Groups/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index e7de8352361..1efa3f9f846 100644 --- a/src/generated/Groups/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 9a1338455d9..9720f92a19b 100644 --- a/src/generated/Groups/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/CalendarViewRequestBuilder.cs index ef88b524ced..70b2b554196 100644 --- a/src/generated/Groups/Item/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/CalendarViewRequestBuilder.cs @@ -50,14 +50,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,26 +80,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Delta/Delta.cs b/src/generated/Groups/Item/CalendarView/Delta/Delta.cs index 26004a5663f..a0caca374f9 100644 --- a/src/generated/Groups/Item/CalendarView/Delta/Delta.cs +++ b/src/generated/Groups/Item/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Groups.Item.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Groups/Item/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Delta/DeltaRequestBuilder.cs index a986c8a08f4..907ca54b9d4 100644 --- a/src/generated/Groups/Item/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs index fecb64a4f1e..16e553f41bf 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs index a8e4e09fafa..e634fc0f8ad 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,26 +76,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 85b5460ddd3..2c2966f295c 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs index a24c5b83bf0..3e3a78b2652 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index cfac18e5ced..3e5e13e0e83 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (groupId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs index 2739f28d5ea..46cc800b968 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +69,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs index ec4f520ccb8..6f7a32c2fc0 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, calendarPermissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,16 +51,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, calendarPermissionId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, calendarPermissionId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,18 +86,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, calendarPermissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs index e8f06ea9ea7..d48ce3d5fc9 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs @@ -55,12 +55,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -81,14 +84,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,16 +129,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs index 612f6a52126..30da08621d0 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Delta/Delta.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Delta/Delta.cs index 37d31d65c17..8ef247c1e4f 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Delta/Delta.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Groups.Item.CalendarView.Item.Calendar.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs index 80b2a567a2e..5265af6655d 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs index cba8016786d..af17e4090b6 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs index 056a97c58eb..4896cc79cef 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs index b1bc320238c..4b196108503 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index 7e81212a377..1962cf2175b 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs index 194dc33b80f..ecee9d5fc5f 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs index 31827114cf4..2ff32f02660 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 2a06ad6f1fb..04005139c7a 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 4d82e1c0800..523d1828d69 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Delta/Delta.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Delta/Delta.cs index 694c77d4cca..836a87bea3f 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Delta/Delta.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Groups.Item.CalendarView.Item.Calendar.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs index 9cb2d93172a..867f5687575 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/EventsRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/EventsRequestBuilder.cs index 0c00cfd0059..b9b658a41ad 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/EventsRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/EventsRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs index 817c81d13c3..be9ff65ce2b 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs index 0255071654b..c3c62514970 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs index 40f6b764f4a..ae7752ae5d2 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index 687bcf01ea6..d8bf8949b39 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/EventRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/EventRequestBuilder.cs index 3279b7aa294..7fda5b1abe4 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs index 876d1f321b3..22346ca05e4 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 65c86774afb..4575aae4d22 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 823c489f0aa..4779d3b0d8c 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 2b21a9dd434..90a36413108 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index d8a8ebce3e4..f3d0e6c12e6 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index a596683cc20..db74f1e0d79 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 0eaa777af20..55d5a456c9f 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 84d1c4baa4d..ef222a0ee6e 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs index c99db8762fd..bd47d47a6f6 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs index 9f3454187a4..2780776c034 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index 22f828ac56f..1c2b9b5535d 100644 --- a/src/generated/Groups/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/EventRequestBuilder.cs index 92fa0664a1e..f78d2bcf02f 100644 --- a/src/generated/Groups/Item/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/EventRequestBuilder.cs @@ -79,12 +79,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -117,18 +120,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, startDateTime, endDateTime, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, startDateTime, endDateTime, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -161,16 +174,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs index 365e0d994df..b9c394232f5 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +69,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs index 3dcd4398e91..214359e2688 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs index d14cfb214bf..57881f508d5 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Instances/Delta/Delta.cs b/src/generated/Groups/Item/CalendarView/Item/Instances/Delta/Delta.cs index 13604b678cb..557d61e29d9 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Instances/Delta/Delta.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Groups.Item.CalendarView.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Groups/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs index 1a47e6fb3f6..439db508eb8 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs index 1bdb44f810a..8bff54c5df6 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index ff8625719e8..81ef6c2516f 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index 0cd3bd98b73..6120ebbdf50 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index 87f097c5d2e..6c05381f097 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index 95034dbe8a5..7dcb3e89e60 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs index c14beec6859..0bd9b438351 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index 7dac04efecf..743b8d526f5 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index be0cfbcc478..27b23f47d95 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 074b59cd99a..4d36778c430 100644 --- a/src/generated/Groups/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 1bda0394113..803f2284938 100644 --- a/src/generated/Groups/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 288cf7914f1..5eb1ecf2694 100644 --- a/src/generated/Groups/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index b9f5d0e122e..3343d221f31 100644 --- a/src/generated/Groups/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 76b26adfd9f..5cdc505d9b0 100644 --- a/src/generated/Groups/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 1dbeedfc539..75d22c4d020 100644 --- a/src/generated/Groups/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Groups/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 9be6430fb1f..3239d7b9279 100644 --- a/src/generated/Groups/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/CheckGrantedPermissionsForApp/CheckGrantedPermissionsForAppRequestBuilder.cs b/src/generated/Groups/Item/CheckGrantedPermissionsForApp/CheckGrantedPermissionsForAppRequestBuilder.cs index bbd7b149220..78ad53293fc 100644 --- a/src/generated/Groups/Item/CheckGrantedPermissionsForApp/CheckGrantedPermissionsForAppRequestBuilder.cs +++ b/src/generated/Groups/Item/CheckGrantedPermissionsForApp/CheckGrantedPermissionsForAppRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkGrantedPermissionsForApp"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs b/src/generated/Groups/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs index 0ea456e0436..527c3426b32 100644 --- a/src/generated/Groups/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs b/src/generated/Groups/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs index 2cbf411276e..1552e7c36df 100644 --- a/src/generated/Groups/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs +++ b/src/generated/Groups/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Conversations/ConversationsRequestBuilder.cs b/src/generated/Groups/Item/Conversations/ConversationsRequestBuilder.cs index 58e0f19c8f2..39c6823f627 100644 --- a/src/generated/Groups/Item/Conversations/ConversationsRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/ConversationsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The group's conversations."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,24 +67,42 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The group's conversations."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Conversations/Item/ConversationRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/ConversationRequestBuilder.cs index bc6570dd1ca..8cd3734d4b7 100644 --- a/src/generated/Groups/Item/Conversations/Item/ConversationRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/ConversationRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The group's conversations."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,14 +49,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The group's conversations."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, conversationId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, conversationId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,16 +81,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The group's conversations."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/ConversationThreadRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/ConversationThreadRequestBuilder.cs index c677beefa6d..15076e5a93d 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/ConversationThreadRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/ConversationThreadRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of all the conversation threads in the conversation. A navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,18 +53,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of all the conversation threads in the conversation. A navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,18 +93,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of all the conversation threads in the conversation. A navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Attachments/AttachmentsRequestBuilder.cs index 8ce00c2f796..963b87217b5 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Attachments/AttachmentsRequestBuilder.cs @@ -31,26 +31,33 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable. Supports $expand."; + command.Description = "The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,36 +76,58 @@ public Command BuildCreateUploadSessionCommand() { return command; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable. Supports $expand."; + command.Description = "The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -124,7 +153,7 @@ public AttachmentsRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -145,7 +174,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// /// Request headers /// Request options @@ -163,7 +192,7 @@ public RequestInformation CreatePostRequestInformation(Attachment body, Action - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -175,7 +204,7 @@ public async Task GetAsync(Action q = d return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -187,7 +216,7 @@ public async Task PostAsync(Attachment model, Action(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 8fefbc41b36..a274078119f 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Attachments/Item/AttachmentRequestBuilder.cs index 95243b56d4e..117bb8c332f 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -20,24 +20,30 @@ public class AttachmentRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Supports $expand."; + command.Description = "The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,28 +51,40 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Supports $expand."; + command.Description = "The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,28 +97,36 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Supports $expand."; + command.Description = "The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -121,7 +147,7 @@ public AttachmentRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// @@ -136,7 +162,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -157,7 +183,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// /// Request headers /// Request options @@ -175,7 +201,7 @@ public RequestInformation CreatePatchRequestInformation(Attachment body, Action< return requestInfo; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -186,7 +212,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -198,7 +224,7 @@ public async Task GetAsync(Action q = default, A return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -210,7 +236,7 @@ public async Task PatchAsync(Attachment model, ActionRead-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Extensions/ExtensionsRequestBuilder.cs index 1f155fdfc1f..86d78f64ddf 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +75,52 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Extensions/Item/ExtensionRequestBuilder.cs index 083ab1a2d8d..51e83e71c72 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Forward/ForwardRequestBuilder.cs index 06160be593c..e244bd5789a 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Forward/ForwardRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/InReplyTo/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/InReplyTo/Forward/ForwardRequestBuilder.cs index 7242d1aaeb2..bd3f37b8174 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/InReplyTo/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/InReplyTo/Forward/ForwardRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/InReplyTo/InReplyToRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/InReplyTo/InReplyToRequestBuilder.cs index c7ba3889c70..79f7bca5963 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/InReplyTo/InReplyToRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/InReplyTo/InReplyToRequestBuilder.cs @@ -22,22 +22,27 @@ public class InReplyToRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Supports $expand."; + command.Description = "The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,26 +56,37 @@ public Command BuildForwardCommand() { return command; } /// - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Supports $expand."; + command.Description = "The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,26 +99,33 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Supports $expand."; + command.Description = "The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -129,7 +152,7 @@ public InReplyToRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// Request headers /// Request options /// @@ -144,7 +167,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -165,7 +188,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// /// Request headers /// Request options @@ -183,7 +206,7 @@ public RequestInformation CreatePatchRequestInformation(Post body, Action - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -194,7 +217,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -206,7 +229,7 @@ public async Task GetAsync(Action q = default, Action< return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -218,7 +241,7 @@ public async Task PatchAsync(Post model, Action> h = var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/InReplyTo/Reply/ReplyRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/InReplyTo/Reply/ReplyRequestBuilder.cs index f437356652d..1cc375041c1 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/InReplyTo/Reply/ReplyRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/InReplyTo/Reply/ReplyRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reply"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 325e2cc1d56..07626e395c0 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 42113df4e34..3769d32d224 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/PostRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/PostRequestBuilder.cs index 9228be3aaad..0f1d513c441 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/PostRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/PostRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -77,20 +82,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -126,20 +142,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Reply/ReplyRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Reply/ReplyRequestBuilder.cs index 4747ca38933..de176bcd750 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Reply/ReplyRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/Reply/ReplyRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reply"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index ee4d1f62a5c..930a48a8730 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 7ff7be325ae..a1bb7bef197 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, postId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/PostsRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/PostsRequestBuilder.cs index 9b84d2112ea..6f6229dbe2e 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/PostsRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Posts/PostsRequestBuilder.cs @@ -43,18 +43,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,28 +79,49 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Reply/ReplyRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Reply/ReplyRequestBuilder.cs index 87eda0a907b..2a528d3426d 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/Item/Reply/ReplyRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/Item/Reply/ReplyRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reply"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, conversationThreadId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Conversations/Item/Threads/ThreadsRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/Threads/ThreadsRequestBuilder.cs index 3144a15cad2..39417efdcb9 100644 --- a/src/generated/Groups/Item/Conversations/Item/Threads/ThreadsRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/Threads/ThreadsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of all the conversation threads in the conversation. A navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +71,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of all the conversation threads in the conversation. A navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversation-id", description: "key: id of conversation")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationId)) requestInfo.PathParameters.Add("conversation_id", conversationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationIdOption = new Option("--conversation-id", description: "key: id of conversation"); + conversationIdOption.IsRequired = true; + command.AddOption(conversationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/CreatedOnBehalfOf/@Ref/RefRequestBuilder.cs b/src/generated/Groups/Item/CreatedOnBehalfOf/@Ref/RefRequestBuilder.cs index 17a5045ab19..023acd2a198 100644 --- a/src/generated/Groups/Item/CreatedOnBehalfOf/@Ref/RefRequestBuilder.cs +++ b/src/generated/Groups/Item/CreatedOnBehalfOf/@Ref/RefRequestBuilder.cs @@ -19,16 +19,18 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only. + /// The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only."; + command.Description = "The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -36,16 +38,18 @@ public Command BuildDeleteCommand() { return command; } /// - /// The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only. + /// The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only."; + command.Description = "The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,20 +62,24 @@ public Command BuildGetCommand() { return command; } /// - /// The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only. + /// The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only."; + command.Description = "The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -92,7 +100,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only. + /// The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only. /// Request headers /// Request options /// @@ -107,7 +115,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only. + /// The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only. /// Request headers /// Request options /// @@ -122,7 +130,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only. + /// The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only. /// /// Request headers /// Request options @@ -140,7 +148,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.Groups.Item.Created return requestInfo; } /// - /// The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only. + /// The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -151,7 +159,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only. + /// The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +170,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only. + /// The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/Groups/Item/CreatedOnBehalfOf/CreatedOnBehalfOfRequestBuilder.cs b/src/generated/Groups/Item/CreatedOnBehalfOf/CreatedOnBehalfOfRequestBuilder.cs index 64eecf5cf6b..f70edb6e5cd 100644 --- a/src/generated/Groups/Item/CreatedOnBehalfOf/CreatedOnBehalfOfRequestBuilder.cs +++ b/src/generated/Groups/Item/CreatedOnBehalfOf/CreatedOnBehalfOfRequestBuilder.cs @@ -21,20 +21,28 @@ public class CreatedOnBehalfOfRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only. + /// The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only."; + command.Description = "The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,7 +76,7 @@ public CreatedOnBehalfOfRequestBuilder(Dictionary pathParameters RequestAdapter = requestAdapter; } /// - /// The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only. + /// The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only. /// Request headers /// Request options /// Request query parameters @@ -89,7 +97,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only. + /// The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -100,7 +108,7 @@ public async Task GetAsync(Action q = defau var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only. + /// The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Groups/Item/Drive/DriveRequestBuilder.cs b/src/generated/Groups/Item/Drive/DriveRequestBuilder.cs index c02bd795b0f..270dfac99b0 100644 --- a/src/generated/Groups/Item/Drive/DriveRequestBuilder.cs +++ b/src/generated/Groups/Item/Drive/DriveRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The group's default drive. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The group's default drive. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The group's default drive. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Drives/DrivesRequestBuilder.cs b/src/generated/Groups/Item/Drives/DrivesRequestBuilder.cs index 0be0b098128..bad36194e47 100644 --- a/src/generated/Groups/Item/Drives/DrivesRequestBuilder.cs +++ b/src/generated/Groups/Item/Drives/DrivesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The group's drives. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The group's drives. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Drives/Item/DriveRequestBuilder.cs b/src/generated/Groups/Item/Drives/Item/DriveRequestBuilder.cs index 6b0ab278f18..615b70f4783 100644 --- a/src/generated/Groups/Item/Drives/Item/DriveRequestBuilder.cs +++ b/src/generated/Groups/Item/Drives/Item/DriveRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The group's drives. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--drive-id", description: "key: id of drive")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); command.Handler = CommandHandler.Create(async (groupId, driveId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The group's drives. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, driveId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, driveId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The group's drives. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Delta/Delta.cs b/src/generated/Groups/Item/Events/Delta/Delta.cs index 893e95971e4..88790ae588a 100644 --- a/src/generated/Groups/Item/Events/Delta/Delta.cs +++ b/src/generated/Groups/Item/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Groups.Item.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Groups/Item/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Groups/Item/Events/Delta/DeltaRequestBuilder.cs index ddc703e4b1f..18012ae5621 100644 --- a/src/generated/Groups/Item/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/EventsRequestBuilder.cs b/src/generated/Groups/Item/Events/EventsRequestBuilder.cs index 4a357364f9d..1e5d404ba56 100644 --- a/src/generated/Groups/Item/Events/EventsRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/EventsRequestBuilder.cs @@ -44,20 +44,24 @@ public List BuildCommand() { return commands; } /// - /// The group's calendar events. + /// The group's events. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The group's calendar events."; + command.Description = "The group's events."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,28 +74,44 @@ public Command BuildCreateCommand() { return command; } /// - /// The group's calendar events. + /// The group's events. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The group's calendar events."; + command.Description = "The group's events."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -117,7 +137,7 @@ public EventsRequestBuilder(Dictionary pathParameters, IRequestA RequestAdapter = requestAdapter; } /// - /// The group's calendar events. + /// The group's events. /// Request headers /// Request options /// Request query parameters @@ -138,7 +158,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The group's calendar events. + /// The group's events. /// /// Request headers /// Request options @@ -162,7 +182,7 @@ public DeltaRequestBuilder Delta() { return new DeltaRequestBuilder(PathParameters, RequestAdapter); } /// - /// The group's calendar events. + /// The group's events. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +194,7 @@ public async Task GetAsync(Action q = defaul return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The group's calendar events. + /// The group's events. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -186,7 +206,7 @@ public async Task<@Event> PostAsync(@Event model, Action(requestInfo, responseHandler, cancellationToken); } - /// The group's calendar events. + /// The group's events. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Groups/Item/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Accept/AcceptRequestBuilder.cs index d3dd276d582..f6c7a43f9cf 100644 --- a/src/generated/Groups/Item/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs index 0575730c279..8072aaa9ccf 100644 --- a/src/generated/Groups/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,26 +76,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 7ea678d6996..7f60d615190 100644 --- a/src/generated/Groups/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs index 3df3c699013..981595d988a 100644 --- a/src/generated/Groups/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 1b097b32237..a671c92487b 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (groupId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs index e38b7fb6347..fbb8d4efad4 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +69,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs index f04fc5313cd..be29d3b3a75 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, calendarPermissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,16 +51,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, calendarPermissionId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, calendarPermissionId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,18 +86,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, calendarPermissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/CalendarRequestBuilder.cs index 5a91eb81ffa..47c25110fef 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/CalendarRequestBuilder.cs @@ -55,12 +55,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -81,14 +84,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,16 +129,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs index 41cfe8a63c1..9419d8ed612 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Delta/Delta.cs b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Delta/Delta.cs index a7b4bc81d0a..4b74fad8fd0 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Delta/Delta.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Groups.Item.Events.Item.Calendar.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs index 919ae3c62b0..6f483bfe2aa 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs index 19a9fc7e9f7..76f655d1f75 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs index b4f31a6499a..1163cb34699 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs index 44f6d8f4e2e..e9e8e939794 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index 669b3928946..32f019968e6 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs index ec7b2902c68..f38a90dab1d 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs index a80504df659..3cfe310032e 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 325ccf2e3ac..f7e295f438f 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 8ee3fd541d4..9fdf31b448d 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/Events/Delta/Delta.cs b/src/generated/Groups/Item/Events/Item/Calendar/Events/Delta/Delta.cs index d6db46ef060..9d01607c959 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/Events/Delta/Delta.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Groups.Item.Events.Item.Calendar.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Groups/Item/Events/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs index e9406f9bd7a..f5b942aeaa6 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/Events/EventsRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/Events/EventsRequestBuilder.cs index 472f900a41f..3b5235dece7 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/Events/EventsRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/Events/EventsRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs index 68a678e5e03..b097e6d3657 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs index e6fcb17a7c1..b3ba00a941f 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs index d6b7e39e676..eb699d6d2b6 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index 6238b7790d9..64c93f2e7f5 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/EventRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/EventRequestBuilder.cs index bb01ee52bb3..78eb540ce2e 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs index 5516692343f..b0390601a15 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 075bd5a280f..5c4732f27e5 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index f88efc6306f..cddaf0afca8 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 3b6bce957f5..d21729b9e75 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 95099156eb2..400736dbac3 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 56dfda3fa9e..741ab25b91c 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index d06710c4209..82c48d8d3ae 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 8b80de4030e..75b09df96c8 100644 --- a/src/generated/Groups/Item/Events/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Cancel/CancelRequestBuilder.cs index 6b45bd55eb3..dc349b99bcd 100644 --- a/src/generated/Groups/Item/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Decline/DeclineRequestBuilder.cs index d60552f38ba..9c162990c58 100644 --- a/src/generated/Groups/Item/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index 61a11ba9e0e..1e709e92a04 100644 --- a/src/generated/Groups/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/EventRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/EventRequestBuilder.cs index a12811474e0..eafb5a5c9ff 100644 --- a/src/generated/Groups/Item/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/EventRequestBuilder.cs @@ -73,18 +73,21 @@ public Command BuildDeclineCommand() { return command; } /// - /// The group's calendar events. + /// The group's events. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The group's calendar events."; + command.Description = "The group's events."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -111,20 +114,26 @@ public Command BuildForwardCommand() { return command; } /// - /// The group's calendar events. + /// The group's events. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The group's calendar events."; + command.Description = "The group's events."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -151,22 +160,27 @@ public Command BuildMultiValueExtendedPropertiesCommand() { return command; } /// - /// The group's calendar events. + /// The group's events. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The group's calendar events."; + command.Description = "The group's events."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -206,7 +220,7 @@ public EventRequestBuilder(Dictionary pathParameters, IRequestAd RequestAdapter = requestAdapter; } /// - /// The group's calendar events. + /// The group's events. /// Request headers /// Request options /// @@ -221,7 +235,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The group's calendar events. + /// The group's events. /// Request headers /// Request options /// Request query parameters @@ -242,7 +256,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The group's calendar events. + /// The group's events. /// /// Request headers /// Request options @@ -260,7 +274,7 @@ public RequestInformation CreatePatchRequestInformation(@Event body, Action - /// The group's calendar events. + /// The group's events. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -271,7 +285,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The group's calendar events. + /// The group's events. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -283,7 +297,7 @@ public async Task<@Event> GetAsync(Action q = default, Actio return await RequestAdapter.SendAsync<@Event>(requestInfo, responseHandler, cancellationToken); } /// - /// The group's calendar events. + /// The group's events. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -295,7 +309,7 @@ public async Task PatchAsync(@Event model, Action> h var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// The group's calendar events. + /// The group's events. public class GetQueryParameters : QueryParametersBase { /// Select properties to be returned public string[] Select { get; set; } diff --git a/src/generated/Groups/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs index 89c9cdd65df..8798c33aff3 100644 --- a/src/generated/Groups/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +69,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs index f78064b727e..d5aecb6f77c 100644 --- a/src/generated/Groups/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Forward/ForwardRequestBuilder.cs index 341b10ace33..699c6ad3fe1 100644 --- a/src/generated/Groups/Item/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Instances/Delta/Delta.cs b/src/generated/Groups/Item/Events/Item/Instances/Delta/Delta.cs index 103f739e308..f35f5d50281 100644 --- a/src/generated/Groups/Item/Events/Item/Instances/Delta/Delta.cs +++ b/src/generated/Groups/Item/Events/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Groups.Item.Events.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Groups/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs index a20f9b67965..bbb8e5bdb95 100644 --- a/src/generated/Groups/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Instances/InstancesRequestBuilder.cs index 6cb1d5f31fb..49f45535002 100644 --- a/src/generated/Groups/Item/Events/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Instances/InstancesRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index 38b743831b6..cbf52d20ee5 100644 --- a/src/generated/Groups/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index 7f706d0fb84..31b62939fd3 100644 --- a/src/generated/Groups/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index 791f5ef3ba6..76ee9a5f584 100644 --- a/src/generated/Groups/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index 04450151dcb..65ba0be5d82 100644 --- a/src/generated/Groups/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Instances/Item/EventRequestBuilder.cs index 42692e7f76c..01bf3fbd940 100644 --- a/src/generated/Groups/Item/Events/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Instances/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index f842857e1c0..e254e6c6cc3 100644 --- a/src/generated/Groups/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 74ea3a08aff..7a979865dcb 100644 --- a/src/generated/Groups/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 868f6701958..6ff21d9c154 100644 --- a/src/generated/Groups/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 6168ef5209e..32e008dd007 100644 --- a/src/generated/Groups/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 716ae0e54d3..079e218ca42 100644 --- a/src/generated/Groups/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 71f47cc9697..8da58dff734 100644 --- a/src/generated/Groups/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 46592de9e32..232b50108d8 100644 --- a/src/generated/Groups/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 8940c742dab..bda63f06fb6 100644 --- a/src/generated/Groups/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Groups/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index a5cdd1095da..207f33ba1dc 100644 --- a/src/generated/Groups/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Groups/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Groups/Item/Extensions/ExtensionsRequestBuilder.cs index ce34c2bcf95..62da00239a6 100644 --- a/src/generated/Groups/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Groups/Item/Extensions/Item/ExtensionRequestBuilder.cs index 48087022bde..5636f81e169 100644 --- a/src/generated/Groups/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Groups/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (groupId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs b/src/generated/Groups/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs index 3d34573eafa..9cfb95553f8 100644 --- a/src/generated/Groups/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs b/src/generated/Groups/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs index 1f0fbef4b2e..55f3bf18976 100644 --- a/src/generated/Groups/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs +++ b/src/generated/Groups/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/GroupLifecyclePolicies/GroupLifecyclePoliciesRequestBuilder.cs b/src/generated/Groups/Item/GroupLifecyclePolicies/GroupLifecyclePoliciesRequestBuilder.cs index ff33e3ddce6..f6a5eef9741 100644 --- a/src/generated/Groups/Item/GroupLifecyclePolicies/GroupLifecyclePoliciesRequestBuilder.cs +++ b/src/generated/Groups/Item/GroupLifecyclePolicies/GroupLifecyclePoliciesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of lifecycle policies for this group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of lifecycle policies for this group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/GroupLifecyclePolicies/Item/GroupLifecyclePolicyRequestBuilder.cs b/src/generated/Groups/Item/GroupLifecyclePolicies/Item/GroupLifecyclePolicyRequestBuilder.cs index 126b2f344fc..375c0cf21f6 100644 --- a/src/generated/Groups/Item/GroupLifecyclePolicies/Item/GroupLifecyclePolicyRequestBuilder.cs +++ b/src/generated/Groups/Item/GroupLifecyclePolicies/Item/GroupLifecyclePolicyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of lifecycle policies for this group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var groupLifecyclePolicyIdOption = new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy"); + groupLifecyclePolicyIdOption.IsRequired = true; + command.AddOption(groupLifecyclePolicyIdOption); command.Handler = CommandHandler.Create(async (groupId, groupLifecyclePolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(groupLifecyclePolicyId)) requestInfo.PathParameters.Add("groupLifecyclePolicy_id", groupLifecyclePolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of lifecycle policies for this group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, groupLifecyclePolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(groupLifecyclePolicyId)) requestInfo.PathParameters.Add("groupLifecyclePolicy_id", groupLifecyclePolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var groupLifecyclePolicyIdOption = new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy"); + groupLifecyclePolicyIdOption.IsRequired = true; + command.AddOption(groupLifecyclePolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, groupLifecyclePolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of lifecycle policies for this group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var groupLifecyclePolicyIdOption = new Option("--grouplifecyclepolicy-id", description: "key: id of groupLifecyclePolicy"); + groupLifecyclePolicyIdOption.IsRequired = true; + command.AddOption(groupLifecyclePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, groupLifecyclePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(groupLifecyclePolicyId)) requestInfo.PathParameters.Add("groupLifecyclePolicy_id", groupLifecyclePolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/GroupRequestBuilder.cs b/src/generated/Groups/Item/GroupRequestBuilder.cs index fdd765d03d7..7621959068d 100644 --- a/src/generated/Groups/Item/GroupRequestBuilder.cs +++ b/src/generated/Groups/Item/GroupRequestBuilder.cs @@ -146,10 +146,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -192,14 +194,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from groups by key"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -279,14 +289,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/MemberOf/@Ref/RefRequestBuilder.cs b/src/generated/Groups/Item/MemberOf/@Ref/RefRequestBuilder.cs index 9042fa7fc22..86918f198d9 100644 --- a/src/generated/Groups/Item/MemberOf/@Ref/RefRequestBuilder.cs +++ b/src/generated/Groups/Item/MemberOf/@Ref/RefRequestBuilder.cs @@ -19,28 +19,43 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + /// Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand."; + command.Description = "Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -53,20 +68,24 @@ public Command BuildGetCommand() { return command; } /// - /// Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + /// Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. /// public Command BuildPostCommand() { var command = new Command("post"); - command.Description = "Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand."; + command.Description = "Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,7 +111,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + /// Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -113,7 +132,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + /// Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. /// /// Request headers /// Request options @@ -131,7 +150,7 @@ public RequestInformation CreatePostRequestInformation(ApiSdk.Groups.Item.Member return requestInfo; } /// - /// Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + /// Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -143,7 +162,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + /// Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -155,7 +174,7 @@ public async Task GetAsync(Action q = default, var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + /// Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Groups/Item/MemberOf/MemberOfRequestBuilder.cs b/src/generated/Groups/Item/MemberOf/MemberOfRequestBuilder.cs index 42e8c8272c6..26d6d260e08 100644 --- a/src/generated/Groups/Item/MemberOf/MemberOfRequestBuilder.cs +++ b/src/generated/Groups/Item/MemberOf/MemberOfRequestBuilder.cs @@ -20,32 +20,53 @@ public class MemberOfRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + /// Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand."; + command.Description = "Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,7 +99,7 @@ public MemberOfRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + /// Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -99,7 +120,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + /// Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -110,7 +131,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + /// Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Groups/Item/Members/@Ref/RefRequestBuilder.cs b/src/generated/Groups/Item/Members/@Ref/RefRequestBuilder.cs index 2dc007920eb..99aa3bcd69a 100644 --- a/src/generated/Groups/Item/Members/@Ref/RefRequestBuilder.cs +++ b/src/generated/Groups/Item/Members/@Ref/RefRequestBuilder.cs @@ -19,28 +19,43 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand. + /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand."; + command.Description = "Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -53,20 +68,24 @@ public Command BuildGetCommand() { return command; } /// - /// Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand. + /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand. /// public Command BuildPostCommand() { var command = new Command("post"); - command.Description = "Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand."; + command.Description = "Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,7 +111,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand. + /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -113,7 +132,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand. + /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand. /// /// Request headers /// Request options @@ -131,7 +150,7 @@ public RequestInformation CreatePostRequestInformation(ApiSdk.Groups.Item.Member return requestInfo; } /// - /// Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand. + /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -143,7 +162,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand. + /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -155,7 +174,7 @@ public async Task GetAsync(Action q = default, var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand. + /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Groups/Item/Members/MembersRequestBuilder.cs b/src/generated/Groups/Item/Members/MembersRequestBuilder.cs index 4e670c169f6..4eadc5d20d5 100644 --- a/src/generated/Groups/Item/Members/MembersRequestBuilder.cs +++ b/src/generated/Groups/Item/Members/MembersRequestBuilder.cs @@ -20,32 +20,53 @@ public class MembersRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand. + /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand."; + command.Description = "Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,7 +99,7 @@ public MembersRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand. + /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -99,7 +120,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand. + /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -110,7 +131,7 @@ public async Task GetAsync(Action q = defau var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand. + /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Groups/Item/MembersWithLicenseErrors/@Ref/RefRequestBuilder.cs b/src/generated/Groups/Item/MembersWithLicenseErrors/@Ref/RefRequestBuilder.cs index cbd92019aac..d25549bf7eb 100644 --- a/src/generated/Groups/Item/MembersWithLicenseErrors/@Ref/RefRequestBuilder.cs +++ b/src/generated/Groups/Item/MembersWithLicenseErrors/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A list of group members with license errors from this group-based license assignment. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "A list of group members with license errors from this group-based license assignment. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/MembersWithLicenseErrors/MembersWithLicenseErrorsRequestBuilder.cs b/src/generated/Groups/Item/MembersWithLicenseErrors/MembersWithLicenseErrorsRequestBuilder.cs index ad8b22037e4..e068f6b31ab 100644 --- a/src/generated/Groups/Item/MembersWithLicenseErrors/MembersWithLicenseErrorsRequestBuilder.cs +++ b/src/generated/Groups/Item/MembersWithLicenseErrors/MembersWithLicenseErrorsRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A list of group members with license errors from this group-based license assignment. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs index 1d84a7358cf..579c94877d3 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getNotebookFromWebUrl"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs index e7d77fcf124..21871ed3570 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getRecentNotebooks"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--includepersonalnotebooks", description: "Usage: includePersonalNotebooks={includePersonalNotebooks}")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var includePersonalNotebooksOption = new Option("--includepersonalnotebooks", description: "Usage: includePersonalNotebooks={includePersonalNotebooks}"); + includePersonalNotebooksOption.IsRequired = true; + command.AddOption(includePersonalNotebooksOption); command.Handler = CommandHandler.Create(async (groupId, includePersonalNotebooks) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.PathParameters.Add("includePersonalNotebooks", includePersonalNotebooks); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs index cffbdb8699a..9caa183fe28 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/NotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/NotebookRequestBuilder.cs index cdef365e155..ddf70f149a8 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/NotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/NotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 708a161a4d1..49831977455 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 8bdf7b7180a..0528297fc21 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 71528923dab..987cbf7ac0d 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 01142169420..c65eaf96441 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,18 +55,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,18 +112,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index d484a64f6df..16bba2392c7 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index a1104a85bf5..530eefd79ed 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index e7a6aa181d0..020ece19ae4 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index ef4816ed61a..14d8742d66c 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 757d0b26249..3ea3900f400 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,16 +43,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,20 +71,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,20 +138,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 06a4bcbe5e9..9db6004cd6c 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,19 +25,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -60,20 +66,28 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 929af904743..5e4c4d7ab2c 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index e55295ad05a..b4a98b418cf 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,18 +45,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -70,22 +76,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -129,22 +147,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 00d2600f15a..c900d69b8d8 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 44b4075efb7..46612c0a30c 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index f8b882d6945..438db375e06 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,18 +33,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,22 +64,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,22 +110,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index cbdf5e1fd18..54e852e22c0 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index e399752adc7..25efb95c03b 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index f250382546a..1331f1c445a 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -65,22 +71,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,22 +117,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 1a7edddc84c..5af2a05f70f 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs index 79f46f2981c..da075433c7f 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,20 +41,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,32 +80,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 0fb9cb2011c..d04534b94c1 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 8599c23c53f..d8cb6bd9f09 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 57bfe756b7b..1135d3e965b 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index f5c4beed4b2..c8217cc3019 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 99d44439d80..c5ebd980576 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index e30df401a06..481a3f7b968 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index ee26bf97464..7cc592f89aa 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 7ba1779b1d1..d8bf6a12655 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,18 +136,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index e652fba5b6b..7501eccb70c 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,17 +25,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -58,18 +63,25 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 68727be671f..0d7655e6d14 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 5fd5f5389b7..91f34082f65 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,16 +45,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -68,20 +73,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -125,20 +141,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 72195f5a381..12088bc6c6f 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 1fee32e9dbd..6777d9ca23b 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 983f6ca241c..dcf53df5e16 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index b1a4ab12b28..04ae8b4e4e0 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 8ea770bbc40..b7e7c238ba2 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index 228c579faf0..83937244707 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index bf1afc47072..d2f61a34d60 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs index 3135c99c051..3a7a2feaa9d 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 12582e82e64..8e0b55426a3 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index d3f775fecd4..eeaf37df713 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index c7b67f5952f..d2e13d99d1e 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index 493d301dd1d..94d016f1bd4 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 9c036838cc0..a5af31930c9 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index f9c83295fe6..566d05e13a7 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,14 +29,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +54,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -101,18 +115,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index 82073afe773..7568269d4bd 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index fa99c8bb8a0..e380a936d81 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 87c8704271a..6baf02f8d93 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index f164de574d0..4b73928c92e 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index 37035e1835b..915c4a46e19 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index 50fec1e1f70..03c7064a671 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs index e82c87a991f..8264a993bb0 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, notebookId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, notebookId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Notebooks/NotebooksRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Notebooks/NotebooksRequestBuilder.cs index 1e931e1dc93..a8ba95d037c 100644 --- a/src/generated/Groups/Item/Onenote/Notebooks/NotebooksRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Notebooks/NotebooksRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,26 +77,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/OnenoteRequestBuilder.cs b/src/generated/Groups/Item/Onenote/OnenoteRequestBuilder.cs index 5183ae5896f..a302f2d57de 100644 --- a/src/generated/Groups/Item/Onenote/OnenoteRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/OnenoteRequestBuilder.cs @@ -32,10 +32,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,14 +51,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,14 +107,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs index 31a18ac51fb..80b32fc853e 100644 --- a/src/generated/Groups/Item/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenoteoperation-id", description: "key: id of onenoteOperation")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteOperationIdOption = new Option("--onenoteoperation-id", description: "key: id of onenoteOperation"); + onenoteOperationIdOption.IsRequired = true; + command.AddOption(onenoteOperationIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteOperationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteOperationId)) requestInfo.PathParameters.Add("onenoteOperation_id", onenoteOperationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenoteoperation-id", description: "key: id of onenoteOperation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteOperationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteOperationId)) requestInfo.PathParameters.Add("onenoteOperation_id", onenoteOperationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteOperationIdOption = new Option("--onenoteoperation-id", description: "key: id of onenoteOperation"); + onenoteOperationIdOption.IsRequired = true; + command.AddOption(onenoteOperationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteOperationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenoteoperation-id", description: "key: id of onenoteOperation")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteOperationIdOption = new Option("--onenoteoperation-id", description: "key: id of onenoteOperation"); + onenoteOperationIdOption.IsRequired = true; + command.AddOption(onenoteOperationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteOperationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteOperationId)) requestInfo.PathParameters.Add("onenoteOperation_id", onenoteOperationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Operations/OperationsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Operations/OperationsRequestBuilder.cs index 24ae7e84532..1a2b460c784 100644 --- a/src/generated/Groups/Item/Onenote/Operations/OperationsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Operations/OperationsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/Content/ContentRequestBuilder.cs index ae866d8f8f7..d020db88907 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index ff417d8e603..655b9bf28a1 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/OnenotePageRequestBuilder.cs index f1fccea58ed..e367e91f7be 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,12 +45,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,16 +67,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,16 +134,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 7c08e8d1cae..32517ef0a89 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 5c831607107..f7f893fd253 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index cf23056c71a..e10d1b9b6ed 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 03667e522e9..eee8663de7a 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 71a947d038b..014ac10a6a9 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index bf86f1cbb58..c2d69f7dde4 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index dc76c86358a..0d2c41cf57f 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,18 +55,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,18 +112,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index f0bafefd7be..7ef983f20ce 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 1c806763a30..d4bff4e3c91 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index dc98b7bfd59..3fcddff81c3 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index e412ae778eb..258f6bee564 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index c9bcf6823c1..893f5642213 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,16 +43,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,20 +71,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,20 +138,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 52a73e77f23..91ec41391e9 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,19 +25,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -60,20 +66,28 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index e94814dd82f..cd17b335f4a 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 4afc13b7080..933d80d16da 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -43,18 +43,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -68,22 +74,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,22 +126,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 298356dc9b9..41308f483a2 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 088c3cf8c45..29f4baa184a 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs index 52bed040687..e526be82404 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -39,20 +39,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,32 +78,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index b623da83cd2..c74d675e903 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index ec060b960bd..cb82398f8ae 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 0850318c840..8b1f6a79dd1 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index 9f1edfaf64e..247375313a3 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 9950d200b35..5a24974652f 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index e037df5db32..d965c723ad1 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 53a586e0392..4d2d2e680a9 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index cd2f780d562..a15ee322ffe 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,18 +136,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 0362395791b..7188628a813 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,17 +25,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenotePageId1, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -58,18 +63,25 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenotePageId1, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 22c6a0a6078..bd80b15ba1d 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 3af53034649..2b67af445eb 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -43,16 +43,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,20 +71,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenotePageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenotePageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -104,20 +120,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 366936bb21d..50fe6777369 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 644dbd740d9..c1e5ccceeef 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs index e7d510e99c1..f929e90c7ef 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs @@ -39,18 +39,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,30 +75,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 35d6e1f1f3e..a2ec81c90ca 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 1f85489bcc6..e2ce2a63f18 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index b63cddf4b22..bf2deee8fbc 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index 7726315b8e7..7434c88a408 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 83558a0c76f..fdf35de61b2 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 89b7a6dfb88..c5915707381 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,14 +29,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +54,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -101,18 +115,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index 7c89927d62f..c597610fac7 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index c961db8c99b..275630f871a 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index e9958cd2486..961b1ce82c5 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 467c2ae8935..86b73fe09cb 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index b0b7d4a3e05..8f1d3929804 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index af0dccb3b35..f59af9733e4 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 1298ae33844..30cb695d1a1 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index d08a3f4571c..5fd864bba61 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 69c8d6a1307..c4b2adadc44 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs index 5be1258814b..2668aa9fc4e 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenotePageId1, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenotePageId1, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 4ffaadeb08a..4e1f8286910 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs index 2628d2566e5..1c56ad92974 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenotePageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenotePageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenotePageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -100,18 +114,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 7ff260d09ec..920d796f811 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs index 7cf6d2a41c1..e8c816a3c0b 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenotePageId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs index 6d40b9aa72f..ec5ba9227ab 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs @@ -39,16 +39,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,28 +72,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 5bb14979ed5..fb42cf1a666 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs index b3759420b67..06e3295b0af 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index fd611fb3367..6c2f8894cce 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index fa4d8077004..6a801010b30 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index e917065052d..b5dbeec8d70 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 423a8b13100..3bc6edb374b 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,18 +55,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,18 +112,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 150809a6a56..3882b3ec215 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 696276b5db3..b2bbd8a1a14 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 1794e7eb5b3..a15daf19aea 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 470520a1104..f7681dd302d 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 986a1e711e2..1bacc3e798f 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index c7db23fbb56..9a84a77fab5 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 472e5bfcb10..898ee2fe316 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 7f4f4f3394c..ffa2c05b570 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 4a0471564d4..253b3b88e50 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 024c981a85d..54f518fcc15 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs index 82d44a7cdfd..2d2bba15bf7 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 9b8251fcbd6..fe473193b98 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index feb2318a650..cf91971f658 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 6400a494f0d..bb19696d553 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 8ecf3c462e4..e66e336fb64 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 3e0e094ace4..99ddac27be6 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index a6f7509ffea..acefac4fc81 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 2cba48d0d3b..aa818826716 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs index 628d4820d6f..ba7418212d9 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 6b9619b0c82..e738043f6ed 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 90429968338..7ef451864ce 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,12 +29,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +51,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,16 +111,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index b11163c9510..b6cafb5870c 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index 23684805320..f805249b3ba 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 233c8413328..583bfb65432 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 4ec2435f5b6..9881f5d75d4 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index a241d6b9dfd..7d17e4854ba 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index 8677c37b0b5..e49b4174ee2 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index 8d20a516e77..95ce6239d32 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,16 +65,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,16 +132,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs index af8ce690212..a096e33e0cb 100644 --- a/src/generated/Groups/Item/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Pages/PagesRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Pages/PagesRequestBuilder.cs index 79fddb73260..531f8e13703 100644 --- a/src/generated/Groups/Item/Onenote/Pages/PagesRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Pages/PagesRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,26 +71,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Resources/Item/Content/ContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Resources/Item/Content/ContentRequestBuilder.cs index 1aa06e0441a..38f17c17503 100644 --- a/src/generated/Groups/Item/Onenote/Resources/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Resources/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property resources from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (groupId, onenoteResourceId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property resources in groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); - command.AddOption(new Option("--file", description: "Binary request body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (groupId, onenoteResourceId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs index a3789212d93..51e833cc432 100644 --- a/src/generated/Groups/Item/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteResourceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteResourceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteResourceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Resources/ResourcesRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Resources/ResourcesRequestBuilder.cs index 17302448534..ff7cc0215c1 100644 --- a/src/generated/Groups/Item/Onenote/Resources/ResourcesRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Resources/ResourcesRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 0b7913d2acc..695f4fd2ad0 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index d2a5759dd19..cabad28f604 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index bbd956f4a39..49fd22598d7 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 96ff3dc1ecd..80efb80613f 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index d8508a12415..35fa5273999 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index e315ac73d8e..b337204c090 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index ff4a15bf40e..9e708d328a0 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -118,18 +132,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index ae43804ba48..2df61d08d06 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,17 +25,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -58,18 +63,25 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 48c5bbd93d8..dd22a94f2f4 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 1eb7df9882e..65cee533d23 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,16 +45,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -68,20 +73,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -125,20 +141,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index b96ce3d8065..1b7b98ad636 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index e641e8aeade..aacff9776b3 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index f8fef11b36c..916840cfa6a 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 33764de0840..c17f0942f21 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 889325cf899..fd2607022f0 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index e298f36130f..ad7caf9a725 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 3d8c4cf6367..227e54cbb11 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs index 283a847d812..6f58b554450 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 8b44c1f0ea1..663fb76204f 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 6adc284213d..c066d05d894 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index a217a5b69a5..160b280d616 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 6dfa9c0a9a2..e886e5a468a 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 6db94aaadb3..633b2087e4e 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs index 651ae1b38b3..94880f373e6 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,12 +30,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,16 +52,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,16 +108,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 740625fce21..2386c54c0ce 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 9dfa9737eb2..a00b86e8b06 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index ef561fd6599..15e87cf7d5e 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 5d356b3c10c..771199b1dff 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index eac27b791b1..fbd00190f99 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,18 +134,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index df600f2fe0a..55acdb9a242 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,17 +25,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -58,18 +63,25 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 9f8a8f45a1e..34f7b1847b8 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 71e6ff0a89b..38ece07fbfa 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,16 +45,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -68,20 +73,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -127,20 +143,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index a6f45ec97e1..3e18909a893 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 4f7acefaa11..5ac46f07b2c 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 739d1e025cd..bd3db2b5045 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,16 +35,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,20 +63,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -90,20 +106,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index e1c15f0fe62..066b3189d74 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 6f84b84067b..45d93799e80 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index f3aac083e25..94ce99e1898 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 7fbe2298d44..defa8dcef1b 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 0538e98dddf..47ce0f422c9 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -65,22 +71,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,22 +117,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index de57da39780..02a2e9e1f20 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,20 +38,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,32 +77,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index f0a525b46a8..6447e17d85a 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index afc3e3cc866..8f45e9e0399 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index c615c1195aa..906226a4753 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 50417c84167..26ee792e4ff 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs index 049c5d5648d..2610ddb0339 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 32b7261e45f..810813c9aa7 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 15d6b490840..74169d0f408 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,14 +35,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 0dc8c74399b..f15582b510e 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 6749fbaf93c..26ebdc9ca4e 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 29b8c4edf7a..2d998aa6fad 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 956856d3851..810cecb2b84 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 6d5d3eedb58..8d5af07f634 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index cbff3aff530..a01562401e9 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 6f3aa9c323b..ebc31901ad7 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index d5d77828a88..ede77e26bae 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs index 83a613cf1f1..48fcffd9b6b 100644 --- a/src/generated/Groups/Item/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +70,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index fd5ab932181..d09a3ea750c 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 0ce414f6d3a..22616ff5fe2 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs index 3d29d78bf3e..a164d87fc9a 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,16 +65,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,16 +132,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 92f7713f5e6..4bd42346b5f 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 1bfbdc5d6d7..804ce0b1472 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 2795dc2ecc9..237f87c66be 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,14 +45,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,18 +70,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -123,18 +137,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index cb3f3a6dc9c..af8bd063e8c 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index a1e096b6817..4870818cacb 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 676fe779cd3..b8ad8f375be 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,14 +35,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index a60691e2116..03fe434e9d3 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 8ca0526d6d6..1dfd7c3087d 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 7eb6fdbc75b..a8b01fe1926 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 96fa52c8ab0..821cfda4ec5 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,16 +30,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,20 +58,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -102,20 +118,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 73433951832..b96ba511bc2 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 0625b1d442c..43f85e2c620 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 87fc235b506..9bc336f1437 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 2c83d59c77f..e032274043f 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 75c38843147..b6580569d33 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -65,22 +71,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,22 +117,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index 5a1a12071dc..5cfc2aa28d2 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -38,20 +38,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,32 +77,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 0d9337c68dc..9ab8d4e6dc8 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,30 +76,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index adbba5132f3..fc13e6ca99a 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 39dcefac6a6..67d9c909128 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 2131ccc0049..7bd5bcb2511 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 64733419520..344dfb9fdd7 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index db48795cb23..51d017327e0 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 98740f15eda..9de5bca01d2 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index f08d3b8c740..cb8b1b1155b 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 46707a8eb59..00a60bf2fdd 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs index 4e5babd73af..a475e8a8167 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index bef6a0d69d1..ac533c6a8a7 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 563729db990..9dacd825896 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 720e0d138eb..1c29e24f7b3 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index f33c435b954..99bd61cc133 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index edc4775e4fd..5ccdd5e2969 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 7d7c23f3d21..583f945f75b 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,18 +55,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,18 +112,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 763e8fcff11..7505d3e0404 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 9cedb90bbdf..5335389f1c4 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 1e2fca6f811..b1b6a2ddaf4 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 8201be224a5..2d0ab6c3b0c 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 5baf3c9761c..8a63808c067 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index 3748d05efc6..555fd9c06cd 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 198ba720e32..4ff662df058 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index e7deaa6af35..03d0cca63e0 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index a513a220120..7d0a7a475ea 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 824299d440e..be38f489061 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 91fdd9fb3c9..322a3821fc2 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 882eaae0517..a81a753f8d8 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index 2673680ae6f..369ae5f2216 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 4353d42ccd2..fa86abe184b 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 5b97fa06b60..ce0a4db24bc 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index aa8c560719f..4580c86883d 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index c2493ac713a..39cb3a0d336 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 60e26d60eca..269e856e2c7 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs index 4b95c379d1d..b5760b1d371 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 6006bfac2a5..698f6b6cf2f 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index d5af84a6081..3d6f8f69033 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,12 +29,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +51,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,16 +111,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index b8842918b6d..695eec5456e 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index 7d4ca1746d8..a7b5c9ab9d7 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 76d02f54af7..17e24599d3a 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 69924361770..0e64b00812f 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index 41f26cc3674..1251041777d 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index e35870d2d61..945a442d907 100644 --- a/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Onenote/Sections/SectionsRequestBuilder.cs b/src/generated/Groups/Item/Onenote/Sections/SectionsRequestBuilder.cs index fb4c83c12a3..023890fc87c 100644 --- a/src/generated/Groups/Item/Onenote/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Onenote/Sections/SectionsRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,26 +71,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Owners/@Ref/RefRequestBuilder.cs b/src/generated/Groups/Item/Owners/@Ref/RefRequestBuilder.cs index 633407d4cf8..a9ab2a199c5 100644 --- a/src/generated/Groups/Item/Owners/@Ref/RefRequestBuilder.cs +++ b/src/generated/Groups/Item/Owners/@Ref/RefRequestBuilder.cs @@ -19,28 +19,43 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. + /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand."; + command.Description = "The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -53,20 +68,24 @@ public Command BuildGetCommand() { return command; } /// - /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. + /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. /// public Command BuildPostCommand() { var command = new Command("post"); - command.Description = "The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand."; + command.Description = "The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,7 +111,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. + /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -113,7 +132,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. + /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. /// /// Request headers /// Request options @@ -131,7 +150,7 @@ public RequestInformation CreatePostRequestInformation(ApiSdk.Groups.Item.Owners return requestInfo; } /// - /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. + /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -143,7 +162,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. + /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -155,7 +174,7 @@ public async Task GetAsync(Action q = default, var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. + /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Groups/Item/Owners/OwnersRequestBuilder.cs b/src/generated/Groups/Item/Owners/OwnersRequestBuilder.cs index dfa9b4491c3..4c89997fe95 100644 --- a/src/generated/Groups/Item/Owners/OwnersRequestBuilder.cs +++ b/src/generated/Groups/Item/Owners/OwnersRequestBuilder.cs @@ -20,32 +20,53 @@ public class OwnersRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. + /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand."; + command.Description = "The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,7 +99,7 @@ public OwnersRequestBuilder(Dictionary pathParameters, IRequestA RequestAdapter = requestAdapter; } /// - /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. + /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -99,7 +120,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. + /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -110,7 +131,7 @@ public async Task GetAsync(Action q = defaul var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. + /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Groups/Item/PermissionGrants/Item/ResourceSpecificPermissionGrantRequestBuilder.cs b/src/generated/Groups/Item/PermissionGrants/Item/ResourceSpecificPermissionGrantRequestBuilder.cs index 5a1c313f463..bd901e440d6 100644 --- a/src/generated/Groups/Item/PermissionGrants/Item/ResourceSpecificPermissionGrantRequestBuilder.cs +++ b/src/generated/Groups/Item/PermissionGrants/Item/ResourceSpecificPermissionGrantRequestBuilder.cs @@ -20,18 +20,21 @@ public class ResourceSpecificPermissionGrantRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The permission that has been granted for a group to a specific application. Supports $expand."; + command.Description = "The permissions that have been granted for a group to a specific application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var resourceSpecificPermissionGrantIdOption = new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant"); + resourceSpecificPermissionGrantIdOption.IsRequired = true; + command.AddOption(resourceSpecificPermissionGrantIdOption); command.Handler = CommandHandler.Create(async (groupId, resourceSpecificPermissionGrantId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(resourceSpecificPermissionGrantId)) requestInfo.PathParameters.Add("resourceSpecificPermissionGrant_id", resourceSpecificPermissionGrantId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The permission that has been granted for a group to a specific application. Supports $expand."; + command.Description = "The permissions that have been granted for a group to a specific application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, resourceSpecificPermissionGrantId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(resourceSpecificPermissionGrantId)) requestInfo.PathParameters.Add("resourceSpecificPermissionGrant_id", resourceSpecificPermissionGrantId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var resourceSpecificPermissionGrantIdOption = new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant"); + resourceSpecificPermissionGrantIdOption.IsRequired = true; + command.AddOption(resourceSpecificPermissionGrantIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, resourceSpecificPermissionGrantId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The permission that has been granted for a group to a specific application. Supports $expand."; + command.Description = "The permissions that have been granted for a group to a specific application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var resourceSpecificPermissionGrantIdOption = new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant"); + resourceSpecificPermissionGrantIdOption.IsRequired = true; + command.AddOption(resourceSpecificPermissionGrantIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, resourceSpecificPermissionGrantId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(resourceSpecificPermissionGrantId)) requestInfo.PathParameters.Add("resourceSpecificPermissionGrant_id", resourceSpecificPermissionGrantId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public ResourceSpecificPermissionGrantRequestBuilder(Dictionary RequestAdapter = requestAdapter; } /// - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(ResourceSpecificPermissi return requestInfo; } /// - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } /// - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(ResourceSpecificPermissionGrant model, ActionThe permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Groups/Item/PermissionGrants/PermissionGrantsRequestBuilder.cs b/src/generated/Groups/Item/PermissionGrants/PermissionGrantsRequestBuilder.cs index 2a2101f8ef2..df212cfb563 100644 --- a/src/generated/Groups/Item/PermissionGrants/PermissionGrantsRequestBuilder.cs +++ b/src/generated/Groups/Item/PermissionGrants/PermissionGrantsRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The permission that has been granted for a group to a specific application. Supports $expand."; + command.Description = "The permissions that have been granted for a group to a specific application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,32 +60,53 @@ public Command BuildCreateCommand() { return command; } /// - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The permission that has been granted for a group to a specific application. Supports $expand."; + command.Description = "The permissions that have been granted for a group to a specific application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,7 +132,7 @@ public PermissionGrantsRequestBuilder(Dictionary pathParameters, RequestAdapter = requestAdapter; } /// - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -128,7 +153,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// /// Request headers /// Request options @@ -146,7 +171,7 @@ public RequestInformation CreatePostRequestInformation(ResourceSpecificPermissio return requestInfo; } /// - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -158,7 +183,7 @@ public async Task GetAsync(Action return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -170,7 +195,7 @@ public async Task PostAsync(ResourceSpecificPer var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Groups/Item/Photo/PhotoRequestBuilder.cs b/src/generated/Groups/Item/Photo/PhotoRequestBuilder.cs index 1b4f70bdd8a..04abc783a18 100644 --- a/src/generated/Groups/Item/Photo/PhotoRequestBuilder.cs +++ b/src/generated/Groups/Item/Photo/PhotoRequestBuilder.cs @@ -28,16 +28,18 @@ public Command BuildContentCommand() { return command; } /// - /// The group's profile photo + /// The group's profile photo. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The group's profile photo"; + command.Description = "The group's profile photo."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,18 +47,23 @@ public Command BuildDeleteCommand() { return command; } /// - /// The group's profile photo + /// The group's profile photo. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The group's profile photo"; + command.Description = "The group's profile photo."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,20 +76,24 @@ public Command BuildGetCommand() { return command; } /// - /// The group's profile photo + /// The group's profile photo. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The group's profile photo"; + command.Description = "The group's profile photo."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +114,7 @@ public PhotoRequestBuilder(Dictionary pathParameters, IRequestAd RequestAdapter = requestAdapter; } /// - /// The group's profile photo + /// The group's profile photo. /// Request headers /// Request options /// @@ -118,7 +129,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The group's profile photo + /// The group's profile photo. /// Request headers /// Request options /// Request query parameters @@ -139,7 +150,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The group's profile photo + /// The group's profile photo. /// /// Request headers /// Request options @@ -157,7 +168,7 @@ public RequestInformation CreatePatchRequestInformation(ProfilePhoto body, Actio return requestInfo; } /// - /// The group's profile photo + /// The group's profile photo. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +179,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The group's profile photo + /// The group's profile photo. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +191,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The group's profile photo + /// The group's profile photo. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +203,7 @@ public async Task PatchAsync(ProfilePhoto model, ActionThe group's profile photo + /// The group's profile photo. public class GetQueryParameters : QueryParametersBase { /// Select properties to be returned public string[] Select { get; set; } diff --git a/src/generated/Groups/Item/Photo/Value/ContentRequestBuilder.cs b/src/generated/Groups/Item/Photo/Value/ContentRequestBuilder.cs index 5cc7d0e0f31..cf14999f73b 100644 --- a/src/generated/Groups/Item/Photo/Value/ContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Photo/Value/ContentRequestBuilder.cs @@ -19,17 +19,19 @@ public class ContentRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The group's profile photo + /// The group's profile photo. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The group's profile photo"; + command.Description = "The group's profile photo."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (groupId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -46,18 +48,22 @@ public Command BuildGetCommand() { return command; } /// - /// The group's profile photo + /// The group's profile photo. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The group's profile photo"; + command.Description = "The group's profile photo."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--file", description: "Binary request body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (groupId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -78,7 +84,7 @@ public ContentRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// The group's profile photo + /// The group's profile photo. /// Request headers /// Request options /// @@ -93,7 +99,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The group's profile photo + /// The group's profile photo. /// Binary request body /// Request headers /// Request options @@ -111,7 +117,7 @@ public RequestInformation CreatePutRequestInformation(Stream body, Action - /// The group's profile photo + /// The group's profile photo. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -122,7 +128,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The group's profile photo + /// The group's profile photo. /// Cancellation token to use when cancelling requests /// Request headers /// Request options diff --git a/src/generated/Groups/Item/Photos/Item/ProfilePhotoRequestBuilder.cs b/src/generated/Groups/Item/Photos/Item/ProfilePhotoRequestBuilder.cs index 76b88b3f657..9c49dd90708 100644 --- a/src/generated/Groups/Item/Photos/Item/ProfilePhotoRequestBuilder.cs +++ b/src/generated/Groups/Item/Photos/Item/ProfilePhotoRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The profile photos owned by the group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); command.Handler = CommandHandler.Create(async (groupId, profilePhotoId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,14 +56,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The profile photos owned by the group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, profilePhotoId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, profilePhotoId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,16 +88,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The profile photos owned by the group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, profilePhotoId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Photos/Item/Value/ContentRequestBuilder.cs b/src/generated/Groups/Item/Photos/Item/Value/ContentRequestBuilder.cs index 2c80abaa67e..f1accc145f5 100644 --- a/src/generated/Groups/Item/Photos/Item/Value/ContentRequestBuilder.cs +++ b/src/generated/Groups/Item/Photos/Item/Value/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property photos from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (groupId, profilePhotoId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property photos in groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); - command.AddOption(new Option("--file", description: "Binary request body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (groupId, profilePhotoId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Photos/PhotosRequestBuilder.cs b/src/generated/Groups/Item/Photos/PhotosRequestBuilder.cs index 00a6bb42f6d..032f42d0f33 100644 --- a/src/generated/Groups/Item/Photos/PhotosRequestBuilder.cs +++ b/src/generated/Groups/Item/Photos/PhotosRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The profile photos owned by the group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,22 +67,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The profile photos owned by the group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Planner/PlannerRequestBuilder.cs b/src/generated/Groups/Item/Planner/PlannerRequestBuilder.cs index 036c7694627..d0041f78f60 100644 --- a/src/generated/Groups/Item/Planner/PlannerRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/PlannerRequestBuilder.cs @@ -21,16 +21,18 @@ public class PlannerRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Entry-point to Planner resource that might exist for a Unified Group. + /// Selective Planner services available to the group. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Entry-point to Planner resource that might exist for a Unified Group."; + command.Description = "Selective Planner services available to the group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -38,20 +40,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Entry-point to Planner resource that might exist for a Unified Group. + /// Selective Planner services available to the group. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Entry-point to Planner resource that might exist for a Unified Group."; + command.Description = "Selective Planner services available to the group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,20 +74,24 @@ public Command BuildGetCommand() { return command; } /// - /// Entry-point to Planner resource that might exist for a Unified Group. + /// Selective Planner services available to the group. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Entry-point to Planner resource that might exist for a Unified Group."; + command.Description = "Selective Planner services available to the group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -105,7 +119,7 @@ public PlannerRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Entry-point to Planner resource that might exist for a Unified Group. + /// Selective Planner services available to the group. Read-only. Nullable. /// Request headers /// Request options /// @@ -120,7 +134,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Entry-point to Planner resource that might exist for a Unified Group. + /// Selective Planner services available to the group. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -141,7 +155,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Entry-point to Planner resource that might exist for a Unified Group. + /// Selective Planner services available to the group. Read-only. Nullable. /// /// Request headers /// Request options @@ -159,7 +173,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerGroup body, Actio return requestInfo; } /// - /// Entry-point to Planner resource that might exist for a Unified Group. + /// Selective Planner services available to the group. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -170,7 +184,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Entry-point to Planner resource that might exist for a Unified Group. + /// Selective Planner services available to the group. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -182,7 +196,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Entry-point to Planner resource that might exist for a Unified Group. + /// Selective Planner services available to the group. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -194,7 +208,7 @@ public async Task PatchAsync(PlannerGroup model, ActionEntry-point to Planner resource that might exist for a Unified Group. + /// Selective Planner services available to the group. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs index 8ee7a5f7c24..17fb3e7ff9a 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs @@ -31,22 +31,27 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,34 +64,56 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,7 +139,7 @@ public BucketsRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -133,7 +160,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -151,7 +178,7 @@ public RequestInformation CreatePostRequestInformation(PlannerBucket body, Actio return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -163,7 +190,7 @@ public async Task GetAsync(Action q = defau return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -175,7 +202,7 @@ public async Task PostAsync(PlannerBucket model, Action(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs index 29bba087ebc..2697159cc95 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs @@ -21,20 +21,24 @@ public class PlannerBucketRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,24 +46,34 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +86,30 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -117,7 +137,7 @@ public PlannerBucketRequestBuilder(Dictionary pathParameters, IR RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Request headers /// Request options /// @@ -132,7 +152,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -153,7 +173,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -171,7 +191,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerBucket body, Acti return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -182,7 +202,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -194,7 +214,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -206,7 +226,7 @@ public async Task PatchAsync(PlannerBucket model, ActionRead-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs index 7b0fae21d82..14a58a18674 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs index 249ef470ff9..dd98a630161 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs index 06e50e31ca0..9d2be6f3994 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs index f938cdbff5f..cb256bb6bca 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs @@ -46,16 +46,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -77,20 +82,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,20 +125,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs index 292e4861c75..8fc98f777f7 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs index 8e625f75de1..193ef8302d0 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,30 +76,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerBucketId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Details/DetailsRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Details/DetailsRequestBuilder.cs index 9d6f00ca50b..73e7f7fce88 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Details/DetailsRequestBuilder.cs @@ -20,18 +20,21 @@ public class DetailsRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Additional details about the plan."; + command.Description = "Additional details about the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Additional details about the plan."; + command.Description = "Additional details about the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Additional details about the plan."; + command.Description = "Additional details about the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public DetailsRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerPlanDetails body, return requestInfo; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = de return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(PlannerPlanDetails model, ActionRead-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Groups/Item/Planner/Plans/Item/PlannerPlanRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/PlannerPlanRequestBuilder.cs index 3fbfadd8420..8db8571c3c2 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/PlannerPlanRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/PlannerPlanRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Returns the plannerPlans owned by the group."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,16 +66,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Returns the plannerPlans owned by the group."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,16 +103,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Returns the plannerPlans owned by the group."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs index ccfad8822a3..274f268d055 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs index e12879008ee..4cd74a9ee2d 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs index 3e41a4f2d99..342b9d2edbd 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs index 73ca66f5394..0ca0d613257 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs @@ -40,20 +40,24 @@ public Command BuildBucketTaskBoardFormatCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -69,24 +73,34 @@ public Command BuildDetailsCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,24 +113,30 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -145,7 +165,7 @@ public PlannerTaskRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Request headers /// Request options /// @@ -160,7 +180,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -181,7 +201,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -199,7 +219,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerTask body, Action return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -210,7 +230,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -222,7 +242,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -234,7 +254,7 @@ public async Task PatchAsync(PlannerTask model, ActionRead-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs index d236f7487f4..f720f870a12 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs index 9a483fd380a..64d4b3f934a 100644 --- a/src/generated/Groups/Item/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs @@ -34,22 +34,27 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,34 +67,56 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -115,7 +142,7 @@ public TasksRequestBuilder(Dictionary pathParameters, IRequestAd RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -136,7 +163,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -154,7 +181,7 @@ public RequestInformation CreatePostRequestInformation(PlannerTask body, Action< return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -166,7 +193,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -178,7 +205,7 @@ public async Task PostAsync(PlannerTask model, Action(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Groups/Item/Planner/Plans/PlansRequestBuilder.cs b/src/generated/Groups/Item/Planner/Plans/PlansRequestBuilder.cs index 1ec12055d71..661d59399a5 100644 --- a/src/generated/Groups/Item/Planner/Plans/PlansRequestBuilder.cs +++ b/src/generated/Groups/Item/Planner/Plans/PlansRequestBuilder.cs @@ -39,14 +39,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable. Returns the plannerPlans owned by the group."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,26 +69,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable. Returns the plannerPlans owned by the group."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/RejectedSenders/@Ref/RefRequestBuilder.cs b/src/generated/Groups/Item/RejectedSenders/@Ref/RefRequestBuilder.cs index 8748e4ed43f..7e0756cf55b 100644 --- a/src/generated/Groups/Item/RejectedSenders/@Ref/RefRequestBuilder.cs +++ b/src/generated/Groups/Item/RejectedSenders/@Ref/RefRequestBuilder.cs @@ -25,20 +25,33 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of users or groups that are not allowed to create posts or calendar events in this group. Nullable"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,14 +70,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The list of users or groups that are not allowed to create posts or calendar events in this group. Nullable"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/RejectedSenders/RejectedSendersRequestBuilder.cs b/src/generated/Groups/Item/RejectedSenders/RejectedSendersRequestBuilder.cs index 90bd7ebfcbc..50b429d819a 100644 --- a/src/generated/Groups/Item/RejectedSenders/RejectedSendersRequestBuilder.cs +++ b/src/generated/Groups/Item/RejectedSenders/RejectedSendersRequestBuilder.cs @@ -26,22 +26,38 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of users or groups that are not allowed to create posts or calendar events in this group. Nullable"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/RemoveFavorite/RemoveFavoriteRequestBuilder.cs b/src/generated/Groups/Item/RemoveFavorite/RemoveFavoriteRequestBuilder.cs index 5810201fd3c..0414e3e4f83 100644 --- a/src/generated/Groups/Item/RemoveFavorite/RemoveFavoriteRequestBuilder.cs +++ b/src/generated/Groups/Item/RemoveFavorite/RemoveFavoriteRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action removeFavorite"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Renew/RenewRequestBuilder.cs b/src/generated/Groups/Item/Renew/RenewRequestBuilder.cs index 1fdfa9fe490..4bce959ab8a 100644 --- a/src/generated/Groups/Item/Renew/RenewRequestBuilder.cs +++ b/src/generated/Groups/Item/Renew/RenewRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action renew"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/ResetUnseenCount/ResetUnseenCountRequestBuilder.cs b/src/generated/Groups/Item/ResetUnseenCount/ResetUnseenCountRequestBuilder.cs index f08cd08e44e..4372f000bc2 100644 --- a/src/generated/Groups/Item/ResetUnseenCount/ResetUnseenCountRequestBuilder.cs +++ b/src/generated/Groups/Item/ResetUnseenCount/ResetUnseenCountRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action resetUnseenCount"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Restore/RestoreRequestBuilder.cs b/src/generated/Groups/Item/Restore/RestoreRequestBuilder.cs index ba349f874de..27758a17884 100644 --- a/src/generated/Groups/Item/Restore/RestoreRequestBuilder.cs +++ b/src/generated/Groups/Item/Restore/RestoreRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restore"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Settings/Item/GroupSettingRequestBuilder.cs b/src/generated/Groups/Item/Settings/Item/GroupSettingRequestBuilder.cs index e2f63d535f4..4c3a4f13e29 100644 --- a/src/generated/Groups/Item/Settings/Item/GroupSettingRequestBuilder.cs +++ b/src/generated/Groups/Item/Settings/Item/GroupSettingRequestBuilder.cs @@ -20,18 +20,21 @@ public class GroupSettingRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable."; + command.Description = "Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--groupsetting-id", description: "key: id of groupSetting")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var groupSettingIdOption = new Option("--groupsetting-id", description: "key: id of groupSetting"); + groupSettingIdOption.IsRequired = true; + command.AddOption(groupSettingIdOption); command.Handler = CommandHandler.Create(async (groupId, groupSettingId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(groupSettingId)) requestInfo.PathParameters.Add("groupSetting_id", groupSettingId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable."; + command.Description = "Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--groupsetting-id", description: "key: id of groupSetting")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, groupSettingId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(groupSettingId)) requestInfo.PathParameters.Add("groupSetting_id", groupSettingId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var groupSettingIdOption = new Option("--groupsetting-id", description: "key: id of groupSetting"); + groupSettingIdOption.IsRequired = true; + command.AddOption(groupSettingIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, groupSettingId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable."; + command.Description = "Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--groupsetting-id", description: "key: id of groupSetting")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var groupSettingIdOption = new Option("--groupsetting-id", description: "key: id of groupSetting"); + groupSettingIdOption.IsRequired = true; + command.AddOption(groupSettingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, groupSettingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(groupSettingId)) requestInfo.PathParameters.Add("groupSetting_id", groupSettingId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public GroupSettingRequestBuilder(Dictionary pathParameters, IRe RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(GroupSetting body, Actio return requestInfo; } /// - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(GroupSetting model, ActionRead-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Groups/Item/Settings/SettingsRequestBuilder.cs b/src/generated/Groups/Item/Settings/SettingsRequestBuilder.cs index 66b8d4252db..c6d2a3ccf22 100644 --- a/src/generated/Groups/Item/Settings/SettingsRequestBuilder.cs +++ b/src/generated/Groups/Item/Settings/SettingsRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable."; + command.Description = "Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,32 +60,53 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable."; + command.Description = "Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,7 +132,7 @@ public SettingsRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// Request headers /// Request options /// Request query parameters @@ -128,7 +153,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// /// Request headers /// Request options @@ -146,7 +171,7 @@ public RequestInformation CreatePostRequestInformation(GroupSetting body, Action return requestInfo; } /// - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -158,7 +183,7 @@ public async Task GetAsync(Action q = defa return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -170,7 +195,7 @@ public async Task PostAsync(GroupSetting model, Action(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Groups/Item/Sites/Item/SiteRequestBuilder.cs b/src/generated/Groups/Item/Sites/Item/SiteRequestBuilder.cs index a8302706ff4..e3e540b455e 100644 --- a/src/generated/Groups/Item/Sites/Item/SiteRequestBuilder.cs +++ b/src/generated/Groups/Item/Sites/Item/SiteRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of SharePoint sites in this group. Access the default site with /sites/root."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--site-id", description: "key: id of site")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); command.Handler = CommandHandler.Create(async (groupId, siteId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of SharePoint sites in this group. Access the default site with /sites/root."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, siteId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, siteId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of SharePoint sites in this group. Access the default site with /sites/root."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Sites/SitesRequestBuilder.cs b/src/generated/Groups/Item/Sites/SitesRequestBuilder.cs index 1c152b3531f..2044702bd68 100644 --- a/src/generated/Groups/Item/Sites/SitesRequestBuilder.cs +++ b/src/generated/Groups/Item/Sites/SitesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of SharePoint sites in this group. Access the default site with /sites/root."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of SharePoint sites in this group. Access the default site with /sites/root."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/SubscribeByMail/SubscribeByMailRequestBuilder.cs b/src/generated/Groups/Item/SubscribeByMail/SubscribeByMailRequestBuilder.cs index dab97bf84fb..87300807276 100644 --- a/src/generated/Groups/Item/SubscribeByMail/SubscribeByMailRequestBuilder.cs +++ b/src/generated/Groups/Item/SubscribeByMail/SubscribeByMailRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action subscribeByMail"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Team/TeamRequestBuilder.cs b/src/generated/Groups/Item/Team/TeamRequestBuilder.cs index bd8716463fc..e3e72be0e00 100644 --- a/src/generated/Groups/Item/Team/TeamRequestBuilder.cs +++ b/src/generated/Groups/Item/Team/TeamRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property team for groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get team from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property team in groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Threads/Item/ConversationThreadRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/ConversationThreadRequestBuilder.cs index 9a92e5adef8..a6a294261c6 100644 --- a/src/generated/Groups/Item/Threads/Item/ConversationThreadRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/ConversationThreadRequestBuilder.cs @@ -28,12 +28,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The group's conversation threads. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,14 +50,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The group's conversation threads. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +82,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The group's conversation threads. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/Attachments/AttachmentsRequestBuilder.cs index 4377d68c7d7..8c8117c75a6 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/Attachments/AttachmentsRequestBuilder.cs @@ -31,24 +31,30 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable. Supports $expand."; + command.Description = "The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,34 +73,55 @@ public Command BuildCreateUploadSessionCommand() { return command; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable. Supports $expand."; + command.Description = "The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,7 +147,7 @@ public AttachmentsRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -141,7 +168,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// /// Request headers /// Request options @@ -159,7 +186,7 @@ public RequestInformation CreatePostRequestInformation(Attachment body, Action - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -171,7 +198,7 @@ public async Task GetAsync(Action q = d return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -183,7 +210,7 @@ public async Task PostAsync(Attachment model, Action(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 9425a25834e..6583a16e56c 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/Attachments/Item/AttachmentRequestBuilder.cs index 51037f1ad7b..8ef447a658d 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -20,22 +20,27 @@ public class AttachmentRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Supports $expand."; + command.Description = "The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,26 +48,37 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Supports $expand."; + command.Description = "The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,26 +91,33 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Supports $expand."; + command.Description = "The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -115,7 +138,7 @@ public AttachmentRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// @@ -130,7 +153,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -151,7 +174,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// /// Request headers /// Request options @@ -169,7 +192,7 @@ public RequestInformation CreatePatchRequestInformation(Attachment body, Action< return requestInfo; } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +203,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -192,7 +215,7 @@ public async Task GetAsync(Action q = default, A return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -204,7 +227,7 @@ public async Task PatchAsync(Attachment model, ActionRead-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/Extensions/ExtensionsRequestBuilder.cs index 20606a028f7..8d5ca227fc4 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +72,49 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/Extensions/Item/ExtensionRequestBuilder.cs index e7f0855d864..57a802526d5 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the post. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/Forward/ForwardRequestBuilder.cs index f12d09a625d..b74a60083c9 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/InReplyTo/Forward/ForwardRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/InReplyTo/Forward/ForwardRequestBuilder.cs index e4a390d5b41..d4df854f82e 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/InReplyTo/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/InReplyTo/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/InReplyTo/InReplyToRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/InReplyTo/InReplyToRequestBuilder.cs index 503e6e4852b..20fa08b31ea 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/InReplyTo/InReplyToRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/InReplyTo/InReplyToRequestBuilder.cs @@ -22,20 +22,24 @@ public class InReplyToRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Supports $expand."; + command.Description = "The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,24 +53,34 @@ public Command BuildForwardCommand() { return command; } /// - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Supports $expand."; + command.Description = "The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,24 +93,30 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Supports $expand."; + command.Description = "The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -123,7 +143,7 @@ public InReplyToRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// Request headers /// Request options /// @@ -138,7 +158,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -159,7 +179,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// /// Request headers /// Request options @@ -177,7 +197,7 @@ public RequestInformation CreatePatchRequestInformation(Post body, Action - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -188,7 +208,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -200,7 +220,7 @@ public async Task GetAsync(Action q = default, Action< return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -212,7 +232,7 @@ public async Task PatchAsync(Post model, Action> h = var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/InReplyTo/Reply/ReplyRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/InReplyTo/Reply/ReplyRequestBuilder.cs index 750e5b1e7c6..aefb3b21894 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/InReplyTo/Reply/ReplyRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/InReplyTo/Reply/ReplyRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reply"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index c1000aa65e0..f1f03900d06 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 67f54602d63..b49829870d1 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/PostRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/PostRequestBuilder.cs index 5e86e330a74..f8ee56fc92e 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/PostRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/PostRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -75,18 +79,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,18 +136,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/Reply/ReplyRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/Reply/ReplyRequestBuilder.cs index 8e0b74d3883..0ee9fbd55d2 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/Reply/ReplyRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/Reply/ReplyRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reply"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 8d9d06a7d36..b3f7614e3fa 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 83315c7db70..3bac01395ab 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the post. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--post-id", description: "key: id of post")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - if (!String.IsNullOrEmpty(postId)) requestInfo.PathParameters.Add("post_id", postId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var postIdOption = new Option("--post-id", description: "key: id of post"); + postIdOption.IsRequired = true; + command.AddOption(postIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, postId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Threads/Item/Posts/PostsRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/PostsRequestBuilder.cs index 08daf73c190..5e7e854eb90 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/PostsRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/PostsRequestBuilder.cs @@ -43,16 +43,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,26 +76,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/Threads/Item/Reply/ReplyRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Reply/ReplyRequestBuilder.cs index 3fab6412560..7952c0f07a5 100644 --- a/src/generated/Groups/Item/Threads/Item/Reply/ReplyRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Reply/ReplyRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reply"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--conversationthread-id", description: "key: id of conversationThread")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var conversationThreadIdOption = new Option("--conversationthread-id", description: "key: id of conversationThread"); + conversationThreadIdOption.IsRequired = true; + command.AddOption(conversationThreadIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, conversationThreadId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(conversationThreadId)) requestInfo.PathParameters.Add("conversationThread_id", conversationThreadId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/Threads/ThreadsRequestBuilder.cs b/src/generated/Groups/Item/Threads/ThreadsRequestBuilder.cs index 911f3e857a9..f415b3cc707 100644 --- a/src/generated/Groups/Item/Threads/ThreadsRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/ThreadsRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The group's conversation threads. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,22 +68,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The group's conversation threads. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs b/src/generated/Groups/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs index 59a3012a540..eac0ad7d958 100644 --- a/src/generated/Groups/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs +++ b/src/generated/Groups/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of transitiveMemberOf from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Create new navigation property ref to transitiveMemberOf for groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs b/src/generated/Groups/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs index 0f89ecf42c0..e432262e2c8 100644 --- a/src/generated/Groups/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs +++ b/src/generated/Groups/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get transitiveMemberOf from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/TransitiveMembers/@Ref/RefRequestBuilder.cs b/src/generated/Groups/Item/TransitiveMembers/@Ref/RefRequestBuilder.cs index 886a88f728f..ea867a54f1d 100644 --- a/src/generated/Groups/Item/TransitiveMembers/@Ref/RefRequestBuilder.cs +++ b/src/generated/Groups/Item/TransitiveMembers/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of transitiveMembers from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Create new navigation property ref to transitiveMembers for groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/TransitiveMembers/TransitiveMembersRequestBuilder.cs b/src/generated/Groups/Item/TransitiveMembers/TransitiveMembersRequestBuilder.cs index 21ef7a11d0c..90afed70cfb 100644 --- a/src/generated/Groups/Item/TransitiveMembers/TransitiveMembersRequestBuilder.cs +++ b/src/generated/Groups/Item/TransitiveMembers/TransitiveMembersRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get transitiveMembers from groups"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Groups/Item/UnsubscribeByMail/UnsubscribeByMailRequestBuilder.cs b/src/generated/Groups/Item/UnsubscribeByMail/UnsubscribeByMailRequestBuilder.cs index 3125f5e6f98..c429fad5c22 100644 --- a/src/generated/Groups/Item/UnsubscribeByMail/UnsubscribeByMailRequestBuilder.cs +++ b/src/generated/Groups/Item/UnsubscribeByMail/UnsubscribeByMailRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unsubscribeByMail"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (groupId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/Item/ValidateProperties/ValidatePropertiesRequestBuilder.cs b/src/generated/Groups/Item/ValidateProperties/ValidatePropertiesRequestBuilder.cs index 8ddb1fd5144..24a95d5da64 100644 --- a/src/generated/Groups/Item/ValidateProperties/ValidatePropertiesRequestBuilder.cs +++ b/src/generated/Groups/Item/ValidateProperties/ValidatePropertiesRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validateProperties"; // Create options for all the parameters - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Groups/ValidateProperties/ValidatePropertiesRequestBuilder.cs b/src/generated/Groups/ValidateProperties/ValidatePropertiesRequestBuilder.cs index 8be0d043e74..9fda40f6556 100644 --- a/src/generated/Groups/ValidateProperties/ValidatePropertiesRequestBuilder.cs +++ b/src/generated/Groups/ValidateProperties/ValidatePropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validateProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Identity/ApiConnectors/ApiConnectorsRequestBuilder.cs b/src/generated/Identity/ApiConnectors/ApiConnectorsRequestBuilder.cs index 9baec66ca13..592c874ba71 100644 --- a/src/generated/Identity/ApiConnectors/ApiConnectorsRequestBuilder.cs +++ b/src/generated/Identity/ApiConnectors/ApiConnectorsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents entry point for API connectors."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents entry point for API connectors."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/ApiConnectors/Item/IdentityApiConnectorRequestBuilder.cs b/src/generated/Identity/ApiConnectors/Item/IdentityApiConnectorRequestBuilder.cs index f5b5051fe49..694933340c2 100644 --- a/src/generated/Identity/ApiConnectors/Item/IdentityApiConnectorRequestBuilder.cs +++ b/src/generated/Identity/ApiConnectors/Item/IdentityApiConnectorRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents entry point for API connectors."; // Create options for all the parameters - command.AddOption(new Option("--identityapiconnector-id", description: "key: id of identityApiConnector")); + var identityApiConnectorIdOption = new Option("--identityapiconnector-id", description: "key: id of identityApiConnector"); + identityApiConnectorIdOption.IsRequired = true; + command.AddOption(identityApiConnectorIdOption); command.Handler = CommandHandler.Create(async (identityApiConnectorId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(identityApiConnectorId)) requestInfo.PathParameters.Add("identityApiConnector_id", identityApiConnectorId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents entry point for API connectors."; // Create options for all the parameters - command.AddOption(new Option("--identityapiconnector-id", description: "key: id of identityApiConnector")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (identityApiConnectorId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(identityApiConnectorId)) requestInfo.PathParameters.Add("identityApiConnector_id", identityApiConnectorId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var identityApiConnectorIdOption = new Option("--identityapiconnector-id", description: "key: id of identityApiConnector"); + identityApiConnectorIdOption.IsRequired = true; + command.AddOption(identityApiConnectorIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (identityApiConnectorId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,14 +80,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents entry point for API connectors."; // Create options for all the parameters - command.AddOption(new Option("--identityapiconnector-id", description: "key: id of identityApiConnector")); - command.AddOption(new Option("--body")); + var identityApiConnectorIdOption = new Option("--identityapiconnector-id", description: "key: id of identityApiConnector"); + identityApiConnectorIdOption.IsRequired = true; + command.AddOption(identityApiConnectorIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (identityApiConnectorId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(identityApiConnectorId)) requestInfo.PathParameters.Add("identityApiConnector_id", identityApiConnectorId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Identity/ApiConnectors/Item/UploadClientCertificate/UploadClientCertificateRequestBuilder.cs b/src/generated/Identity/ApiConnectors/Item/UploadClientCertificate/UploadClientCertificateRequestBuilder.cs index efe1ebdb089..b257c26a05c 100644 --- a/src/generated/Identity/ApiConnectors/Item/UploadClientCertificate/UploadClientCertificateRequestBuilder.cs +++ b/src/generated/Identity/ApiConnectors/Item/UploadClientCertificate/UploadClientCertificateRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action uploadClientCertificate"; // Create options for all the parameters - command.AddOption(new Option("--identityapiconnector-id", description: "key: id of identityApiConnector")); - command.AddOption(new Option("--body")); + var identityApiConnectorIdOption = new Option("--identityapiconnector-id", description: "key: id of identityApiConnector"); + identityApiConnectorIdOption.IsRequired = true; + command.AddOption(identityApiConnectorIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (identityApiConnectorId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(identityApiConnectorId)) requestInfo.PathParameters.Add("identityApiConnector_id", identityApiConnectorId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/B2xUserFlows/B2xUserFlowsRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/B2xUserFlowsRequestBuilder.cs index ad6c890c0fe..c3a9220fb9f 100644 --- a/src/generated/Identity/B2xUserFlows/B2xUserFlowsRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/B2xUserFlowsRequestBuilder.cs @@ -34,18 +34,21 @@ public List BuildCommand() { return commands; } /// - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Represents entry point for B2X/self-service sign-up identity userflows."; + command.Description = "Represents entry point for B2X and self-service sign-up identity userflows."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,30 +61,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Represents entry point for B2X/self-service sign-up identity userflows."; + command.Description = "Represents entry point for B2X and self-service sign-up identity userflows."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,7 +130,7 @@ public B2xUserFlowsRequestBuilder(Dictionary pathParameters, IRe RequestAdapter = requestAdapter; } /// - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// Request headers /// Request options /// Request query parameters @@ -128,7 +151,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// /// Request headers /// Request options @@ -146,7 +169,7 @@ public RequestInformation CreatePostRequestInformation(B2xIdentityUserFlow body, return requestInfo; } /// - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -158,7 +181,7 @@ public async Task GetAsync(Action q = return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -170,7 +193,7 @@ public async Task PostAsync(B2xIdentityUserFlow model, Acti var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Identity/B2xUserFlows/Item/B2xIdentityUserFlowRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/B2xIdentityUserFlowRequestBuilder.cs index b18a15f3bcd..887635b7de3 100644 --- a/src/generated/Identity/B2xUserFlows/Item/B2xIdentityUserFlowRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/B2xIdentityUserFlowRequestBuilder.cs @@ -24,16 +24,18 @@ public class B2xIdentityUserFlowRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Represents entry point for B2X/self-service sign-up identity userflows."; + command.Description = "Represents entry point for B2X and self-service sign-up identity userflows."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,20 +43,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Represents entry point for B2X/self-service sign-up identity userflows."; + command.Description = "Represents entry point for B2X and self-service sign-up identity userflows."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +91,24 @@ public Command BuildLanguagesCommand() { return command; } /// - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Represents entry point for B2X/self-service sign-up identity userflows."; + command.Description = "Represents entry point for B2X and self-service sign-up identity userflows."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -130,7 +144,7 @@ public B2xIdentityUserFlowRequestBuilder(Dictionary pathParamete RequestAdapter = requestAdapter; } /// - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// Request headers /// Request options /// @@ -145,7 +159,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// Request headers /// Request options /// Request query parameters @@ -166,7 +180,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// /// Request headers /// Request options @@ -184,7 +198,7 @@ public RequestInformation CreatePatchRequestInformation(B2xIdentityUserFlow body return requestInfo; } /// - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -195,7 +209,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -207,7 +221,7 @@ public async Task GetAsync(Action q = d return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -219,7 +233,7 @@ public async Task PatchAsync(B2xIdentityUserFlow model, ActionRepresents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Identity/B2xUserFlows/Item/IdentityProviders/@Ref/RefRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/IdentityProviders/@Ref/RefRequestBuilder.cs index c6024e627a5..3451b3643b9 100644 --- a/src/generated/Identity/B2xUserFlows/Item/IdentityProviders/@Ref/RefRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/IdentityProviders/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The identity providers included in the user flow."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The identity providers included in the user flow."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/B2xUserFlows/Item/IdentityProviders/IdentityProvidersRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/IdentityProviders/IdentityProvidersRequestBuilder.cs index 1f596d21330..e32796690a9 100644 --- a/src/generated/Identity/B2xUserFlows/Item/IdentityProviders/IdentityProvidersRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/IdentityProviders/IdentityProvidersRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The identity providers included in the user flow."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/B2xUserFlows/Item/Languages/Item/DefaultPages/DefaultPagesRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/Languages/Item/DefaultPages/DefaultPagesRequestBuilder.cs index 1e9448f2c0a..f9deca936dc 100644 --- a/src/generated/Identity/B2xUserFlows/Item/Languages/Item/DefaultPages/DefaultPagesRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/Languages/Item/DefaultPages/DefaultPagesRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of pages with the default content to display in a user flow for a specified language. This collection does not allow any kind of modification."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,28 +70,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of pages with the default content to display in a user flow for a specified language. This collection does not allow any kind of modification."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/B2xUserFlows/Item/Languages/Item/DefaultPages/Item/UserFlowLanguagePageRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/Languages/Item/DefaultPages/Item/UserFlowLanguagePageRequestBuilder.cs index 3c04aac73e7..43fb1642a0d 100644 --- a/src/generated/Identity/B2xUserFlows/Item/Languages/Item/DefaultPages/Item/UserFlowLanguagePageRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/Languages/Item/DefaultPages/Item/UserFlowLanguagePageRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of pages with the default content to display in a user flow for a specified language. This collection does not allow any kind of modification."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var userFlowLanguagePageIdOption = new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage"); + userFlowLanguagePageIdOption.IsRequired = true; + command.AddOption(userFlowLanguagePageIdOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, userFlowLanguagePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); - if (!String.IsNullOrEmpty(userFlowLanguagePageId)) requestInfo.PathParameters.Add("userFlowLanguagePage_id", userFlowLanguagePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of pages with the default content to display in a user flow for a specified language. This collection does not allow any kind of modification."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, userFlowLanguagePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); - if (!String.IsNullOrEmpty(userFlowLanguagePageId)) requestInfo.PathParameters.Add("userFlowLanguagePage_id", userFlowLanguagePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var userFlowLanguagePageIdOption = new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage"); + userFlowLanguagePageIdOption.IsRequired = true; + command.AddOption(userFlowLanguagePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, userFlowLanguagePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of pages with the default content to display in a user flow for a specified language. This collection does not allow any kind of modification."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage")); - command.AddOption(new Option("--body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var userFlowLanguagePageIdOption = new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage"); + userFlowLanguagePageIdOption.IsRequired = true; + command.AddOption(userFlowLanguagePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, userFlowLanguagePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); - if (!String.IsNullOrEmpty(userFlowLanguagePageId)) requestInfo.PathParameters.Add("userFlowLanguagePage_id", userFlowLanguagePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Identity/B2xUserFlows/Item/Languages/Item/DefaultPages/Item/Value/ContentRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/Languages/Item/DefaultPages/Item/Value/ContentRequestBuilder.cs index 1ce07cd4326..6455b82e238 100644 --- a/src/generated/Identity/B2xUserFlows/Item/Languages/Item/DefaultPages/Item/Value/ContentRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/Languages/Item/DefaultPages/Item/Value/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property defaultPages from identity"; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var userFlowLanguagePageIdOption = new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage"); + userFlowLanguagePageIdOption.IsRequired = true; + command.AddOption(userFlowLanguagePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, userFlowLanguagePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); - if (!String.IsNullOrEmpty(userFlowLanguagePageId)) requestInfo.PathParameters.Add("userFlowLanguagePage_id", userFlowLanguagePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property defaultPages in identity"; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var userFlowLanguagePageIdOption = new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage"); + userFlowLanguagePageIdOption.IsRequired = true; + command.AddOption(userFlowLanguagePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, userFlowLanguagePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); - if (!String.IsNullOrEmpty(userFlowLanguagePageId)) requestInfo.PathParameters.Add("userFlowLanguagePage_id", userFlowLanguagePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Identity/B2xUserFlows/Item/Languages/Item/OverridesPages/Item/UserFlowLanguagePageRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/Languages/Item/OverridesPages/Item/UserFlowLanguagePageRequestBuilder.cs index c00c9c45fc1..9d594a4aeaf 100644 --- a/src/generated/Identity/B2xUserFlows/Item/Languages/Item/OverridesPages/Item/UserFlowLanguagePageRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/Languages/Item/OverridesPages/Item/UserFlowLanguagePageRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of pages with the overrides messages to display in a user flow for a specified language. This collection only allows to modify the content of the page, any other modification is not allowed (creation or deletion of pages)."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var userFlowLanguagePageIdOption = new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage"); + userFlowLanguagePageIdOption.IsRequired = true; + command.AddOption(userFlowLanguagePageIdOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, userFlowLanguagePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); - if (!String.IsNullOrEmpty(userFlowLanguagePageId)) requestInfo.PathParameters.Add("userFlowLanguagePage_id", userFlowLanguagePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of pages with the overrides messages to display in a user flow for a specified language. This collection only allows to modify the content of the page, any other modification is not allowed (creation or deletion of pages)."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, userFlowLanguagePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); - if (!String.IsNullOrEmpty(userFlowLanguagePageId)) requestInfo.PathParameters.Add("userFlowLanguagePage_id", userFlowLanguagePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var userFlowLanguagePageIdOption = new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage"); + userFlowLanguagePageIdOption.IsRequired = true; + command.AddOption(userFlowLanguagePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, userFlowLanguagePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of pages with the overrides messages to display in a user flow for a specified language. This collection only allows to modify the content of the page, any other modification is not allowed (creation or deletion of pages)."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage")); - command.AddOption(new Option("--body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var userFlowLanguagePageIdOption = new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage"); + userFlowLanguagePageIdOption.IsRequired = true; + command.AddOption(userFlowLanguagePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, userFlowLanguagePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); - if (!String.IsNullOrEmpty(userFlowLanguagePageId)) requestInfo.PathParameters.Add("userFlowLanguagePage_id", userFlowLanguagePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Identity/B2xUserFlows/Item/Languages/Item/OverridesPages/Item/Value/ContentRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/Languages/Item/OverridesPages/Item/Value/ContentRequestBuilder.cs index 8e6df286062..73251d3d9e0 100644 --- a/src/generated/Identity/B2xUserFlows/Item/Languages/Item/OverridesPages/Item/Value/ContentRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/Languages/Item/OverridesPages/Item/Value/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property overridesPages from identity"; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var userFlowLanguagePageIdOption = new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage"); + userFlowLanguagePageIdOption.IsRequired = true; + command.AddOption(userFlowLanguagePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, userFlowLanguagePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); - if (!String.IsNullOrEmpty(userFlowLanguagePageId)) requestInfo.PathParameters.Add("userFlowLanguagePage_id", userFlowLanguagePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property overridesPages in identity"; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var userFlowLanguagePageIdOption = new Option("--userflowlanguagepage-id", description: "key: id of userFlowLanguagePage"); + userFlowLanguagePageIdOption.IsRequired = true; + command.AddOption(userFlowLanguagePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, userFlowLanguagePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); - if (!String.IsNullOrEmpty(userFlowLanguagePageId)) requestInfo.PathParameters.Add("userFlowLanguagePage_id", userFlowLanguagePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Identity/B2xUserFlows/Item/Languages/Item/OverridesPages/OverridesPagesRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/Languages/Item/OverridesPages/OverridesPagesRequestBuilder.cs index ec8eb51e69d..80e1f96e5f9 100644 --- a/src/generated/Identity/B2xUserFlows/Item/Languages/Item/OverridesPages/OverridesPagesRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/Languages/Item/OverridesPages/OverridesPagesRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of pages with the overrides messages to display in a user flow for a specified language. This collection only allows to modify the content of the page, any other modification is not allowed (creation or deletion of pages)."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,28 +70,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of pages with the overrides messages to display in a user flow for a specified language. This collection only allows to modify the content of the page, any other modification is not allowed (creation or deletion of pages)."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/B2xUserFlows/Item/Languages/Item/UserFlowLanguageConfigurationRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/Languages/Item/UserFlowLanguageConfigurationRequestBuilder.cs index 4c007db17b4..6e363460607 100644 --- a/src/generated/Identity/B2xUserFlows/Item/Languages/Item/UserFlowLanguageConfigurationRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/Languages/Item/UserFlowLanguageConfigurationRequestBuilder.cs @@ -29,18 +29,21 @@ public Command BuildDefaultPagesCommand() { return command; } /// - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows."; + command.Description = "The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,22 +51,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows."; + command.Description = "The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,22 +95,27 @@ public Command BuildOverridesPagesCommand() { return command; } /// - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows."; + command.Description = "The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration")); - command.AddOption(new Option("--body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var userFlowLanguageConfigurationIdOption = new Option("--userflowlanguageconfiguration-id", description: "key: id of userFlowLanguageConfiguration"); + userFlowLanguageConfigurationIdOption.IsRequired = true; + command.AddOption(userFlowLanguageConfigurationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, userFlowLanguageConfigurationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(userFlowLanguageConfigurationId)) requestInfo.PathParameters.Add("userFlowLanguageConfiguration_id", userFlowLanguageConfigurationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -119,7 +136,7 @@ public UserFlowLanguageConfigurationRequestBuilder(Dictionary pa RequestAdapter = requestAdapter; } /// - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// Request headers /// Request options /// @@ -134,7 +151,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// Request headers /// Request options /// Request query parameters @@ -155,7 +172,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// /// Request headers /// Request options @@ -173,7 +190,7 @@ public RequestInformation CreatePatchRequestInformation(UserFlowLanguageConfigur return requestInfo; } /// - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -184,7 +201,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -196,7 +213,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } /// - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -208,7 +225,7 @@ public async Task PatchAsync(UserFlowLanguageConfiguration model, ActionThe languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Identity/B2xUserFlows/Item/Languages/LanguagesRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/Languages/LanguagesRequestBuilder.cs index d7d58ccf89b..93cca5403f7 100644 --- a/src/generated/Identity/B2xUserFlows/Item/Languages/LanguagesRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/Languages/LanguagesRequestBuilder.cs @@ -32,20 +32,24 @@ public List BuildCommand() { return commands; } /// - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows."; + command.Description = "The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,32 +62,53 @@ public Command BuildCreateCommand() { return command; } /// - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows."; + command.Description = "The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,7 +134,7 @@ public LanguagesRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// Request headers /// Request options /// Request query parameters @@ -130,7 +155,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// /// Request headers /// Request options @@ -148,7 +173,7 @@ public RequestInformation CreatePostRequestInformation(UserFlowLanguageConfigura return requestInfo; } /// - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -160,7 +185,7 @@ public async Task GetAsync(Action q = def return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -172,7 +197,7 @@ public async Task PostAsync(UserFlowLanguageConfi var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/GetOrder/GetOrderRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/GetOrder/GetOrderRequestBuilder.cs index d29724511c7..153e5879401 100644 --- a/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/GetOrder/GetOrderRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/GetOrder/GetOrderRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOrder"; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/Item/IdentityUserFlowAttributeAssignmentRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/Item/IdentityUserFlowAttributeAssignmentRequestBuilder.cs index 930f13a7c80..f1bf977425c 100644 --- a/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/Item/IdentityUserFlowAttributeAssignmentRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/Item/IdentityUserFlowAttributeAssignmentRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user attribute assignments included in the user flow."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--identityuserflowattributeassignment-id", description: "key: id of identityUserFlowAttributeAssignment")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var identityUserFlowAttributeAssignmentIdOption = new Option("--identityuserflowattributeassignment-id", description: "key: id of identityUserFlowAttributeAssignment"); + identityUserFlowAttributeAssignmentIdOption.IsRequired = true; + command.AddOption(identityUserFlowAttributeAssignmentIdOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, identityUserFlowAttributeAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(identityUserFlowAttributeAssignmentId)) requestInfo.PathParameters.Add("identityUserFlowAttributeAssignment_id", identityUserFlowAttributeAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user attribute assignments included in the user flow."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--identityuserflowattributeassignment-id", description: "key: id of identityUserFlowAttributeAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, identityUserFlowAttributeAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(identityUserFlowAttributeAssignmentId)) requestInfo.PathParameters.Add("identityUserFlowAttributeAssignment_id", identityUserFlowAttributeAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var identityUserFlowAttributeAssignmentIdOption = new Option("--identityuserflowattributeassignment-id", description: "key: id of identityUserFlowAttributeAssignment"); + identityUserFlowAttributeAssignmentIdOption.IsRequired = true; + command.AddOption(identityUserFlowAttributeAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, identityUserFlowAttributeAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user attribute assignments included in the user flow."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--identityuserflowattributeassignment-id", description: "key: id of identityUserFlowAttributeAssignment")); - command.AddOption(new Option("--body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var identityUserFlowAttributeAssignmentIdOption = new Option("--identityuserflowattributeassignment-id", description: "key: id of identityUserFlowAttributeAssignment"); + identityUserFlowAttributeAssignmentIdOption.IsRequired = true; + command.AddOption(identityUserFlowAttributeAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, identityUserFlowAttributeAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(identityUserFlowAttributeAssignmentId)) requestInfo.PathParameters.Add("identityUserFlowAttributeAssignment_id", identityUserFlowAttributeAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/Item/UserAttribute/@Ref/RefRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/Item/UserAttribute/@Ref/RefRequestBuilder.cs index d83739bcf2c..6e64e03f3d6 100644 --- a/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/Item/UserAttribute/@Ref/RefRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/Item/UserAttribute/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user attribute that you want to add to your user flow."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--identityuserflowattributeassignment-id", description: "key: id of identityUserFlowAttributeAssignment")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var identityUserFlowAttributeAssignmentIdOption = new Option("--identityuserflowattributeassignment-id", description: "key: id of identityUserFlowAttributeAssignment"); + identityUserFlowAttributeAssignmentIdOption.IsRequired = true; + command.AddOption(identityUserFlowAttributeAssignmentIdOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, identityUserFlowAttributeAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(identityUserFlowAttributeAssignmentId)) requestInfo.PathParameters.Add("identityUserFlowAttributeAssignment_id", identityUserFlowAttributeAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user attribute that you want to add to your user flow."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--identityuserflowattributeassignment-id", description: "key: id of identityUserFlowAttributeAssignment")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var identityUserFlowAttributeAssignmentIdOption = new Option("--identityuserflowattributeassignment-id", description: "key: id of identityUserFlowAttributeAssignment"); + identityUserFlowAttributeAssignmentIdOption.IsRequired = true; + command.AddOption(identityUserFlowAttributeAssignmentIdOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, identityUserFlowAttributeAssignmentId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(identityUserFlowAttributeAssignmentId)) requestInfo.PathParameters.Add("identityUserFlowAttributeAssignment_id", identityUserFlowAttributeAssignmentId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The user attribute that you want to add to your user flow."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--identityuserflowattributeassignment-id", description: "key: id of identityUserFlowAttributeAssignment")); - command.AddOption(new Option("--body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var identityUserFlowAttributeAssignmentIdOption = new Option("--identityuserflowattributeassignment-id", description: "key: id of identityUserFlowAttributeAssignment"); + identityUserFlowAttributeAssignmentIdOption.IsRequired = true; + command.AddOption(identityUserFlowAttributeAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, identityUserFlowAttributeAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(identityUserFlowAttributeAssignmentId)) requestInfo.PathParameters.Add("identityUserFlowAttributeAssignment_id", identityUserFlowAttributeAssignmentId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/Item/UserAttribute/UserAttributeRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/Item/UserAttribute/UserAttributeRequestBuilder.cs index 951ddb002ed..db1ca4b9624 100644 --- a/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/Item/UserAttribute/UserAttributeRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/Item/UserAttribute/UserAttributeRequestBuilder.cs @@ -27,16 +27,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user attribute that you want to add to your user flow."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--identityuserflowattributeassignment-id", description: "key: id of identityUserFlowAttributeAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, identityUserFlowAttributeAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - if (!String.IsNullOrEmpty(identityUserFlowAttributeAssignmentId)) requestInfo.PathParameters.Add("identityUserFlowAttributeAssignment_id", identityUserFlowAttributeAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var identityUserFlowAttributeAssignmentIdOption = new Option("--identityuserflowattributeassignment-id", description: "key: id of identityUserFlowAttributeAssignment"); + identityUserFlowAttributeAssignmentIdOption.IsRequired = true; + command.AddOption(identityUserFlowAttributeAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, identityUserFlowAttributeAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/SetOrder/SetOrderRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/SetOrder/SetOrderRequestBuilder.cs index b566abf89cd..48299396283 100644 --- a/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/SetOrder/SetOrderRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/SetOrder/SetOrderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setOrder"; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/UserAttributeAssignmentsRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/UserAttributeAssignmentsRequestBuilder.cs index a465811b130..d3e8b29e4ef 100644 --- a/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/UserAttributeAssignmentsRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/UserAttributeAssignments/UserAttributeAssignmentsRequestBuilder.cs @@ -39,14 +39,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The user attribute assignments included in the user flow."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,26 +69,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The user attribute assignments included in the user flow."; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/B2xUserFlows/Item/UserFlowIdentityProviders/@Ref/RefRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/UserFlowIdentityProviders/@Ref/RefRequestBuilder.cs index 40d4ba2e845..41e824ce3e4 100644 --- a/src/generated/Identity/B2xUserFlows/Item/UserFlowIdentityProviders/@Ref/RefRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/UserFlowIdentityProviders/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of userFlowIdentityProviders from identity"; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Create new navigation property ref to userFlowIdentityProviders for identity"; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--body")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/B2xUserFlows/Item/UserFlowIdentityProviders/AvailableProviderTypes/AvailableProviderTypesRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/UserFlowIdentityProviders/AvailableProviderTypes/AvailableProviderTypesRequestBuilder.cs index caecb0c118c..2d112b83121 100644 --- a/src/generated/Identity/B2xUserFlows/Item/UserFlowIdentityProviders/AvailableProviderTypes/AvailableProviderTypesRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/UserFlowIdentityProviders/AvailableProviderTypes/AvailableProviderTypesRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function availableProviderTypes"; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/B2xUserFlows/Item/UserFlowIdentityProviders/UserFlowIdentityProvidersRequestBuilder.cs b/src/generated/Identity/B2xUserFlows/Item/UserFlowIdentityProviders/UserFlowIdentityProvidersRequestBuilder.cs index 1a1d7072c69..312d41d6a56 100644 --- a/src/generated/Identity/B2xUserFlows/Item/UserFlowIdentityProviders/UserFlowIdentityProvidersRequestBuilder.cs +++ b/src/generated/Identity/B2xUserFlows/Item/UserFlowIdentityProviders/UserFlowIdentityProvidersRequestBuilder.cs @@ -33,26 +33,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get userFlowIdentityProviders from identity"; // Create options for all the parameters - command.AddOption(new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(b2xIdentityUserFlowId)) requestInfo.PathParameters.Add("b2xIdentityUserFlow_id", b2xIdentityUserFlowId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var b2xIdentityUserFlowIdOption = new Option("--b2xidentityuserflow-id", description: "key: id of b2xIdentityUserFlow"); + b2xIdentityUserFlowIdOption.IsRequired = true; + command.AddOption(b2xIdentityUserFlowIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (b2xIdentityUserFlowId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/ConditionalAccess/ConditionalAccessRequestBuilder.cs b/src/generated/Identity/ConditionalAccess/ConditionalAccessRequestBuilder.cs index ff8300da18e..434b9b9835d 100644 --- a/src/generated/Identity/ConditionalAccess/ConditionalAccessRequestBuilder.cs +++ b/src/generated/Identity/ConditionalAccess/ConditionalAccessRequestBuilder.cs @@ -29,7 +29,8 @@ public Command BuildDeleteCommand() { command.Description = "the entry point for the Conditional Access (CA) object model."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,12 +44,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "the entry point for the Conditional Access (CA) object model."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,12 +82,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "the entry point for the Conditional Access (CA) object model."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Identity/ConditionalAccess/NamedLocations/Item/NamedLocationRequestBuilder.cs b/src/generated/Identity/ConditionalAccess/NamedLocations/Item/NamedLocationRequestBuilder.cs index 36f468d9a46..c58b5a16721 100644 --- a/src/generated/Identity/ConditionalAccess/NamedLocations/Item/NamedLocationRequestBuilder.cs +++ b/src/generated/Identity/ConditionalAccess/NamedLocations/Item/NamedLocationRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Returns a collection of the specified named locations."; // Create options for all the parameters - command.AddOption(new Option("--namedlocation-id", description: "key: id of namedLocation")); + var namedLocationIdOption = new Option("--namedlocation-id", description: "key: id of namedLocation"); + namedLocationIdOption.IsRequired = true; + command.AddOption(namedLocationIdOption); command.Handler = CommandHandler.Create(async (namedLocationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(namedLocationId)) requestInfo.PathParameters.Add("namedLocation_id", namedLocationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Returns a collection of the specified named locations."; // Create options for all the parameters - command.AddOption(new Option("--namedlocation-id", description: "key: id of namedLocation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (namedLocationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(namedLocationId)) requestInfo.PathParameters.Add("namedLocation_id", namedLocationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var namedLocationIdOption = new Option("--namedlocation-id", description: "key: id of namedLocation"); + namedLocationIdOption.IsRequired = true; + command.AddOption(namedLocationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (namedLocationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Returns a collection of the specified named locations."; // Create options for all the parameters - command.AddOption(new Option("--namedlocation-id", description: "key: id of namedLocation")); - command.AddOption(new Option("--body")); + var namedLocationIdOption = new Option("--namedlocation-id", description: "key: id of namedLocation"); + namedLocationIdOption.IsRequired = true; + command.AddOption(namedLocationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (namedLocationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(namedLocationId)) requestInfo.PathParameters.Add("namedLocation_id", namedLocationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Identity/ConditionalAccess/NamedLocations/NamedLocationsRequestBuilder.cs b/src/generated/Identity/ConditionalAccess/NamedLocations/NamedLocationsRequestBuilder.cs index 47da9d8518e..24c73dca5e6 100644 --- a/src/generated/Identity/ConditionalAccess/NamedLocations/NamedLocationsRequestBuilder.cs +++ b/src/generated/Identity/ConditionalAccess/NamedLocations/NamedLocationsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable. Returns a collection of the specified named locations."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable. Returns a collection of the specified named locations."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/ConditionalAccess/Policies/Item/ConditionalAccessPolicyRequestBuilder.cs b/src/generated/Identity/ConditionalAccess/Policies/Item/ConditionalAccessPolicyRequestBuilder.cs index c6ebbb0e98f..281ccb112b5 100644 --- a/src/generated/Identity/ConditionalAccess/Policies/Item/ConditionalAccessPolicyRequestBuilder.cs +++ b/src/generated/Identity/ConditionalAccess/Policies/Item/ConditionalAccessPolicyRequestBuilder.cs @@ -20,16 +20,18 @@ public class ConditionalAccessPolicyRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies."; + command.Description = "Read-only. Nullable. Returns a collection of the specified Conditional Access policies."; // Create options for all the parameters - command.AddOption(new Option("--conditionalaccesspolicy-id", description: "key: id of conditionalAccessPolicy")); + var conditionalAccessPolicyIdOption = new Option("--conditionalaccesspolicy-id", description: "key: id of conditionalAccessPolicy"); + conditionalAccessPolicyIdOption.IsRequired = true; + command.AddOption(conditionalAccessPolicyIdOption); command.Handler = CommandHandler.Create(async (conditionalAccessPolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(conditionalAccessPolicyId)) requestInfo.PathParameters.Add("conditionalAccessPolicy_id", conditionalAccessPolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -37,20 +39,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies."; + command.Description = "Read-only. Nullable. Returns a collection of the specified Conditional Access policies."; // Create options for all the parameters - command.AddOption(new Option("--conditionalaccesspolicy-id", description: "key: id of conditionalAccessPolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (conditionalAccessPolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(conditionalAccessPolicyId)) requestInfo.PathParameters.Add("conditionalAccessPolicy_id", conditionalAccessPolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var conditionalAccessPolicyIdOption = new Option("--conditionalaccesspolicy-id", description: "key: id of conditionalAccessPolicy"); + conditionalAccessPolicyIdOption.IsRequired = true; + command.AddOption(conditionalAccessPolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (conditionalAccessPolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,20 +73,24 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies."; + command.Description = "Read-only. Nullable. Returns a collection of the specified Conditional Access policies."; // Create options for all the parameters - command.AddOption(new Option("--conditionalaccesspolicy-id", description: "key: id of conditionalAccessPolicy")); - command.AddOption(new Option("--body")); + var conditionalAccessPolicyIdOption = new Option("--conditionalaccesspolicy-id", description: "key: id of conditionalAccessPolicy"); + conditionalAccessPolicyIdOption.IsRequired = true; + command.AddOption(conditionalAccessPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (conditionalAccessPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(conditionalAccessPolicyId)) requestInfo.PathParameters.Add("conditionalAccessPolicy_id", conditionalAccessPolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -97,7 +111,7 @@ public ConditionalAccessPolicyRequestBuilder(Dictionary pathPara RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// Request headers /// Request options /// @@ -112,7 +126,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// Request headers /// Request options /// Request query parameters @@ -133,7 +147,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// /// Request headers /// Request options @@ -151,7 +165,7 @@ public RequestInformation CreatePatchRequestInformation(ConditionalAccessPolicy return requestInfo; } /// - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +176,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +188,7 @@ public async Task GetAsync(Action q return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -186,7 +200,7 @@ public async Task PatchAsync(ConditionalAccessPolicy model, ActionRead-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Identity/ConditionalAccess/Policies/PoliciesRequestBuilder.cs b/src/generated/Identity/ConditionalAccess/Policies/PoliciesRequestBuilder.cs index 365964cb66b..5c340cf1f23 100644 --- a/src/generated/Identity/ConditionalAccess/Policies/PoliciesRequestBuilder.cs +++ b/src/generated/Identity/ConditionalAccess/Policies/PoliciesRequestBuilder.cs @@ -30,18 +30,21 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies."; + command.Description = "Read-only. Nullable. Returns a collection of the specified Conditional Access policies."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -54,30 +57,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies."; + command.Description = "Read-only. Nullable. Returns a collection of the specified Conditional Access policies."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -103,7 +126,7 @@ public PoliciesRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// Request headers /// Request options /// Request query parameters @@ -124,7 +147,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// /// Request headers /// Request options @@ -142,7 +165,7 @@ public RequestInformation CreatePostRequestInformation(ConditionalAccessPolicy b return requestInfo; } /// - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -154,7 +177,7 @@ public async Task GetAsync(Action q = defa return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -166,7 +189,7 @@ public async Task PostAsync(ConditionalAccessPolicy mod var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Identity/IdentityProviders/AvailableProviderTypes/AvailableProviderTypesRequestBuilder.cs b/src/generated/Identity/IdentityProviders/AvailableProviderTypes/AvailableProviderTypesRequestBuilder.cs index 1f3a02bec93..85ad77c8b65 100644 --- a/src/generated/Identity/IdentityProviders/AvailableProviderTypes/AvailableProviderTypesRequestBuilder.cs +++ b/src/generated/Identity/IdentityProviders/AvailableProviderTypes/AvailableProviderTypesRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function availableProviderTypes"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/IdentityProviders/IdentityProvidersRequestBuilder.cs b/src/generated/Identity/IdentityProviders/IdentityProvidersRequestBuilder.cs index d3629877ac9..886d6cef5bf 100644 --- a/src/generated/Identity/IdentityProviders/IdentityProvidersRequestBuilder.cs +++ b/src/generated/Identity/IdentityProviders/IdentityProvidersRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents entry point for identity provider base."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,24 +70,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents entry point for identity provider base."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Identity/IdentityProviders/Item/IdentityProviderBaseRequestBuilder.cs b/src/generated/Identity/IdentityProviders/Item/IdentityProviderBaseRequestBuilder.cs index 1bcf7aaeedb..e857e03f5cb 100644 --- a/src/generated/Identity/IdentityProviders/Item/IdentityProviderBaseRequestBuilder.cs +++ b/src/generated/Identity/IdentityProviders/Item/IdentityProviderBaseRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents entry point for identity provider base."; // Create options for all the parameters - command.AddOption(new Option("--identityproviderbase-id", description: "key: id of identityProviderBase")); + var identityProviderBaseIdOption = new Option("--identityproviderbase-id", description: "key: id of identityProviderBase"); + identityProviderBaseIdOption.IsRequired = true; + command.AddOption(identityProviderBaseIdOption); command.Handler = CommandHandler.Create(async (identityProviderBaseId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(identityProviderBaseId)) requestInfo.PathParameters.Add("identityProviderBase_id", identityProviderBaseId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents entry point for identity provider base."; // Create options for all the parameters - command.AddOption(new Option("--identityproviderbase-id", description: "key: id of identityProviderBase")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (identityProviderBaseId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(identityProviderBaseId)) requestInfo.PathParameters.Add("identityProviderBase_id", identityProviderBaseId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var identityProviderBaseIdOption = new Option("--identityproviderbase-id", description: "key: id of identityProviderBase"); + identityProviderBaseIdOption.IsRequired = true; + command.AddOption(identityProviderBaseIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (identityProviderBaseId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents entry point for identity provider base."; // Create options for all the parameters - command.AddOption(new Option("--identityproviderbase-id", description: "key: id of identityProviderBase")); - command.AddOption(new Option("--body")); + var identityProviderBaseIdOption = new Option("--identityproviderbase-id", description: "key: id of identityProviderBase"); + identityProviderBaseIdOption.IsRequired = true; + command.AddOption(identityProviderBaseIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (identityProviderBaseId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(identityProviderBaseId)) requestInfo.PathParameters.Add("identityProviderBase_id", identityProviderBaseId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Identity/IdentityRequestBuilder.cs b/src/generated/Identity/IdentityRequestBuilder.cs index eba708e72e1..f2533d125f4 100644 --- a/src/generated/Identity/IdentityRequestBuilder.cs +++ b/src/generated/Identity/IdentityRequestBuilder.cs @@ -55,12 +55,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get identity"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,12 +93,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update identity"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Identity/UserFlowAttributes/Item/IdentityUserFlowAttributeRequestBuilder.cs b/src/generated/Identity/UserFlowAttributes/Item/IdentityUserFlowAttributeRequestBuilder.cs index 8c894c7fc93..83c15a95b6c 100644 --- a/src/generated/Identity/UserFlowAttributes/Item/IdentityUserFlowAttributeRequestBuilder.cs +++ b/src/generated/Identity/UserFlowAttributes/Item/IdentityUserFlowAttributeRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents entry point for identity userflow attributes."; // Create options for all the parameters - command.AddOption(new Option("--identityuserflowattribute-id", description: "key: id of identityUserFlowAttribute")); + var identityUserFlowAttributeIdOption = new Option("--identityuserflowattribute-id", description: "key: id of identityUserFlowAttribute"); + identityUserFlowAttributeIdOption.IsRequired = true; + command.AddOption(identityUserFlowAttributeIdOption); command.Handler = CommandHandler.Create(async (identityUserFlowAttributeId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(identityUserFlowAttributeId)) requestInfo.PathParameters.Add("identityUserFlowAttribute_id", identityUserFlowAttributeId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents entry point for identity userflow attributes."; // Create options for all the parameters - command.AddOption(new Option("--identityuserflowattribute-id", description: "key: id of identityUserFlowAttribute")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (identityUserFlowAttributeId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(identityUserFlowAttributeId)) requestInfo.PathParameters.Add("identityUserFlowAttribute_id", identityUserFlowAttributeId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var identityUserFlowAttributeIdOption = new Option("--identityuserflowattribute-id", description: "key: id of identityUserFlowAttribute"); + identityUserFlowAttributeIdOption.IsRequired = true; + command.AddOption(identityUserFlowAttributeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (identityUserFlowAttributeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents entry point for identity userflow attributes."; // Create options for all the parameters - command.AddOption(new Option("--identityuserflowattribute-id", description: "key: id of identityUserFlowAttribute")); - command.AddOption(new Option("--body")); + var identityUserFlowAttributeIdOption = new Option("--identityuserflowattribute-id", description: "key: id of identityUserFlowAttribute"); + identityUserFlowAttributeIdOption.IsRequired = true; + command.AddOption(identityUserFlowAttributeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (identityUserFlowAttributeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(identityUserFlowAttributeId)) requestInfo.PathParameters.Add("identityUserFlowAttribute_id", identityUserFlowAttributeId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Identity/UserFlowAttributes/UserFlowAttributesRequestBuilder.cs b/src/generated/Identity/UserFlowAttributes/UserFlowAttributesRequestBuilder.cs index 3dcc440c080..95bf7c73990 100644 --- a/src/generated/Identity/UserFlowAttributes/UserFlowAttributesRequestBuilder.cs +++ b/src/generated/Identity/UserFlowAttributes/UserFlowAttributesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents entry point for identity userflow attributes."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents entry point for identity userflow attributes."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/AccessReviews/AccessReviewsRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/AccessReviewsRequestBuilder.cs index 30624818d4d..da820c7a07b 100644 --- a/src/generated/IdentityGovernance/AccessReviews/AccessReviewsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/AccessReviewsRequestBuilder.cs @@ -35,7 +35,8 @@ public Command BuildDeleteCommand() { command.Description = "Delete navigation property accessReviews for identityGovernance"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,12 +50,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get accessReviews from identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,12 +81,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property accessReviews in identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/DefinitionsRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/DefinitionsRequestBuilder.cs index d4360cf6179..fa474ba0e5e 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/DefinitionsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/DefinitionsRequestBuilder.cs @@ -33,18 +33,21 @@ public List BuildCommand() { return commands; } /// - /// Create new navigation property to definitions for identityGovernance + /// Represents the template and scheduling for an access review. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create new navigation property to definitions for identityGovernance"; + command.Description = "Represents the template and scheduling for an access review."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,30 +60,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Get definitions from identityGovernance + /// Represents the template and scheduling for an access review. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Get definitions from identityGovernance"; + command.Description = "Represents the template and scheduling for an access review."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -106,7 +129,7 @@ public DefinitionsRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// Get definitions from identityGovernance + /// Represents the template and scheduling for an access review. /// Request headers /// Request options /// Request query parameters @@ -127,7 +150,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Create new navigation property to definitions for identityGovernance + /// Represents the template and scheduling for an access review. /// /// Request headers /// Request options @@ -153,7 +176,7 @@ public FilterByCurrentUserWithOnRequestBuilder FilterByCurrentUserWithOn(string return new FilterByCurrentUserWithOnRequestBuilder(PathParameters, RequestAdapter, on); } /// - /// Get definitions from identityGovernance + /// Represents the template and scheduling for an access review. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -165,7 +188,7 @@ public async Task GetAsync(Action q = d return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Create new navigation property to definitions for identityGovernance + /// Represents the template and scheduling for an access review. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -177,7 +200,7 @@ public async Task PostAsync(AccessReviewSchedule var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Get definitions from identityGovernance + /// Represents the template and scheduling for an access review. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs index 7fe888f154c..d3b84491f95 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function filterByCurrentUser"; // Create options for all the parameters - command.AddOption(new Option("--on", description: "Usage: on={on}")); - command.Handler = CommandHandler.Create(async (on) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(on)) requestInfo.PathParameters.Add("on", on); + var onOption = new Option("--on", description: "Usage: on={on}"); + onOption.IsRequired = true; + command.AddOption(onOption); + command.Handler = CommandHandler.Create(async (on) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/AccessReviewScheduleDefinitionRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/AccessReviewScheduleDefinitionRequestBuilder.cs index edfcc65238e..064267f83ef 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/AccessReviewScheduleDefinitionRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/AccessReviewScheduleDefinitionRequestBuilder.cs @@ -22,16 +22,18 @@ public class AccessReviewScheduleDefinitionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Delete navigation property definitions for identityGovernance + /// Represents the template and scheduling for an access review. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete navigation property definitions for identityGovernance"; + command.Description = "Represents the template and scheduling for an access review."; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,20 +41,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Get definitions from identityGovernance + /// Represents the template and scheduling for an access review. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get definitions from identityGovernance"; + command.Description = "Represents the template and scheduling for an access review."; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,20 +82,24 @@ public Command BuildInstancesCommand() { return command; } /// - /// Update the navigation property definitions in identityGovernance + /// Represents the template and scheduling for an access review. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the navigation property definitions in identityGovernance"; + command.Description = "Represents the template and scheduling for an access review."; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--body")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -112,7 +126,7 @@ public AccessReviewScheduleDefinitionRequestBuilder(Dictionary p RequestAdapter = requestAdapter; } /// - /// Delete navigation property definitions for identityGovernance + /// Represents the template and scheduling for an access review. /// Request headers /// Request options /// @@ -127,7 +141,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get definitions from identityGovernance + /// Represents the template and scheduling for an access review. /// Request headers /// Request options /// Request query parameters @@ -148,7 +162,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Update the navigation property definitions in identityGovernance + /// Represents the template and scheduling for an access review. /// /// Request headers /// Request options @@ -166,7 +180,7 @@ public RequestInformation CreatePatchRequestInformation(AccessReviewScheduleDefi return requestInfo; } /// - /// Delete navigation property definitions for identityGovernance + /// Represents the template and scheduling for an access review. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -177,7 +191,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get definitions from identityGovernance + /// Represents the template and scheduling for an access review. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -189,7 +203,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } /// - /// Update the navigation property definitions in identityGovernance + /// Represents the template and scheduling for an access review. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -201,7 +215,7 @@ public async Task PatchAsync(AccessReviewScheduleDefinition model, ActionGet definitions from identityGovernance + /// Represents the template and scheduling for an access review. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs index bc2c70b705c..1e2f5e4e159 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function filterByCurrentUser"; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--on", description: "Usage: on={on}")); - command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, on) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(on)) requestInfo.PathParameters.Add("on", on); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var onOption = new Option("--on", description: "Usage: on={on}"); + onOption.IsRequired = true; + command.AddOption(onOption); + command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, on) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/InstancesRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/InstancesRequestBuilder.cs index 61bc70c8039..92c15722457 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/InstancesRequestBuilder.cs @@ -27,6 +27,7 @@ public List BuildCommand() { builder.BuildAcceptRecommendationsCommand(), builder.BuildApplyDecisionsCommand(), builder.BuildBatchRecordDecisionsCommand(), + builder.BuildContactedReviewersCommand(), builder.BuildDecisionsCommand(), builder.BuildDeleteCommand(), builder.BuildGetCommand(), @@ -38,20 +39,24 @@ public List BuildCommand() { return commands; } /// - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence."; + command.Description = "Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence."; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--body")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,32 +69,53 @@ public Command BuildCreateCommand() { return command; } /// - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence."; + command.Description = "Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence."; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -115,7 +141,7 @@ public InstancesRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// Request headers /// Request options /// Request query parameters @@ -136,7 +162,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// /// Request headers /// Request options @@ -162,7 +188,7 @@ public FilterByCurrentUserWithOnRequestBuilder FilterByCurrentUserWithOn(string return new FilterByCurrentUserWithOnRequestBuilder(PathParameters, RequestAdapter, on); } /// - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +200,7 @@ public async Task GetAsync(Action q = def return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -186,7 +212,7 @@ public async Task PostAsync(AccessReviewInstance model, Ac var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/AcceptRecommendations/AcceptRecommendationsRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/AcceptRecommendations/AcceptRecommendationsRequestBuilder.cs index b200a0ea788..bb56706f985 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/AcceptRecommendations/AcceptRecommendationsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/AcceptRecommendations/AcceptRecommendationsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action acceptRecommendations"; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/AccessReviewInstanceRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/AccessReviewInstanceRequestBuilder.cs index 8fd4c4dbd1f..a9223132e4e 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/AccessReviewInstanceRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/AccessReviewInstanceRequestBuilder.cs @@ -1,6 +1,7 @@ using ApiSdk.IdentityGovernance.AccessReviews.Definitions.Item.Instances.Item.AcceptRecommendations; using ApiSdk.IdentityGovernance.AccessReviews.Definitions.Item.Instances.Item.ApplyDecisions; using ApiSdk.IdentityGovernance.AccessReviews.Definitions.Item.Instances.Item.BatchRecordDecisions; +using ApiSdk.IdentityGovernance.AccessReviews.Definitions.Item.Instances.Item.ContactedReviewers; using ApiSdk.IdentityGovernance.AccessReviews.Definitions.Item.Instances.Item.Decisions; using ApiSdk.IdentityGovernance.AccessReviews.Definitions.Item.Instances.Item.ResetDecisions; using ApiSdk.IdentityGovernance.AccessReviews.Definitions.Item.Instances.Item.SendReminder; @@ -44,6 +45,13 @@ public Command BuildBatchRecordDecisionsCommand() { command.AddCommand(builder.BuildPostCommand()); return command; } + public Command BuildContactedReviewersCommand() { + var command = new Command("contacted-reviewers"); + var builder = new ApiSdk.IdentityGovernance.AccessReviews.Definitions.Item.Instances.Item.ContactedReviewers.ContactedReviewersRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } public Command BuildDecisionsCommand() { var command = new Command("decisions"); var builder = new ApiSdk.IdentityGovernance.AccessReviews.Definitions.Item.Instances.Item.Decisions.DecisionsRequestBuilder(PathParameters, RequestAdapter); @@ -52,18 +60,21 @@ public Command BuildDecisionsCommand() { return command; } /// - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence."; + command.Description = "Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence."; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -71,22 +82,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence."; + command.Description = "Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence."; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,22 +119,27 @@ public Command BuildGetCommand() { return command; } /// - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence."; + command.Description = "Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence."; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); - command.AddOption(new Option("--body")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -153,7 +178,7 @@ public AccessReviewInstanceRequestBuilder(Dictionary pathParamet RequestAdapter = requestAdapter; } /// - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// Request headers /// Request options /// @@ -168,7 +193,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// Request headers /// Request options /// Request query parameters @@ -189,7 +214,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// /// Request headers /// Request options @@ -207,7 +232,7 @@ public RequestInformation CreatePatchRequestInformation(AccessReviewInstance bod return requestInfo; } /// - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -218,7 +243,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -230,7 +255,7 @@ public async Task GetAsync(Action q = return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -242,7 +267,7 @@ public async Task PatchAsync(AccessReviewInstance model, ActionIf the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ApplyDecisions/ApplyDecisionsRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ApplyDecisions/ApplyDecisionsRequestBuilder.cs index d30cb25041c..bca789849ed 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ApplyDecisions/ApplyDecisionsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ApplyDecisions/ApplyDecisionsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyDecisions"; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/BatchRecordDecisions/BatchRecordDecisionsRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/BatchRecordDecisions/BatchRecordDecisionsRequestBuilder.cs index 9b47bee3559..2f65a71dbd5 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/BatchRecordDecisions/BatchRecordDecisionsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/BatchRecordDecisions/BatchRecordDecisionsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action batchRecordDecisions"; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); - command.AddOption(new Option("--body")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ContactedReviewers/ContactedReviewersRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ContactedReviewers/ContactedReviewersRequestBuilder.cs new file mode 100644 index 00000000000..d7554078e8e --- /dev/null +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ContactedReviewers/ContactedReviewersRequestBuilder.cs @@ -0,0 +1,224 @@ +using ApiSdk.IdentityGovernance.AccessReviews.Definitions.Item.Instances.Item.ContactedReviewers.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.IdentityGovernance.AccessReviews.Definitions.Item.Instances.Item.ContactedReviewers { + /// Builds and executes requests for operations under \identityGovernance\accessReviews\definitions\{accessReviewScheduleDefinition-id}\instances\{accessReviewInstance-id}\contactedReviewers + public class ContactedReviewersRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new AccessReviewReviewerRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only."; + // Create options for all the parameters + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only."; + // Create options for all the parameters + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new ContactedReviewersRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public ContactedReviewersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/identityGovernance/accessReviews/definitions/{accessReviewScheduleDefinition_id}/instances/{accessReviewInstance_id}/contactedReviewers{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(AccessReviewReviewer body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(AccessReviewReviewer model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ContactedReviewers/ContactedReviewersResponse.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ContactedReviewers/ContactedReviewersResponse.cs new file mode 100644 index 00000000000..64c3a2dc13b --- /dev/null +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ContactedReviewers/ContactedReviewersResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.IdentityGovernance.AccessReviews.Definitions.Item.Instances.Item.ContactedReviewers { + public class ContactedReviewersResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new contactedReviewersResponse and sets the default values. + /// + public ContactedReviewersResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as ContactedReviewersResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as ContactedReviewersResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ContactedReviewers/Item/AccessReviewReviewerRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ContactedReviewers/Item/AccessReviewReviewerRequestBuilder.cs new file mode 100644 index 00000000000..5ce258c5d39 --- /dev/null +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ContactedReviewers/Item/AccessReviewReviewerRequestBuilder.cs @@ -0,0 +1,229 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.IdentityGovernance.AccessReviews.Definitions.Item.Instances.Item.ContactedReviewers.Item { + /// Builds and executes requests for operations under \identityGovernance\accessReviews\definitions\{accessReviewScheduleDefinition-id}\instances\{accessReviewInstance-id}\contactedReviewers\{accessReviewReviewer-id} + public class AccessReviewReviewerRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only."; + // Create options for all the parameters + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); + var accessReviewReviewerIdOption = new Option("--accessreviewreviewer-id", description: "key: id of accessReviewReviewer"); + accessReviewReviewerIdOption.IsRequired = true; + command.AddOption(accessReviewReviewerIdOption); + command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, accessReviewReviewerId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only."; + // Create options for all the parameters + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); + var accessReviewReviewerIdOption = new Option("--accessreviewreviewer-id", description: "key: id of accessReviewReviewer"); + accessReviewReviewerIdOption.IsRequired = true; + command.AddOption(accessReviewReviewerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, accessReviewReviewerId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only."; + // Create options for all the parameters + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); + var accessReviewReviewerIdOption = new Option("--accessreviewreviewer-id", description: "key: id of accessReviewReviewer"); + accessReviewReviewerIdOption.IsRequired = true; + command.AddOption(accessReviewReviewerIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, accessReviewReviewerId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new AccessReviewReviewerRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AccessReviewReviewerRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/identityGovernance/accessReviews/definitions/{accessReviewScheduleDefinition_id}/instances/{accessReviewInstance_id}/contactedReviewers/{accessReviewReviewer_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(AccessReviewReviewer body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(AccessReviewReviewer model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Decisions/DecisionsRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Decisions/DecisionsRequestBuilder.cs index 74b08010008..65569009e27 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Decisions/DecisionsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Decisions/DecisionsRequestBuilder.cs @@ -31,22 +31,27 @@ public List BuildCommand() { return commands; } /// - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed."; + command.Description = "Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed."; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); - command.AddOption(new Option("--body")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,34 +64,56 @@ public Command BuildCreateCommand() { return command; } /// - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed."; + command.Description = "Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed."; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,7 +139,7 @@ public DecisionsRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// Request headers /// Request options /// Request query parameters @@ -133,7 +160,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// /// Request headers /// Request options @@ -159,7 +186,7 @@ public FilterByCurrentUserWithOnRequestBuilder FilterByCurrentUserWithOn(string return new FilterByCurrentUserWithOnRequestBuilder(PathParameters, RequestAdapter, on); } /// - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -171,7 +198,7 @@ public async Task GetAsync(Action q = def return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -183,7 +210,7 @@ public async Task PostAsync(AccessReviewInstan var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Decisions/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Decisions/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs index 8f9053ba859..5368dd789e0 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Decisions/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Decisions/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function filterByCurrentUser"; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); - command.AddOption(new Option("--on", description: "Usage: on={on}")); - command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, on) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); - if (!String.IsNullOrEmpty(on)) requestInfo.PathParameters.Add("on", on); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); + var onOption = new Option("--on", description: "Usage: on={on}"); + onOption.IsRequired = true; + command.AddOption(onOption); + command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, on) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Decisions/Item/AccessReviewInstanceDecisionItemRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Decisions/Item/AccessReviewInstanceDecisionItemRequestBuilder.cs index ffa1172dc69..40d9253f324 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Decisions/Item/AccessReviewInstanceDecisionItemRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Decisions/Item/AccessReviewInstanceDecisionItemRequestBuilder.cs @@ -20,20 +20,24 @@ public class AccessReviewInstanceDecisionItemRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed."; + command.Description = "Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed."; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); - command.AddOption(new Option("--accessreviewinstancedecisionitem-id", description: "key: id of accessReviewInstanceDecisionItem")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); + var accessReviewInstanceDecisionItemIdOption = new Option("--accessreviewinstancedecisionitem-id", description: "key: id of accessReviewInstanceDecisionItem"); + accessReviewInstanceDecisionItemIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceDecisionItemIdOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, accessReviewInstanceDecisionItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); - if (!String.IsNullOrEmpty(accessReviewInstanceDecisionItemId)) requestInfo.PathParameters.Add("accessReviewInstanceDecisionItem_id", accessReviewInstanceDecisionItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,24 +45,34 @@ public Command BuildDeleteCommand() { return command; } /// - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed."; + command.Description = "Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed."; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); - command.AddOption(new Option("--accessreviewinstancedecisionitem-id", description: "key: id of accessReviewInstanceDecisionItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, accessReviewInstanceDecisionItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); - if (!String.IsNullOrEmpty(accessReviewInstanceDecisionItemId)) requestInfo.PathParameters.Add("accessReviewInstanceDecisionItem_id", accessReviewInstanceDecisionItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); + var accessReviewInstanceDecisionItemIdOption = new Option("--accessreviewinstancedecisionitem-id", description: "key: id of accessReviewInstanceDecisionItem"); + accessReviewInstanceDecisionItemIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceDecisionItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, accessReviewInstanceDecisionItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,24 +85,30 @@ public Command BuildGetCommand() { return command; } /// - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed."; + command.Description = "Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed."; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); - command.AddOption(new Option("--accessreviewinstancedecisionitem-id", description: "key: id of accessReviewInstanceDecisionItem")); - command.AddOption(new Option("--body")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); + var accessReviewInstanceDecisionItemIdOption = new Option("--accessreviewinstancedecisionitem-id", description: "key: id of accessReviewInstanceDecisionItem"); + accessReviewInstanceDecisionItemIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceDecisionItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId, accessReviewInstanceDecisionItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); - if (!String.IsNullOrEmpty(accessReviewInstanceDecisionItemId)) requestInfo.PathParameters.Add("accessReviewInstanceDecisionItem_id", accessReviewInstanceDecisionItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -109,7 +129,7 @@ public AccessReviewInstanceDecisionItemRequestBuilder(Dictionary RequestAdapter = requestAdapter; } /// - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// Request headers /// Request options /// @@ -124,7 +144,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// Request headers /// Request options /// Request query parameters @@ -145,7 +165,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// /// Request headers /// Request options @@ -163,7 +183,7 @@ public RequestInformation CreatePatchRequestInformation(AccessReviewInstanceDeci return requestInfo; } /// - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +194,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -186,7 +206,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } /// - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -198,7 +218,7 @@ public async Task PatchAsync(AccessReviewInstanceDecisionItem model, ActionEach principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ResetDecisions/ResetDecisionsRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ResetDecisions/ResetDecisionsRequestBuilder.cs index 2e882ea3623..0b773c8b720 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ResetDecisions/ResetDecisionsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/ResetDecisions/ResetDecisionsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action resetDecisions"; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/SendReminder/SendReminderRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/SendReminder/SendReminderRequestBuilder.cs index 3c79d9d213a..89c51e4b683 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/SendReminder/SendReminderRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/SendReminder/SendReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sendReminder"; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Stop/StopRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Stop/StopRequestBuilder.cs index ef75d08a3dd..61896a8745e 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Stop/StopRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Instances/Item/Stop/StopRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action stop"; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); - command.AddOption(new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); + var accessReviewInstanceIdOption = new Option("--accessreviewinstance-id", description: "key: id of accessReviewInstance"); + accessReviewInstanceIdOption.IsRequired = true; + command.AddOption(accessReviewInstanceIdOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId, accessReviewInstanceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); - if (!String.IsNullOrEmpty(accessReviewInstanceId)) requestInfo.PathParameters.Add("accessReviewInstance_id", accessReviewInstanceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Stop/StopRequestBuilder.cs b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Stop/StopRequestBuilder.cs index 1eb4852af4d..4b823c81ca1 100644 --- a/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Stop/StopRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AccessReviews/Definitions/Item/Stop/StopRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action stop"; // Create options for all the parameters - command.AddOption(new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition")); + var accessReviewScheduleDefinitionIdOption = new Option("--accessreviewscheduledefinition-id", description: "key: id of accessReviewScheduleDefinition"); + accessReviewScheduleDefinitionIdOption.IsRequired = true; + command.AddOption(accessReviewScheduleDefinitionIdOption); command.Handler = CommandHandler.Create(async (accessReviewScheduleDefinitionId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(accessReviewScheduleDefinitionId)) requestInfo.PathParameters.Add("accessReviewScheduleDefinition_id", accessReviewScheduleDefinitionId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/AppConsent/AppConsentRequestBuilder.cs b/src/generated/IdentityGovernance/AppConsent/AppConsentRequestBuilder.cs index 10b6111464b..9b0d2452e59 100644 --- a/src/generated/IdentityGovernance/AppConsent/AppConsentRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AppConsent/AppConsentRequestBuilder.cs @@ -35,7 +35,8 @@ public Command BuildDeleteCommand() { command.Description = "Delete navigation property appConsent for identityGovernance"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,12 +50,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get appConsent from identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,12 +81,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property appConsent in identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/AppConsentRequestsRequestBuilder.cs b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/AppConsentRequestsRequestBuilder.cs index 865baa72c34..06246114416 100644 --- a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/AppConsentRequestsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/AppConsentRequestsRequestBuilder.cs @@ -32,18 +32,21 @@ public List BuildCommand() { return commands; } /// - /// Create new navigation property to appConsentRequests for identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create new navigation property to appConsentRequests for identityGovernance"; + command.Description = "A collection of userConsentRequest objects for a specific application."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,30 +59,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Get appConsentRequests from identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Get appConsentRequests from identityGovernance"; + command.Description = "A collection of userConsentRequest objects for a specific application."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -105,7 +128,7 @@ public AppConsentRequestsRequestBuilder(Dictionary pathParameter RequestAdapter = requestAdapter; } /// - /// Get appConsentRequests from identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// Request headers /// Request options /// Request query parameters @@ -126,7 +149,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Create new navigation property to appConsentRequests for identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// /// Request headers /// Request options @@ -152,7 +175,7 @@ public FilterByCurrentUserWithOnRequestBuilder FilterByCurrentUserWithOn(string return new FilterByCurrentUserWithOnRequestBuilder(PathParameters, RequestAdapter, on); } /// - /// Get appConsentRequests from identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -164,7 +187,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } /// - /// Create new navigation property to appConsentRequests for identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -176,7 +199,7 @@ public async Task PostAsync(AppConsentRequest model, Action(requestInfo, responseHandler, cancellationToken); } - /// Get appConsentRequests from identityGovernance + /// A collection of userConsentRequest objects for a specific application. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs index bcbd9203a1c..51730cba74f 100644 --- a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function filterByCurrentUser"; // Create options for all the parameters - command.AddOption(new Option("--on", description: "Usage: on={on}")); - command.Handler = CommandHandler.Create(async (on) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(on)) requestInfo.PathParameters.Add("on", on); + var onOption = new Option("--on", description: "Usage: on={on}"); + onOption.IsRequired = true; + command.AddOption(onOption); + command.Handler = CommandHandler.Create(async (on) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/AppConsentRequestRequestBuilder.cs b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/AppConsentRequestRequestBuilder.cs index ee646cf270f..4f20339637f 100644 --- a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/AppConsentRequestRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/AppConsentRequestRequestBuilder.cs @@ -21,16 +21,18 @@ public class AppConsentRequestRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Delete navigation property appConsentRequests for identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete navigation property appConsentRequests for identityGovernance"; + command.Description = "A collection of userConsentRequest objects for a specific application."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); command.Handler = CommandHandler.Create(async (appConsentRequestId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -38,20 +40,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Get appConsentRequests from identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get appConsentRequests from identityGovernance"; + command.Description = "A collection of userConsentRequest objects for a specific application."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (appConsentRequestId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (appConsentRequestId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,20 +74,24 @@ public Command BuildGetCommand() { return command; } /// - /// Update the navigation property appConsentRequests in identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the navigation property appConsentRequests in identityGovernance"; + command.Description = "A collection of userConsentRequest objects for a specific application."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--body")); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (appConsentRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -105,7 +119,7 @@ public AppConsentRequestRequestBuilder(Dictionary pathParameters RequestAdapter = requestAdapter; } /// - /// Delete navigation property appConsentRequests for identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// Request headers /// Request options /// @@ -120,7 +134,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get appConsentRequests from identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// Request headers /// Request options /// Request query parameters @@ -141,7 +155,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Update the navigation property appConsentRequests in identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// /// Request headers /// Request options @@ -159,7 +173,7 @@ public RequestInformation CreatePatchRequestInformation(AppConsentRequest body, return requestInfo; } /// - /// Delete navigation property appConsentRequests for identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -170,7 +184,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get appConsentRequests from identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -182,7 +196,7 @@ public async Task GetAsync(Action q = def return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Update the navigation property appConsentRequests in identityGovernance + /// A collection of userConsentRequest objects for a specific application. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -194,7 +208,7 @@ public async Task PatchAsync(AppConsentRequest model, ActionGet appConsentRequests from identityGovernance + /// A collection of userConsentRequest objects for a specific application. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs index 46fbfcf166b..b57782c552f 100644 --- a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function filterByCurrentUser"; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--on", description: "Usage: on={on}")); - command.Handler = CommandHandler.Create(async (appConsentRequestId, on) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); - if (!String.IsNullOrEmpty(on)) requestInfo.PathParameters.Add("on", on); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var onOption = new Option("--on", description: "Usage: on={on}"); + onOption.IsRequired = true; + command.AddOption(onOption); + command.Handler = CommandHandler.Create(async (appConsentRequestId, on) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/Approval/ApprovalRequestBuilder.cs b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/Approval/ApprovalRequestBuilder.cs index 6d4b261e449..d1cadefedca 100644 --- a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/Approval/ApprovalRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/Approval/ApprovalRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Approval decisions associated with a request."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--userconsentrequest-id", description: "key: id of userConsentRequest")); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var userConsentRequestIdOption = new Option("--userconsentrequest-id", description: "key: id of userConsentRequest"); + userConsentRequestIdOption.IsRequired = true; + command.AddOption(userConsentRequestIdOption); command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); - if (!String.IsNullOrEmpty(userConsentRequestId)) requestInfo.PathParameters.Add("userConsentRequest_id", userConsentRequestId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Approval decisions associated with a request."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--userconsentrequest-id", description: "key: id of userConsentRequest")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); - if (!String.IsNullOrEmpty(userConsentRequestId)) requestInfo.PathParameters.Add("userConsentRequest_id", userConsentRequestId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var userConsentRequestIdOption = new Option("--userconsentrequest-id", description: "key: id of userConsentRequest"); + userConsentRequestIdOption.IsRequired = true; + command.AddOption(userConsentRequestIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Approval decisions associated with a request."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--userconsentrequest-id", description: "key: id of userConsentRequest")); - command.AddOption(new Option("--body")); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var userConsentRequestIdOption = new Option("--userconsentrequest-id", description: "key: id of userConsentRequest"); + userConsentRequestIdOption.IsRequired = true; + command.AddOption(userConsentRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); - if (!String.IsNullOrEmpty(userConsentRequestId)) requestInfo.PathParameters.Add("userConsentRequest_id", userConsentRequestId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/Approval/Stages/Item/ApprovalStageRequestBuilder.cs b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/Approval/Stages/Item/ApprovalStageRequestBuilder.cs index 090f781aef4..af1485d9c3e 100644 --- a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/Approval/Stages/Item/ApprovalStageRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/Approval/Stages/Item/ApprovalStageRequestBuilder.cs @@ -20,20 +20,24 @@ public class ApprovalStageRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "A collection of stages in the approval decision."; + command.Description = "Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--userconsentrequest-id", description: "key: id of userConsentRequest")); - command.AddOption(new Option("--approvalstage-id", description: "key: id of approvalStage")); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var userConsentRequestIdOption = new Option("--userconsentrequest-id", description: "key: id of userConsentRequest"); + userConsentRequestIdOption.IsRequired = true; + command.AddOption(userConsentRequestIdOption); + var approvalStageIdOption = new Option("--approvalstage-id", description: "key: id of approvalStage"); + approvalStageIdOption.IsRequired = true; + command.AddOption(approvalStageIdOption); command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId, approvalStageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); - if (!String.IsNullOrEmpty(userConsentRequestId)) requestInfo.PathParameters.Add("userConsentRequest_id", userConsentRequestId); - if (!String.IsNullOrEmpty(approvalStageId)) requestInfo.PathParameters.Add("approvalStage_id", approvalStageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,24 +45,34 @@ public Command BuildDeleteCommand() { return command; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "A collection of stages in the approval decision."; + command.Description = "Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--userconsentrequest-id", description: "key: id of userConsentRequest")); - command.AddOption(new Option("--approvalstage-id", description: "key: id of approvalStage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId, approvalStageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); - if (!String.IsNullOrEmpty(userConsentRequestId)) requestInfo.PathParameters.Add("userConsentRequest_id", userConsentRequestId); - if (!String.IsNullOrEmpty(approvalStageId)) requestInfo.PathParameters.Add("approvalStage_id", approvalStageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var userConsentRequestIdOption = new Option("--userconsentrequest-id", description: "key: id of userConsentRequest"); + userConsentRequestIdOption.IsRequired = true; + command.AddOption(userConsentRequestIdOption); + var approvalStageIdOption = new Option("--approvalstage-id", description: "key: id of approvalStage"); + approvalStageIdOption.IsRequired = true; + command.AddOption(approvalStageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId, approvalStageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,24 +85,30 @@ public Command BuildGetCommand() { return command; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "A collection of stages in the approval decision."; + command.Description = "Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--userconsentrequest-id", description: "key: id of userConsentRequest")); - command.AddOption(new Option("--approvalstage-id", description: "key: id of approvalStage")); - command.AddOption(new Option("--body")); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var userConsentRequestIdOption = new Option("--userconsentrequest-id", description: "key: id of userConsentRequest"); + userConsentRequestIdOption.IsRequired = true; + command.AddOption(userConsentRequestIdOption); + var approvalStageIdOption = new Option("--approvalstage-id", description: "key: id of approvalStage"); + approvalStageIdOption.IsRequired = true; + command.AddOption(approvalStageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId, approvalStageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); - if (!String.IsNullOrEmpty(userConsentRequestId)) requestInfo.PathParameters.Add("userConsentRequest_id", userConsentRequestId); - if (!String.IsNullOrEmpty(approvalStageId)) requestInfo.PathParameters.Add("approvalStage_id", approvalStageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -109,7 +129,7 @@ public ApprovalStageRequestBuilder(Dictionary pathParameters, IR RequestAdapter = requestAdapter; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Request headers /// Request options /// @@ -124,7 +144,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Request headers /// Request options /// Request query parameters @@ -145,7 +165,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// /// Request headers /// Request options @@ -163,7 +183,7 @@ public RequestInformation CreatePatchRequestInformation(ApprovalStage body, Acti return requestInfo; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +194,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -186,7 +206,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -198,7 +218,7 @@ public async Task PatchAsync(ApprovalStage model, ActionA collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/Approval/Stages/StagesRequestBuilder.cs b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/Approval/Stages/StagesRequestBuilder.cs index 3205435b411..890a632c97b 100644 --- a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/Approval/Stages/StagesRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/Approval/Stages/StagesRequestBuilder.cs @@ -30,22 +30,27 @@ public List BuildCommand() { return commands; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "A collection of stages in the approval decision."; + command.Description = "Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--userconsentrequest-id", description: "key: id of userConsentRequest")); - command.AddOption(new Option("--body")); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var userConsentRequestIdOption = new Option("--userconsentrequest-id", description: "key: id of userConsentRequest"); + userConsentRequestIdOption.IsRequired = true; + command.AddOption(userConsentRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); - if (!String.IsNullOrEmpty(userConsentRequestId)) requestInfo.PathParameters.Add("userConsentRequest_id", userConsentRequestId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,34 +63,56 @@ public Command BuildCreateCommand() { return command; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "A collection of stages in the approval decision."; + command.Description = "Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--userconsentrequest-id", description: "key: id of userConsentRequest")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); - if (!String.IsNullOrEmpty(userConsentRequestId)) requestInfo.PathParameters.Add("userConsentRequest_id", userConsentRequestId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var userConsentRequestIdOption = new Option("--userconsentrequest-id", description: "key: id of userConsentRequest"); + userConsentRequestIdOption.IsRequired = true; + command.AddOption(userConsentRequestIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -111,7 +138,7 @@ public StagesRequestBuilder(Dictionary pathParameters, IRequestA RequestAdapter = requestAdapter; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Request headers /// Request options /// Request query parameters @@ -132,7 +159,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// /// Request headers /// Request options @@ -150,7 +177,7 @@ public RequestInformation CreatePostRequestInformation(ApprovalStage body, Actio return requestInfo; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +189,7 @@ public async Task GetAsync(Action q = defaul return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -174,7 +201,7 @@ public async Task PostAsync(ApprovalStage model, Action(requestInfo, responseHandler, cancellationToken); } - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/UserConsentRequestRequestBuilder.cs b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/UserConsentRequestRequestBuilder.cs index 0b028c97c87..685a5063301 100644 --- a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/UserConsentRequestRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/Item/UserConsentRequestRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A list of pending user consent requests."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--userconsentrequest-id", description: "key: id of userConsentRequest")); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var userConsentRequestIdOption = new Option("--userconsentrequest-id", description: "key: id of userConsentRequest"); + userConsentRequestIdOption.IsRequired = true; + command.AddOption(userConsentRequestIdOption); command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); - if (!String.IsNullOrEmpty(userConsentRequestId)) requestInfo.PathParameters.Add("userConsentRequest_id", userConsentRequestId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,16 +58,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A list of pending user consent requests."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--userconsentrequest-id", description: "key: id of userConsentRequest")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); - if (!String.IsNullOrEmpty(userConsentRequestId)) requestInfo.PathParameters.Add("userConsentRequest_id", userConsentRequestId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var userConsentRequestIdOption = new Option("--userconsentrequest-id", description: "key: id of userConsentRequest"); + userConsentRequestIdOption.IsRequired = true; + command.AddOption(userConsentRequestIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,16 +95,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A list of pending user consent requests."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--userconsentrequest-id", description: "key: id of userConsentRequest")); - command.AddOption(new Option("--body")); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var userConsentRequestIdOption = new Option("--userconsentrequest-id", description: "key: id of userConsentRequest"); + userConsentRequestIdOption.IsRequired = true; + command.AddOption(userConsentRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (appConsentRequestId, userConsentRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); - if (!String.IsNullOrEmpty(userConsentRequestId)) requestInfo.PathParameters.Add("userConsentRequest_id", userConsentRequestId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/UserConsentRequestsRequestBuilder.cs b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/UserConsentRequestsRequestBuilder.cs index de14317f631..04d9db5deb8 100644 --- a/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/UserConsentRequestsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/AppConsent/AppConsentRequests/Item/UserConsentRequests/UserConsentRequestsRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A list of pending user consent requests."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--body")); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (appConsentRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +68,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A list of pending user consent requests."; // Create options for all the parameters - command.AddOption(new Option("--appconsentrequest-id", description: "key: id of appConsentRequest")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (appConsentRequestId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(appConsentRequestId)) requestInfo.PathParameters.Add("appConsentRequest_id", appConsentRequestId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var appConsentRequestIdOption = new Option("--appconsentrequest-id", description: "key: id of appConsentRequest"); + appConsentRequestIdOption.IsRequired = true; + command.AddOption(appConsentRequestIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (appConsentRequestId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/AccessPackageAssignmentApprovalsRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/AccessPackageAssignmentApprovalsRequestBuilder.cs index f8e02d75b66..a3bb4806a3c 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/AccessPackageAssignmentApprovalsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/AccessPackageAssignmentApprovalsRequestBuilder.cs @@ -38,12 +38,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to accessPackageAssignmentApprovals for identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +65,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get accessPackageAssignmentApprovals from identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs index c220b10975f..84163d11270 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function filterByCurrentUser"; // Create options for all the parameters - command.AddOption(new Option("--on", description: "Usage: on={on}")); - command.Handler = CommandHandler.Create(async (on) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(on)) requestInfo.PathParameters.Add("on", on); + var onOption = new Option("--on", description: "Usage: on={on}"); + onOption.IsRequired = true; + command.AddOption(onOption); + command.Handler = CommandHandler.Create(async (on) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/Item/ApprovalRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/Item/ApprovalRequestBuilder.cs index 3e01022edaa..88e95bfb1e2 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/Item/ApprovalRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/Item/ApprovalRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property accessPackageAssignmentApprovals for identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--approval-id", description: "key: id of approval")); + var approvalIdOption = new Option("--approval-id", description: "key: id of approval"); + approvalIdOption.IsRequired = true; + command.AddOption(approvalIdOption); command.Handler = CommandHandler.Create(async (approvalId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(approvalId)) requestInfo.PathParameters.Add("approval_id", approvalId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get accessPackageAssignmentApprovals from identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--approval-id", description: "key: id of approval")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (approvalId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(approvalId)) requestInfo.PathParameters.Add("approval_id", approvalId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var approvalIdOption = new Option("--approval-id", description: "key: id of approval"); + approvalIdOption.IsRequired = true; + command.AddOption(approvalIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (approvalId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,14 +80,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property accessPackageAssignmentApprovals in identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--approval-id", description: "key: id of approval")); - command.AddOption(new Option("--body")); + var approvalIdOption = new Option("--approval-id", description: "key: id of approval"); + approvalIdOption.IsRequired = true; + command.AddOption(approvalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (approvalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(approvalId)) requestInfo.PathParameters.Add("approval_id", approvalId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/Item/Stages/Item/ApprovalStageRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/Item/Stages/Item/ApprovalStageRequestBuilder.cs index 6f4b1e63991..b0567fca413 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/Item/Stages/Item/ApprovalStageRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/Item/Stages/Item/ApprovalStageRequestBuilder.cs @@ -20,18 +20,21 @@ public class ApprovalStageRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "A collection of stages in the approval decision."; + command.Description = "Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage."; // Create options for all the parameters - command.AddOption(new Option("--approval-id", description: "key: id of approval")); - command.AddOption(new Option("--approvalstage-id", description: "key: id of approvalStage")); + var approvalIdOption = new Option("--approval-id", description: "key: id of approval"); + approvalIdOption.IsRequired = true; + command.AddOption(approvalIdOption); + var approvalStageIdOption = new Option("--approvalstage-id", description: "key: id of approvalStage"); + approvalStageIdOption.IsRequired = true; + command.AddOption(approvalStageIdOption); command.Handler = CommandHandler.Create(async (approvalId, approvalStageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(approvalId)) requestInfo.PathParameters.Add("approval_id", approvalId); - if (!String.IsNullOrEmpty(approvalStageId)) requestInfo.PathParameters.Add("approvalStage_id", approvalStageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "A collection of stages in the approval decision."; + command.Description = "Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage."; // Create options for all the parameters - command.AddOption(new Option("--approval-id", description: "key: id of approval")); - command.AddOption(new Option("--approvalstage-id", description: "key: id of approvalStage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (approvalId, approvalStageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(approvalId)) requestInfo.PathParameters.Add("approval_id", approvalId); - if (!String.IsNullOrEmpty(approvalStageId)) requestInfo.PathParameters.Add("approvalStage_id", approvalStageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var approvalIdOption = new Option("--approval-id", description: "key: id of approval"); + approvalIdOption.IsRequired = true; + command.AddOption(approvalIdOption); + var approvalStageIdOption = new Option("--approvalstage-id", description: "key: id of approvalStage"); + approvalStageIdOption.IsRequired = true; + command.AddOption(approvalStageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (approvalId, approvalStageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "A collection of stages in the approval decision."; + command.Description = "Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage."; // Create options for all the parameters - command.AddOption(new Option("--approval-id", description: "key: id of approval")); - command.AddOption(new Option("--approvalstage-id", description: "key: id of approvalStage")); - command.AddOption(new Option("--body")); + var approvalIdOption = new Option("--approval-id", description: "key: id of approval"); + approvalIdOption.IsRequired = true; + command.AddOption(approvalIdOption); + var approvalStageIdOption = new Option("--approvalstage-id", description: "key: id of approvalStage"); + approvalStageIdOption.IsRequired = true; + command.AddOption(approvalStageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (approvalId, approvalStageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(approvalId)) requestInfo.PathParameters.Add("approval_id", approvalId); - if (!String.IsNullOrEmpty(approvalStageId)) requestInfo.PathParameters.Add("approvalStage_id", approvalStageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public ApprovalStageRequestBuilder(Dictionary pathParameters, IR RequestAdapter = requestAdapter; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(ApprovalStage body, Acti return requestInfo; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(ApprovalStage model, ActionA collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/Item/Stages/StagesRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/Item/Stages/StagesRequestBuilder.cs index 010ab7f1ca4..d8ac75e55f4 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/Item/Stages/StagesRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackageAssignmentApprovals/Item/Stages/StagesRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "A collection of stages in the approval decision."; + command.Description = "Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage."; // Create options for all the parameters - command.AddOption(new Option("--approval-id", description: "key: id of approval")); - command.AddOption(new Option("--body")); + var approvalIdOption = new Option("--approval-id", description: "key: id of approval"); + approvalIdOption.IsRequired = true; + command.AddOption(approvalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (approvalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(approvalId)) requestInfo.PathParameters.Add("approval_id", approvalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,32 +60,53 @@ public Command BuildCreateCommand() { return command; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "A collection of stages in the approval decision."; + command.Description = "Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage."; // Create options for all the parameters - command.AddOption(new Option("--approval-id", description: "key: id of approval")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (approvalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(approvalId)) requestInfo.PathParameters.Add("approval_id", approvalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var approvalIdOption = new Option("--approval-id", description: "key: id of approval"); + approvalIdOption.IsRequired = true; + command.AddOption(approvalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (approvalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,7 +132,7 @@ public StagesRequestBuilder(Dictionary pathParameters, IRequestA RequestAdapter = requestAdapter; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Request headers /// Request options /// Request query parameters @@ -128,7 +153,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// /// Request headers /// Request options @@ -146,7 +171,7 @@ public RequestInformation CreatePostRequestInformation(ApprovalStage body, Actio return requestInfo; } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -158,7 +183,7 @@ public async Task GetAsync(Action q = defaul return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -170,7 +195,7 @@ public async Task PostAsync(ApprovalStage model, Action(requestInfo, responseHandler, cancellationToken); } - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/AccessPackagesRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/AccessPackagesRequestBuilder.cs index 62d190a9ca8..9a52ef2590c 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/AccessPackagesRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/AccessPackagesRequestBuilder.cs @@ -33,18 +33,21 @@ public List BuildCommand() { return commands; } /// - /// Create new navigation property to accessPackages for identityGovernance + /// Represents access package objects. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create new navigation property to accessPackages for identityGovernance"; + command.Description = "Represents access package objects."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,30 +60,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Get accessPackages from identityGovernance + /// Represents access package objects. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Get accessPackages from identityGovernance"; + command.Description = "Represents access package objects."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -106,7 +129,7 @@ public AccessPackagesRequestBuilder(Dictionary pathParameters, I RequestAdapter = requestAdapter; } /// - /// Get accessPackages from identityGovernance + /// Represents access package objects. /// Request headers /// Request options /// Request query parameters @@ -127,7 +150,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Create new navigation property to accessPackages for identityGovernance + /// Represents access package objects. /// /// Request headers /// Request options @@ -153,7 +176,7 @@ public FilterByCurrentUserWithOnRequestBuilder FilterByCurrentUserWithOn(string return new FilterByCurrentUserWithOnRequestBuilder(PathParameters, RequestAdapter, on); } /// - /// Get accessPackages from identityGovernance + /// Represents access package objects. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -165,7 +188,7 @@ public async Task GetAsync(Action q return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Create new navigation property to accessPackages for identityGovernance + /// Represents access package objects. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -177,7 +200,7 @@ public async Task GetAsync(Action q var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Get accessPackages from identityGovernance + /// Represents access package objects. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs index a4af3c2c279..e8c5499ae68 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function filterByCurrentUser"; // Create options for all the parameters - command.AddOption(new Option("--on", description: "Usage: on={on}")); - command.Handler = CommandHandler.Create(async (on) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(on)) requestInfo.PathParameters.Add("on", on); + var onOption = new Option("--on", description: "Usage: on={on}"); + onOption.IsRequired = true; + command.AddOption(onOption); + command.Handler = CommandHandler.Create(async (on) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/AccessPackageRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/AccessPackageRequestBuilder.cs index e94e30c0b58..0d3d4c79be9 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/AccessPackageRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/AccessPackageRequestBuilder.cs @@ -29,16 +29,18 @@ public Command BuildCatalogCommand() { return command; } /// - /// Delete navigation property accessPackages for identityGovernance + /// Represents access package objects. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete navigation property accessPackages for identityGovernance"; + command.Description = "Represents access package objects."; // Create options for all the parameters - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); command.Handler = CommandHandler.Create(async (accessPackageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,20 +54,28 @@ public Command BuildGetApplicablePolicyRequirementsCommand() { return command; } /// - /// Get accessPackages from identityGovernance + /// Represents access package objects. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get accessPackages from identityGovernance"; + command.Description = "Represents access package objects."; // Create options for all the parameters - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessPackageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessPackageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,20 +88,24 @@ public Command BuildGetCommand() { return command; } /// - /// Update the navigation property accessPackages in identityGovernance + /// Represents access package objects. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the navigation property accessPackages in identityGovernance"; + command.Description = "Represents access package objects."; // Create options for all the parameters - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); - command.AddOption(new Option("--body")); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessPackageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -112,7 +126,7 @@ public AccessPackageRequestBuilder(Dictionary pathParameters, IR RequestAdapter = requestAdapter; } /// - /// Delete navigation property accessPackages for identityGovernance + /// Represents access package objects. /// Request headers /// Request options /// @@ -127,7 +141,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get accessPackages from identityGovernance + /// Represents access package objects. /// Request headers /// Request options /// Request query parameters @@ -148,7 +162,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Update the navigation property accessPackages in identityGovernance + /// Represents access package objects. /// /// Request headers /// Request options @@ -166,7 +180,7 @@ public RequestInformation CreatePatchRequestInformation(ApiSdk.Models.Microsoft. return requestInfo; } /// - /// Delete navigation property accessPackages for identityGovernance + /// Represents access package objects. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -177,7 +191,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get accessPackages from identityGovernance + /// Represents access package objects. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -189,7 +203,7 @@ public async Task DeleteAsync(Action> h = default, I return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Update the navigation property accessPackages in identityGovernance + /// Represents access package objects. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -201,7 +215,7 @@ public async Task PatchAsync(ApiSdk.Models.Microsoft.Graph.AccessPackage model, var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// Get accessPackages from identityGovernance + /// Represents access package objects. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/Catalog/@Ref/RefRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/Catalog/@Ref/RefRequestBuilder.cs index 47fa32db2c0..f9f0f88c7e5 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/Catalog/@Ref/RefRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/Catalog/@Ref/RefRequestBuilder.cs @@ -19,16 +19,18 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Delete ref of navigation property catalog for identityGovernance + /// Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete ref of navigation property catalog for identityGovernance"; + command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); command.Handler = CommandHandler.Create(async (accessPackageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -36,16 +38,18 @@ public Command BuildDeleteCommand() { return command; } /// - /// Get ref of catalog from identityGovernance + /// Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get ref of catalog from identityGovernance"; + command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); command.Handler = CommandHandler.Create(async (accessPackageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,20 +62,24 @@ public Command BuildGetCommand() { return command; } /// - /// Update the ref of navigation property catalog in identityGovernance + /// Read-only. Nullable. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "Update the ref of navigation property catalog in identityGovernance"; + command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); - command.AddOption(new Option("--body")); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessPackageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -92,7 +100,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// Delete ref of navigation property catalog for identityGovernance + /// Read-only. Nullable. /// Request headers /// Request options /// @@ -107,7 +115,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get ref of catalog from identityGovernance + /// Read-only. Nullable. /// Request headers /// Request options /// @@ -122,7 +130,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// Update the ref of navigation property catalog in identityGovernance + /// Read-only. Nullable. /// /// Request headers /// Request options @@ -140,7 +148,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.IdentityGovernance. return requestInfo; } /// - /// Delete ref of navigation property catalog for identityGovernance + /// Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -151,7 +159,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get ref of catalog from identityGovernance + /// Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +170,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Update the ref of navigation property catalog in identityGovernance + /// Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/Catalog/CatalogRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/Catalog/CatalogRequestBuilder.cs index b9a6a1b77e1..8da0063590c 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/Catalog/CatalogRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/Catalog/CatalogRequestBuilder.cs @@ -21,20 +21,28 @@ public class CatalogRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Get catalog from identityGovernance + /// Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get catalog from identityGovernance"; + command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessPackageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessPackageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,7 +76,7 @@ public CatalogRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Get catalog from identityGovernance + /// Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -89,7 +97,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Get catalog from identityGovernance + /// Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -100,7 +108,7 @@ public async Task GetAsync(Action q = var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Get catalog from identityGovernance + /// Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs index ac6b0bfb316..34185a0be6c 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getApplicablePolicyRequirements"; // Create options for all the parameters - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); command.Handler = CommandHandler.Create(async (accessPackageId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/AssignmentRequestsRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/AssignmentRequestsRequestBuilder.cs index 1bc4dca2cda..97c2b546345 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/AssignmentRequestsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/AssignmentRequestsRequestBuilder.cs @@ -35,18 +35,21 @@ public List BuildCommand() { return commands; } /// - /// Create new navigation property to assignmentRequests for identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create new navigation property to assignmentRequests for identityGovernance"; + command.Description = "Represents access package assignment requests created by or on behalf of a user."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,30 +62,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Get assignmentRequests from identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Get assignmentRequests from identityGovernance"; + command.Description = "Represents access package assignment requests created by or on behalf of a user."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,7 +131,7 @@ public AssignmentRequestsRequestBuilder(Dictionary pathParameter RequestAdapter = requestAdapter; } /// - /// Get assignmentRequests from identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// Request headers /// Request options /// Request query parameters @@ -129,7 +152,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Create new navigation property to assignmentRequests for identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// /// Request headers /// Request options @@ -155,7 +178,7 @@ public FilterByCurrentUserWithOnRequestBuilder FilterByCurrentUserWithOn(string return new FilterByCurrentUserWithOnRequestBuilder(PathParameters, RequestAdapter, on); } /// - /// Get assignmentRequests from identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -167,7 +190,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } /// - /// Create new navigation property to assignmentRequests for identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -179,7 +202,7 @@ public async Task PostAsync(AccessPackageAssignm var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Get assignmentRequests from identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs index b3f804fc068..d6fe18b71d3 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function filterByCurrentUser"; // Create options for all the parameters - command.AddOption(new Option("--on", description: "Usage: on={on}")); - command.Handler = CommandHandler.Create(async (on) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(on)) requestInfo.PathParameters.Add("on", on); + var onOption = new Option("--on", description: "Usage: on={on}"); + onOption.IsRequired = true; + command.AddOption(onOption); + command.Handler = CommandHandler.Create(async (on) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackage/@Ref/RefRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackage/@Ref/RefRequestBuilder.cs index 197f1dce9d5..bf70df8144c 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackage/@Ref/RefRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackage/@Ref/RefRequestBuilder.cs @@ -19,16 +19,18 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. + /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand."; + command.Description = "The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -36,16 +38,18 @@ public Command BuildDeleteCommand() { return command; } /// - /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. + /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand."; + command.Description = "The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,20 +62,24 @@ public Command BuildGetCommand() { return command; } /// - /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. + /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand."; + command.Description = "The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); - command.AddOption(new Option("--body")); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -92,7 +100,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. + /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// @@ -107,7 +115,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. + /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// @@ -122,7 +130,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. + /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. /// /// Request headers /// Request options @@ -140,7 +148,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.IdentityGovernance. return requestInfo; } /// - /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. + /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -151,7 +159,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. + /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +170,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. + /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackage/AccessPackageRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackage/AccessPackageRequestBuilder.cs index 5544ba305b4..bfdb1ee2dca 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackage/AccessPackageRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackage/AccessPackageRequestBuilder.cs @@ -28,20 +28,28 @@ public Command BuildGetApplicablePolicyRequirementsCommand() { return command; } /// - /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. + /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand."; + command.Description = "The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,7 +83,7 @@ public AccessPackageRequestBuilder(Dictionary pathParameters, IR RequestAdapter = requestAdapter; } /// - /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. + /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -96,7 +104,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. + /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -107,7 +115,7 @@ public RequestInformation CreateGetRequestInformation(Action var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. + /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackage/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackage/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs index d8a8b682737..b9c38add9c3 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackage/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackage/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getApplicablePolicyRequirements"; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackageAssignmentRequestRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackageAssignmentRequestRequestBuilder.cs index 1de2f62130b..c743957f6c4 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackageAssignmentRequestRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/AccessPackageAssignmentRequestRequestBuilder.cs @@ -45,16 +45,18 @@ public Command BuildCancelCommand() { return command; } /// - /// Delete navigation property assignmentRequests for identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete navigation property assignmentRequests for identityGovernance"; + command.Description = "Represents access package assignment requests created by or on behalf of a user."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,20 +64,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Get assignmentRequests from identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get assignmentRequests from identityGovernance"; + command.Description = "Represents access package assignment requests created by or on behalf of a user."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +98,24 @@ public Command BuildGetCommand() { return command; } /// - /// Update the navigation property assignmentRequests in identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the navigation property assignmentRequests in identityGovernance"; + command.Description = "Represents access package assignment requests created by or on behalf of a user."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); - command.AddOption(new Option("--body")); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -129,7 +143,7 @@ public AccessPackageAssignmentRequestRequestBuilder(Dictionary p RequestAdapter = requestAdapter; } /// - /// Delete navigation property assignmentRequests for identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// Request headers /// Request options /// @@ -144,7 +158,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get assignmentRequests from identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// Request headers /// Request options /// Request query parameters @@ -165,7 +179,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Update the navigation property assignmentRequests in identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// /// Request headers /// Request options @@ -183,7 +197,7 @@ public RequestInformation CreatePatchRequestInformation(AccessPackageAssignmentR return requestInfo; } /// - /// Delete navigation property assignmentRequests for identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -194,7 +208,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get assignmentRequests from identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -206,7 +220,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } /// - /// Update the navigation property assignmentRequests in identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -218,7 +232,7 @@ public async Task PatchAsync(AccessPackageAssignmentRequest model, ActionGet assignmentRequests from identityGovernance + /// Represents access package assignment requests created by or on behalf of a user. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Assignment/@Ref/RefRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Assignment/@Ref/RefRequestBuilder.cs index 0e53afcf71a..3f75547a555 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Assignment/@Ref/RefRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Assignment/@Ref/RefRequestBuilder.cs @@ -19,16 +19,18 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Delete ref of navigation property assignment for identityGovernance + /// For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete ref of navigation property assignment for identityGovernance"; + command.Description = "For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -36,16 +38,18 @@ public Command BuildDeleteCommand() { return command; } /// - /// Get ref of assignment from identityGovernance + /// For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get ref of assignment from identityGovernance"; + command.Description = "For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,20 +62,24 @@ public Command BuildGetCommand() { return command; } /// - /// Update the ref of navigation property assignment in identityGovernance + /// For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "Update the ref of navigation property assignment in identityGovernance"; + command.Description = "For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); - command.AddOption(new Option("--body")); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -92,7 +100,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// Delete ref of navigation property assignment for identityGovernance + /// For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// Request headers /// Request options /// @@ -107,7 +115,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get ref of assignment from identityGovernance + /// For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// Request headers /// Request options /// @@ -122,7 +130,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// Update the ref of navigation property assignment in identityGovernance + /// For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// /// Request headers /// Request options @@ -140,7 +148,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.IdentityGovernance. return requestInfo; } /// - /// Delete ref of navigation property assignment for identityGovernance + /// For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -151,7 +159,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get ref of assignment from identityGovernance + /// For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +170,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Update the ref of navigation property assignment in identityGovernance + /// For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Assignment/AssignmentRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Assignment/AssignmentRequestBuilder.cs index 48ac6c03999..adb7305fed4 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Assignment/AssignmentRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Assignment/AssignmentRequestBuilder.cs @@ -21,20 +21,28 @@ public class AssignmentRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Get assignment from identityGovernance + /// For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get assignment from identityGovernance"; + command.Description = "For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,7 +76,7 @@ public AssignmentRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// Get assignment from identityGovernance + /// For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -89,7 +97,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Get assignment from identityGovernance + /// For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -100,7 +108,7 @@ public async Task GetAsync(Action q var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Get assignment from identityGovernance + /// For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Cancel/CancelRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Cancel/CancelRequestBuilder.cs index 469d67fbec6..dcb6c623091 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Cancel/CancelRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Requestor/@Ref/RefRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Requestor/@Ref/RefRequestBuilder.cs index eb2f2e338f7..137c09482f2 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Requestor/@Ref/RefRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Requestor/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The subject who requested or, if a direct assignment, was assigned. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The subject who requested or, if a direct assignment, was assigned. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The subject who requested or, if a direct assignment, was assigned. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); - command.AddOption(new Option("--body")); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Requestor/RequestorRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Requestor/RequestorRequestBuilder.cs index a0b110a30fb..b726d61e451 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Requestor/RequestorRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Requestor/RequestorRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The subject who requested or, if a direct assignment, was assigned. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentRequestId)) requestInfo.PathParameters.Add("accessPackageAssignmentRequest_id", accessPackageAssignmentRequestId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessPackageAssignmentRequestIdOption = new Option("--accesspackageassignmentrequest-id", description: "key: id of accessPackageAssignmentRequest"); + accessPackageAssignmentRequestIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentRequestIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessPackageAssignmentRequestId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/AssignmentsRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/AssignmentsRequestBuilder.cs index cebece43266..1d2d64ed333 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/AssignmentsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/AssignmentsRequestBuilder.cs @@ -33,18 +33,21 @@ public List BuildCommand() { return commands; } /// - /// Create new navigation property to assignments for identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create new navigation property to assignments for identityGovernance"; + command.Description = "Represents the grant of an access package to a subject (user or group)."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,30 +60,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Get assignments from identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Get assignments from identityGovernance"; + command.Description = "Represents the grant of an access package to a subject (user or group)."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -106,7 +129,7 @@ public AssignmentsRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// Get assignments from identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// Request headers /// Request options /// Request query parameters @@ -127,7 +150,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Create new navigation property to assignments for identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// /// Request headers /// Request options @@ -153,7 +176,7 @@ public FilterByCurrentUserWithOnRequestBuilder FilterByCurrentUserWithOn(string return new FilterByCurrentUserWithOnRequestBuilder(PathParameters, RequestAdapter, on); } /// - /// Get assignments from identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -165,7 +188,7 @@ public async Task GetAsync(Action q = d return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Create new navigation property to assignments for identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// Cancellation token to use when cancelling requests /// Request headers /// @@ -177,7 +200,7 @@ public async Task PostAsync(AccessPackageAssignment mod var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Get assignments from identityGovernance + /// Represents the grant of an access package to a subject (user or group). public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs index 79ae2c0a3f6..8768c7201a0 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function filterByCurrentUser"; // Create options for all the parameters - command.AddOption(new Option("--on", description: "Usage: on={on}")); - command.Handler = CommandHandler.Create(async (on) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(on)) requestInfo.PathParameters.Add("on", on); + var onOption = new Option("--on", description: "Usage: on={on}"); + onOption.IsRequired = true; + command.AddOption(onOption); + command.Handler = CommandHandler.Create(async (on) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackage/@Ref/RefRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackage/@Ref/RefRequestBuilder.cs index 99489ca2653..20d9b6a2165 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackage/@Ref/RefRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackage/@Ref/RefRequestBuilder.cs @@ -19,16 +19,18 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Nullable. + /// Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable."; + command.Description = "Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment")); + var accessPackageAssignmentIdOption = new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment"); + accessPackageAssignmentIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentId)) requestInfo.PathParameters.Add("accessPackageAssignment_id", accessPackageAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -36,16 +38,18 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. Nullable. + /// Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable."; + command.Description = "Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment")); + var accessPackageAssignmentIdOption = new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment"); + accessPackageAssignmentIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentId)) requestInfo.PathParameters.Add("accessPackageAssignment_id", accessPackageAssignmentId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,20 +62,24 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. + /// Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "Read-only. Nullable."; + command.Description = "Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment")); - command.AddOption(new Option("--body")); + var accessPackageAssignmentIdOption = new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment"); + accessPackageAssignmentIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(accessPackageAssignmentId)) requestInfo.PathParameters.Add("accessPackageAssignment_id", accessPackageAssignmentId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -92,7 +100,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. + /// Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters. /// Request headers /// Request options /// @@ -107,7 +115,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. + /// Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters. /// Request headers /// Request options /// @@ -122,7 +130,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// Read-only. Nullable. + /// Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters. /// /// Request headers /// Request options @@ -140,7 +148,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.IdentityGovernance. return requestInfo; } /// - /// Read-only. Nullable. + /// Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -151,7 +159,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. + /// Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +170,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. + /// Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackage/AccessPackageRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackage/AccessPackageRequestBuilder.cs index 50512d195ac..5e1060e584a 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackage/AccessPackageRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackage/AccessPackageRequestBuilder.cs @@ -28,20 +28,28 @@ public Command BuildGetApplicablePolicyRequirementsCommand() { return command; } /// - /// Read-only. Nullable. + /// Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable."; + command.Description = "Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessPackageAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentId)) requestInfo.PathParameters.Add("accessPackageAssignment_id", accessPackageAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessPackageAssignmentIdOption = new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment"); + accessPackageAssignmentIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessPackageAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,7 +83,7 @@ public AccessPackageRequestBuilder(Dictionary pathParameters, IR RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. + /// Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters. /// Request headers /// Request options /// Request query parameters @@ -96,7 +104,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. + /// Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -107,7 +115,7 @@ public RequestInformation CreateGetRequestInformation(Action var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. + /// Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackage/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackage/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs index 59749f1a9e0..84f95593813 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackage/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackage/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getApplicablePolicyRequirements"; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment")); + var accessPackageAssignmentIdOption = new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment"); + accessPackageAssignmentIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentId)) requestInfo.PathParameters.Add("accessPackageAssignment_id", accessPackageAssignmentId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackageAssignmentRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackageAssignmentRequestBuilder.cs index fb336d5d0ea..ae8e8b95830 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackageAssignmentRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/AccessPackageAssignmentRequestBuilder.cs @@ -30,16 +30,18 @@ public Command BuildAccessPackageCommand() { return command; } /// - /// Delete navigation property assignments for identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete navigation property assignments for identityGovernance"; + command.Description = "Represents the grant of an access package to a subject (user or group)."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment")); + var accessPackageAssignmentIdOption = new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment"); + accessPackageAssignmentIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentId)) requestInfo.PathParameters.Add("accessPackageAssignment_id", accessPackageAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,20 +49,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Get assignments from identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get assignments from identityGovernance"; + command.Description = "Represents the grant of an access package to a subject (user or group)."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessPackageAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentId)) requestInfo.PathParameters.Add("accessPackageAssignment_id", accessPackageAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessPackageAssignmentIdOption = new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment"); + accessPackageAssignmentIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessPackageAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,20 +83,24 @@ public Command BuildGetCommand() { return command; } /// - /// Update the navigation property assignments in identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the navigation property assignments in identityGovernance"; + command.Description = "Represents the grant of an access package to a subject (user or group)."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment")); - command.AddOption(new Option("--body")); + var accessPackageAssignmentIdOption = new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment"); + accessPackageAssignmentIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(accessPackageAssignmentId)) requestInfo.PathParameters.Add("accessPackageAssignment_id", accessPackageAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -114,7 +128,7 @@ public AccessPackageAssignmentRequestBuilder(Dictionary pathPara RequestAdapter = requestAdapter; } /// - /// Delete navigation property assignments for identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// Request headers /// Request options /// @@ -129,7 +143,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get assignments from identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// Request headers /// Request options /// Request query parameters @@ -150,7 +164,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Update the navigation property assignments in identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// /// Request headers /// Request options @@ -168,7 +182,7 @@ public RequestInformation CreatePatchRequestInformation(AccessPackageAssignment return requestInfo; } /// - /// Delete navigation property assignments for identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -179,7 +193,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get assignments from identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -191,7 +205,7 @@ public async Task GetAsync(Action q return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Update the navigation property assignments in identityGovernance + /// Represents the grant of an access package to a subject (user or group). /// Cancellation token to use when cancelling requests /// Request headers /// @@ -203,7 +217,7 @@ public async Task PatchAsync(AccessPackageAssignment model, ActionGet assignments from identityGovernance + /// Represents the grant of an access package to a subject (user or group). public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/Target/@Ref/RefRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/Target/@Ref/RefRequestBuilder.cs index 31ad837b117..d7133328b3b 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/Target/@Ref/RefRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/Target/@Ref/RefRequestBuilder.cs @@ -19,16 +19,18 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The subject of the access package assignment. Read-only. Nullable. + /// The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The subject of the access package assignment. Read-only. Nullable."; + command.Description = "The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment")); + var accessPackageAssignmentIdOption = new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment"); + accessPackageAssignmentIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentId)) requestInfo.PathParameters.Add("accessPackageAssignment_id", accessPackageAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -36,16 +38,18 @@ public Command BuildDeleteCommand() { return command; } /// - /// The subject of the access package assignment. Read-only. Nullable. + /// The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The subject of the access package assignment. Read-only. Nullable."; + command.Description = "The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment")); + var accessPackageAssignmentIdOption = new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment"); + accessPackageAssignmentIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentIdOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentId)) requestInfo.PathParameters.Add("accessPackageAssignment_id", accessPackageAssignmentId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,20 +62,24 @@ public Command BuildGetCommand() { return command; } /// - /// The subject of the access package assignment. Read-only. Nullable. + /// The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The subject of the access package assignment. Read-only. Nullable."; + command.Description = "The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment")); - command.AddOption(new Option("--body")); + var accessPackageAssignmentIdOption = new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment"); + accessPackageAssignmentIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessPackageAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(accessPackageAssignmentId)) requestInfo.PathParameters.Add("accessPackageAssignment_id", accessPackageAssignmentId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -92,7 +100,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The subject of the access package assignment. Read-only. Nullable. + /// The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId. /// Request headers /// Request options /// @@ -107,7 +115,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The subject of the access package assignment. Read-only. Nullable. + /// The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId. /// Request headers /// Request options /// @@ -122,7 +130,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The subject of the access package assignment. Read-only. Nullable. + /// The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId. /// /// Request headers /// Request options @@ -140,7 +148,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.IdentityGovernance. return requestInfo; } /// - /// The subject of the access package assignment. Read-only. Nullable. + /// The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -151,7 +159,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The subject of the access package assignment. Read-only. Nullable. + /// The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +170,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The subject of the access package assignment. Read-only. Nullable. + /// The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/Target/TargetRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/Target/TargetRequestBuilder.cs index 345bc2e77bb..d6506cf7f78 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/Target/TargetRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Assignments/Item/Target/TargetRequestBuilder.cs @@ -21,20 +21,28 @@ public class TargetRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The subject of the access package assignment. Read-only. Nullable. + /// The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The subject of the access package assignment. Read-only. Nullable."; + command.Description = "The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId."; // Create options for all the parameters - command.AddOption(new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessPackageAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageAssignmentId)) requestInfo.PathParameters.Add("accessPackageAssignment_id", accessPackageAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessPackageAssignmentIdOption = new Option("--accesspackageassignment-id", description: "key: id of accessPackageAssignment"); + accessPackageAssignmentIdOption.IsRequired = true; + command.AddOption(accessPackageAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessPackageAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,7 +76,7 @@ public TargetRequestBuilder(Dictionary pathParameters, IRequestA RequestAdapter = requestAdapter; } /// - /// The subject of the access package assignment. Read-only. Nullable. + /// The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId. /// Request headers /// Request options /// Request query parameters @@ -89,7 +97,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The subject of the access package assignment. Read-only. Nullable. + /// The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -100,7 +108,7 @@ public async Task GetAsync(Action q = var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The subject of the access package assignment. Read-only. Nullable. + /// The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/CatalogsRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/CatalogsRequestBuilder.cs index 568d8126582..ba7dcb51419 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/CatalogsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/CatalogsRequestBuilder.cs @@ -31,18 +31,21 @@ public List BuildCommand() { return commands; } /// - /// Create new navigation property to catalogs for identityGovernance + /// Represents a group of access packages. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create new navigation property to catalogs for identityGovernance"; + command.Description = "Represents a group of access packages."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -55,30 +58,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Get catalogs from identityGovernance + /// Represents a group of access packages. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Get catalogs from identityGovernance"; + command.Description = "Represents a group of access packages."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -104,7 +127,7 @@ public CatalogsRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// Get catalogs from identityGovernance + /// Represents a group of access packages. /// Request headers /// Request options /// Request query parameters @@ -125,7 +148,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Create new navigation property to catalogs for identityGovernance + /// Represents a group of access packages. /// /// Request headers /// Request options @@ -143,7 +166,7 @@ public RequestInformation CreatePostRequestInformation(AccessPackageCatalog body return requestInfo; } /// - /// Get catalogs from identityGovernance + /// Represents a group of access packages. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -155,7 +178,7 @@ public async Task GetAsync(Action q = defa return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Create new navigation property to catalogs for identityGovernance + /// Represents a group of access packages. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -167,7 +190,7 @@ public async Task PostAsync(AccessPackageCatalog model, Ac var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Get catalogs from identityGovernance + /// Represents a group of access packages. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackageCatalogRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackageCatalogRequestBuilder.cs index 47946bb1e68..a8aec008d77 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackageCatalogRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackageCatalogRequestBuilder.cs @@ -28,16 +28,18 @@ public Command BuildAccessPackagesCommand() { return command; } /// - /// Delete navigation property catalogs for identityGovernance + /// Represents a group of access packages. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete navigation property catalogs for identityGovernance"; + command.Description = "Represents a group of access packages."; // Create options for all the parameters - command.AddOption(new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog")); + var accessPackageCatalogIdOption = new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog"); + accessPackageCatalogIdOption.IsRequired = true; + command.AddOption(accessPackageCatalogIdOption); command.Handler = CommandHandler.Create(async (accessPackageCatalogId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageCatalogId)) requestInfo.PathParameters.Add("accessPackageCatalog_id", accessPackageCatalogId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,20 +47,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Get catalogs from identityGovernance + /// Represents a group of access packages. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get catalogs from identityGovernance"; + command.Description = "Represents a group of access packages."; // Create options for all the parameters - command.AddOption(new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessPackageCatalogId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageCatalogId)) requestInfo.PathParameters.Add("accessPackageCatalog_id", accessPackageCatalogId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessPackageCatalogIdOption = new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog"); + accessPackageCatalogIdOption.IsRequired = true; + command.AddOption(accessPackageCatalogIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessPackageCatalogId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,20 +81,24 @@ public Command BuildGetCommand() { return command; } /// - /// Update the navigation property catalogs in identityGovernance + /// Represents a group of access packages. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the navigation property catalogs in identityGovernance"; + command.Description = "Represents a group of access packages."; // Create options for all the parameters - command.AddOption(new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog")); - command.AddOption(new Option("--body")); + var accessPackageCatalogIdOption = new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog"); + accessPackageCatalogIdOption.IsRequired = true; + command.AddOption(accessPackageCatalogIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessPackageCatalogId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(accessPackageCatalogId)) requestInfo.PathParameters.Add("accessPackageCatalog_id", accessPackageCatalogId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -105,7 +119,7 @@ public AccessPackageCatalogRequestBuilder(Dictionary pathParamet RequestAdapter = requestAdapter; } /// - /// Delete navigation property catalogs for identityGovernance + /// Represents a group of access packages. /// Request headers /// Request options /// @@ -120,7 +134,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get catalogs from identityGovernance + /// Represents a group of access packages. /// Request headers /// Request options /// Request query parameters @@ -141,7 +155,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Update the navigation property catalogs in identityGovernance + /// Represents a group of access packages. /// /// Request headers /// Request options @@ -159,7 +173,7 @@ public RequestInformation CreatePatchRequestInformation(AccessPackageCatalog bod return requestInfo; } /// - /// Delete navigation property catalogs for identityGovernance + /// Represents a group of access packages. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -170,7 +184,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get catalogs from identityGovernance + /// Represents a group of access packages. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -182,7 +196,7 @@ public async Task GetAsync(Action q = return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Update the navigation property catalogs in identityGovernance + /// Represents a group of access packages. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -194,7 +208,7 @@ public async Task PatchAsync(AccessPackageCatalog model, ActionGet catalogs from identityGovernance + /// Represents a group of access packages. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/AccessPackagesRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/AccessPackagesRequestBuilder.cs index 4173efbdd1b..438ce34ae01 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/AccessPackagesRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/AccessPackagesRequestBuilder.cs @@ -33,20 +33,24 @@ public List BuildCommand() { return commands; } /// - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The access packages in this catalog. Read-only. Nullable."; + command.Description = "The access packages in this catalog. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog")); - command.AddOption(new Option("--body")); + var accessPackageCatalogIdOption = new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog"); + accessPackageCatalogIdOption.IsRequired = true; + command.AddOption(accessPackageCatalogIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessPackageCatalogId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(accessPackageCatalogId)) requestInfo.PathParameters.Add("accessPackageCatalog_id", accessPackageCatalogId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,32 +63,53 @@ public Command BuildCreateCommand() { return command; } /// - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The access packages in this catalog. Read-only. Nullable."; + command.Description = "The access packages in this catalog. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessPackageCatalogId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageCatalogId)) requestInfo.PathParameters.Add("accessPackageCatalog_id", accessPackageCatalogId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessPackageCatalogIdOption = new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog"); + accessPackageCatalogIdOption.IsRequired = true; + command.AddOption(accessPackageCatalogIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessPackageCatalogId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -110,7 +135,7 @@ public AccessPackagesRequestBuilder(Dictionary pathParameters, I RequestAdapter = requestAdapter; } /// - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -131,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// /// Request headers /// Request options @@ -157,7 +182,7 @@ public FilterByCurrentUserWithOnRequestBuilder FilterByCurrentUserWithOn(string return new FilterByCurrentUserWithOnRequestBuilder(PathParameters, RequestAdapter, on); } /// - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -169,7 +194,7 @@ public async Task GetAsync(Action q return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -181,7 +206,7 @@ public async Task GetAsync(Action q var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs index 4ebfe683b03..2983534dc77 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/FilterByCurrentUserWithOn/FilterByCurrentUserWithOnRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function filterByCurrentUser"; // Create options for all the parameters - command.AddOption(new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog")); - command.AddOption(new Option("--on", description: "Usage: on={on}")); - command.Handler = CommandHandler.Create(async (accessPackageCatalogId, on) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageCatalogId)) requestInfo.PathParameters.Add("accessPackageCatalog_id", accessPackageCatalogId); - if (!String.IsNullOrEmpty(on)) requestInfo.PathParameters.Add("on", on); + var accessPackageCatalogIdOption = new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog"); + accessPackageCatalogIdOption.IsRequired = true; + command.AddOption(accessPackageCatalogIdOption); + var onOption = new Option("--on", description: "Usage: on={on}"); + onOption.IsRequired = true; + command.AddOption(onOption); + command.Handler = CommandHandler.Create(async (accessPackageCatalogId, on) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/AccessPackageRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/AccessPackageRequestBuilder.cs index f43773977f5..77b918ae796 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/AccessPackageRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/AccessPackageRequestBuilder.cs @@ -29,18 +29,21 @@ public Command BuildCatalogCommand() { return command; } /// - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The access packages in this catalog. Read-only. Nullable."; + command.Description = "The access packages in this catalog. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog")); - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); + var accessPackageCatalogIdOption = new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog"); + accessPackageCatalogIdOption.IsRequired = true; + command.AddOption(accessPackageCatalogIdOption); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); command.Handler = CommandHandler.Create(async (accessPackageCatalogId, accessPackageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageCatalogId)) requestInfo.PathParameters.Add("accessPackageCatalog_id", accessPackageCatalogId); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,22 +57,31 @@ public Command BuildGetApplicablePolicyRequirementsCommand() { return command; } /// - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The access packages in this catalog. Read-only. Nullable."; + command.Description = "The access packages in this catalog. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog")); - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessPackageCatalogId, accessPackageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageCatalogId)) requestInfo.PathParameters.Add("accessPackageCatalog_id", accessPackageCatalogId); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessPackageCatalogIdOption = new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog"); + accessPackageCatalogIdOption.IsRequired = true; + command.AddOption(accessPackageCatalogIdOption); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessPackageCatalogId, accessPackageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,22 +94,27 @@ public Command BuildGetCommand() { return command; } /// - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The access packages in this catalog. Read-only. Nullable."; + command.Description = "The access packages in this catalog. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog")); - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); - command.AddOption(new Option("--body")); + var accessPackageCatalogIdOption = new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog"); + accessPackageCatalogIdOption.IsRequired = true; + command.AddOption(accessPackageCatalogIdOption); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessPackageCatalogId, accessPackageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(accessPackageCatalogId)) requestInfo.PathParameters.Add("accessPackageCatalog_id", accessPackageCatalogId); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -118,7 +135,7 @@ public AccessPackageRequestBuilder(Dictionary pathParameters, IR RequestAdapter = requestAdapter; } /// - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// @@ -133,7 +150,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -154,7 +171,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// /// Request headers /// Request options @@ -172,7 +189,7 @@ public RequestInformation CreatePatchRequestInformation(ApiSdk.Models.Microsoft. return requestInfo; } /// - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -183,7 +200,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -195,7 +212,7 @@ public async Task DeleteAsync(Action> h = default, I return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -207,7 +224,7 @@ public async Task PatchAsync(ApiSdk.Models.Microsoft.Graph.AccessPackage model, var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/Catalog/@Ref/RefRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/Catalog/@Ref/RefRequestBuilder.cs index 363a422aded..2939ae1e42d 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/Catalog/@Ref/RefRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/Catalog/@Ref/RefRequestBuilder.cs @@ -19,18 +19,21 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Delete ref of navigation property catalog for identityGovernance + /// Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete ref of navigation property catalog for identityGovernance"; + command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog")); - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); + var accessPackageCatalogIdOption = new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog"); + accessPackageCatalogIdOption.IsRequired = true; + command.AddOption(accessPackageCatalogIdOption); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); command.Handler = CommandHandler.Create(async (accessPackageCatalogId, accessPackageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageCatalogId)) requestInfo.PathParameters.Add("accessPackageCatalog_id", accessPackageCatalogId); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -38,18 +41,21 @@ public Command BuildDeleteCommand() { return command; } /// - /// Get ref of catalog from identityGovernance + /// Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get ref of catalog from identityGovernance"; + command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog")); - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); + var accessPackageCatalogIdOption = new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog"); + accessPackageCatalogIdOption.IsRequired = true; + command.AddOption(accessPackageCatalogIdOption); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); command.Handler = CommandHandler.Create(async (accessPackageCatalogId, accessPackageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageCatalogId)) requestInfo.PathParameters.Add("accessPackageCatalog_id", accessPackageCatalogId); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +68,27 @@ public Command BuildGetCommand() { return command; } /// - /// Update the ref of navigation property catalog in identityGovernance + /// Read-only. Nullable. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "Update the ref of navigation property catalog in identityGovernance"; + command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog")); - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); - command.AddOption(new Option("--body")); + var accessPackageCatalogIdOption = new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog"); + accessPackageCatalogIdOption.IsRequired = true; + command.AddOption(accessPackageCatalogIdOption); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (accessPackageCatalogId, accessPackageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(accessPackageCatalogId)) requestInfo.PathParameters.Add("accessPackageCatalog_id", accessPackageCatalogId); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -98,7 +109,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// Delete ref of navigation property catalog for identityGovernance + /// Read-only. Nullable. /// Request headers /// Request options /// @@ -113,7 +124,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get ref of catalog from identityGovernance + /// Read-only. Nullable. /// Request headers /// Request options /// @@ -128,7 +139,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// Update the ref of navigation property catalog in identityGovernance + /// Read-only. Nullable. /// /// Request headers /// Request options @@ -146,7 +157,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.IdentityGovernance. return requestInfo; } /// - /// Delete ref of navigation property catalog for identityGovernance + /// Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -157,7 +168,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get ref of catalog from identityGovernance + /// Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +179,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Update the ref of navigation property catalog in identityGovernance + /// Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/Catalog/CatalogRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/Catalog/CatalogRequestBuilder.cs index 0bfbffb3f22..4b0376ea226 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/Catalog/CatalogRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/Catalog/CatalogRequestBuilder.cs @@ -21,22 +21,31 @@ public class CatalogRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Get catalog from identityGovernance + /// Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get catalog from identityGovernance"; + command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog")); - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (accessPackageCatalogId, accessPackageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageCatalogId)) requestInfo.PathParameters.Add("accessPackageCatalog_id", accessPackageCatalogId); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var accessPackageCatalogIdOption = new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog"); + accessPackageCatalogIdOption.IsRequired = true; + command.AddOption(accessPackageCatalogIdOption); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (accessPackageCatalogId, accessPackageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,7 +79,7 @@ public CatalogRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Get catalog from identityGovernance + /// Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -91,7 +100,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Get catalog from identityGovernance + /// Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -102,7 +111,7 @@ public async Task GetAsync(Action q = var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Get catalog from identityGovernance + /// Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs index e7bef991000..97bb32efa83 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/AccessPackages/Item/GetApplicablePolicyRequirements/GetApplicablePolicyRequirementsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getApplicablePolicyRequirements"; // Create options for all the parameters - command.AddOption(new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog")); - command.AddOption(new Option("--accesspackage-id", description: "key: id of accessPackage")); + var accessPackageCatalogIdOption = new Option("--accesspackagecatalog-id", description: "key: id of accessPackageCatalog"); + accessPackageCatalogIdOption.IsRequired = true; + command.AddOption(accessPackageCatalogIdOption); + var accessPackageIdOption = new Option("--accesspackage-id", description: "key: id of accessPackage"); + accessPackageIdOption.IsRequired = true; + command.AddOption(accessPackageIdOption); command.Handler = CommandHandler.Create(async (accessPackageCatalogId, accessPackageId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(accessPackageCatalogId)) requestInfo.PathParameters.Add("accessPackageCatalog_id", accessPackageCatalogId); - if (!String.IsNullOrEmpty(accessPackageId)) requestInfo.PathParameters.Add("accessPackage_id", accessPackageId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/ConnectedOrganizationsRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/ConnectedOrganizationsRequestBuilder.cs index 909cc7c8320..b048f64d203 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/ConnectedOrganizationsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/ConnectedOrganizationsRequestBuilder.cs @@ -32,18 +32,21 @@ public List BuildCommand() { return commands; } /// - /// Create new navigation property to connectedOrganizations for identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create new navigation property to connectedOrganizations for identityGovernance"; + command.Description = "Represents references to a directory or domain of another organization whose users can request access."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,30 +59,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Get connectedOrganizations from identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Get connectedOrganizations from identityGovernance"; + command.Description = "Represents references to a directory or domain of another organization whose users can request access."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -105,7 +128,7 @@ public ConnectedOrganizationsRequestBuilder(Dictionary pathParam RequestAdapter = requestAdapter; } /// - /// Get connectedOrganizations from identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// Request headers /// Request options /// Request query parameters @@ -126,7 +149,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Create new navigation property to connectedOrganizations for identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// /// Request headers /// Request options @@ -144,7 +167,7 @@ public RequestInformation CreatePostRequestInformation(ConnectedOrganization bod return requestInfo; } /// - /// Get connectedOrganizations from identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -156,7 +179,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } /// - /// Create new navigation property to connectedOrganizations for identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -168,7 +191,7 @@ public async Task PostAsync(ConnectedOrganization model, var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Get connectedOrganizations from identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/ConnectedOrganizationRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/ConnectedOrganizationRequestBuilder.cs index cc74a18e356..c70637f2d55 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/ConnectedOrganizationRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/ConnectedOrganizationRequestBuilder.cs @@ -22,16 +22,18 @@ public class ConnectedOrganizationRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Delete navigation property connectedOrganizations for identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete navigation property connectedOrganizations for identityGovernance"; + command.Description = "Represents references to a directory or domain of another organization whose users can request access."; // Create options for all the parameters - command.AddOption(new Option("--connectedorganization-id", description: "key: id of connectedOrganization")); + var connectedOrganizationIdOption = new Option("--connectedorganization-id", description: "key: id of connectedOrganization"); + connectedOrganizationIdOption.IsRequired = true; + command.AddOption(connectedOrganizationIdOption); command.Handler = CommandHandler.Create(async (connectedOrganizationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(connectedOrganizationId)) requestInfo.PathParameters.Add("connectedOrganization_id", connectedOrganizationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,20 +48,28 @@ public Command BuildExternalSponsorsCommand() { return command; } /// - /// Get connectedOrganizations from identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get connectedOrganizations from identityGovernance"; + command.Description = "Represents references to a directory or domain of another organization whose users can request access."; // Create options for all the parameters - command.AddOption(new Option("--connectedorganization-id", description: "key: id of connectedOrganization")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (connectedOrganizationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(connectedOrganizationId)) requestInfo.PathParameters.Add("connectedOrganization_id", connectedOrganizationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var connectedOrganizationIdOption = new Option("--connectedorganization-id", description: "key: id of connectedOrganization"); + connectedOrganizationIdOption.IsRequired = true; + command.AddOption(connectedOrganizationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (connectedOrganizationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,20 +89,24 @@ public Command BuildInternalSponsorsCommand() { return command; } /// - /// Update the navigation property connectedOrganizations in identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the navigation property connectedOrganizations in identityGovernance"; + command.Description = "Represents references to a directory or domain of another organization whose users can request access."; // Create options for all the parameters - command.AddOption(new Option("--connectedorganization-id", description: "key: id of connectedOrganization")); - command.AddOption(new Option("--body")); + var connectedOrganizationIdOption = new Option("--connectedorganization-id", description: "key: id of connectedOrganization"); + connectedOrganizationIdOption.IsRequired = true; + command.AddOption(connectedOrganizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (connectedOrganizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(connectedOrganizationId)) requestInfo.PathParameters.Add("connectedOrganization_id", connectedOrganizationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -113,7 +127,7 @@ public ConnectedOrganizationRequestBuilder(Dictionary pathParame RequestAdapter = requestAdapter; } /// - /// Delete navigation property connectedOrganizations for identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// Request headers /// Request options /// @@ -128,7 +142,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get connectedOrganizations from identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// Request headers /// Request options /// Request query parameters @@ -149,7 +163,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Update the navigation property connectedOrganizations in identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// /// Request headers /// Request options @@ -167,7 +181,7 @@ public RequestInformation CreatePatchRequestInformation(ConnectedOrganization bo return requestInfo; } /// - /// Delete navigation property connectedOrganizations for identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -178,7 +192,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get connectedOrganizations from identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -190,7 +204,7 @@ public async Task GetAsync(Action q = return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Update the navigation property connectedOrganizations in identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -202,7 +216,7 @@ public async Task PatchAsync(ConnectedOrganization model, ActionGet connectedOrganizations from identityGovernance + /// Represents references to a directory or domain of another organization whose users can request access. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/ExternalSponsors/ExternalSponsorsRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/ExternalSponsors/ExternalSponsorsRequestBuilder.cs index f3618f526d8..5c88c6e53e3 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/ExternalSponsors/ExternalSponsorsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/ExternalSponsors/ExternalSponsorsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--connectedorganization-id", description: "key: id of connectedOrganization")); - command.AddOption(new Option("--body")); + var connectedOrganizationIdOption = new Option("--connectedorganization-id", description: "key: id of connectedOrganization"); + connectedOrganizationIdOption.IsRequired = true; + command.AddOption(connectedOrganizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (connectedOrganizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(connectedOrganizationId)) requestInfo.PathParameters.Add("connectedOrganization_id", connectedOrganizationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--connectedorganization-id", description: "key: id of connectedOrganization")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (connectedOrganizationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(connectedOrganizationId)) requestInfo.PathParameters.Add("connectedOrganization_id", connectedOrganizationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var connectedOrganizationIdOption = new Option("--connectedorganization-id", description: "key: id of connectedOrganization"); + connectedOrganizationIdOption.IsRequired = true; + command.AddOption(connectedOrganizationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (connectedOrganizationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/ExternalSponsors/Item/DirectoryObjectRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/ExternalSponsors/Item/DirectoryObjectRequestBuilder.cs index 25cff2fa632..4fdc1027eb5 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/ExternalSponsors/Item/DirectoryObjectRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/ExternalSponsors/Item/DirectoryObjectRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--connectedorganization-id", description: "key: id of connectedOrganization")); - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); + var connectedOrganizationIdOption = new Option("--connectedorganization-id", description: "key: id of connectedOrganization"); + connectedOrganizationIdOption.IsRequired = true; + command.AddOption(connectedOrganizationIdOption); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); command.Handler = CommandHandler.Create(async (connectedOrganizationId, directoryObjectId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(connectedOrganizationId)) requestInfo.PathParameters.Add("connectedOrganization_id", connectedOrganizationId); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--connectedorganization-id", description: "key: id of connectedOrganization")); - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (connectedOrganizationId, directoryObjectId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(connectedOrganizationId)) requestInfo.PathParameters.Add("connectedOrganization_id", connectedOrganizationId); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var connectedOrganizationIdOption = new Option("--connectedorganization-id", description: "key: id of connectedOrganization"); + connectedOrganizationIdOption.IsRequired = true; + command.AddOption(connectedOrganizationIdOption); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (connectedOrganizationId, directoryObjectId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--connectedorganization-id", description: "key: id of connectedOrganization")); - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); - command.AddOption(new Option("--body")); + var connectedOrganizationIdOption = new Option("--connectedorganization-id", description: "key: id of connectedOrganization"); + connectedOrganizationIdOption.IsRequired = true; + command.AddOption(connectedOrganizationIdOption); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (connectedOrganizationId, directoryObjectId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(connectedOrganizationId)) requestInfo.PathParameters.Add("connectedOrganization_id", connectedOrganizationId); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/InternalSponsors/InternalSponsorsRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/InternalSponsors/InternalSponsorsRequestBuilder.cs index 6dc52ce967d..12cb1ee251f 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/InternalSponsors/InternalSponsorsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/InternalSponsors/InternalSponsorsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--connectedorganization-id", description: "key: id of connectedOrganization")); - command.AddOption(new Option("--body")); + var connectedOrganizationIdOption = new Option("--connectedorganization-id", description: "key: id of connectedOrganization"); + connectedOrganizationIdOption.IsRequired = true; + command.AddOption(connectedOrganizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (connectedOrganizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(connectedOrganizationId)) requestInfo.PathParameters.Add("connectedOrganization_id", connectedOrganizationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--connectedorganization-id", description: "key: id of connectedOrganization")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (connectedOrganizationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(connectedOrganizationId)) requestInfo.PathParameters.Add("connectedOrganization_id", connectedOrganizationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var connectedOrganizationIdOption = new Option("--connectedorganization-id", description: "key: id of connectedOrganization"); + connectedOrganizationIdOption.IsRequired = true; + command.AddOption(connectedOrganizationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (connectedOrganizationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/InternalSponsors/Item/DirectoryObjectRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/InternalSponsors/Item/DirectoryObjectRequestBuilder.cs index 534a53dcbb1..751dd06f74a 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/InternalSponsors/Item/DirectoryObjectRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/ConnectedOrganizations/Item/InternalSponsors/Item/DirectoryObjectRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--connectedorganization-id", description: "key: id of connectedOrganization")); - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); + var connectedOrganizationIdOption = new Option("--connectedorganization-id", description: "key: id of connectedOrganization"); + connectedOrganizationIdOption.IsRequired = true; + command.AddOption(connectedOrganizationIdOption); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); command.Handler = CommandHandler.Create(async (connectedOrganizationId, directoryObjectId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(connectedOrganizationId)) requestInfo.PathParameters.Add("connectedOrganization_id", connectedOrganizationId); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--connectedorganization-id", description: "key: id of connectedOrganization")); - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (connectedOrganizationId, directoryObjectId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(connectedOrganizationId)) requestInfo.PathParameters.Add("connectedOrganization_id", connectedOrganizationId); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var connectedOrganizationIdOption = new Option("--connectedorganization-id", description: "key: id of connectedOrganization"); + connectedOrganizationIdOption.IsRequired = true; + command.AddOption(connectedOrganizationIdOption); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (connectedOrganizationId, directoryObjectId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Nullable."; // Create options for all the parameters - command.AddOption(new Option("--connectedorganization-id", description: "key: id of connectedOrganization")); - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); - command.AddOption(new Option("--body")); + var connectedOrganizationIdOption = new Option("--connectedorganization-id", description: "key: id of connectedOrganization"); + connectedOrganizationIdOption.IsRequired = true; + command.AddOption(connectedOrganizationIdOption); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (connectedOrganizationId, directoryObjectId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(connectedOrganizationId)) requestInfo.PathParameters.Add("connectedOrganization_id", connectedOrganizationId); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/EntitlementManagementRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/EntitlementManagementRequestBuilder.cs index fbe1c669aa4..71c63f4c507 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/EntitlementManagementRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/EntitlementManagementRequestBuilder.cs @@ -76,7 +76,8 @@ public Command BuildDeleteCommand() { command.Description = "Delete navigation property entitlementManagement for identityGovernance"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -90,12 +91,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entitlementManagement from identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -114,12 +122,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property entitlementManagement in identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Settings/SettingsRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Settings/SettingsRequestBuilder.cs index b08ddbf67ec..2520664431c 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Settings/SettingsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Settings/SettingsRequestBuilder.cs @@ -20,14 +20,15 @@ public class SettingsRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Delete navigation property settings for identityGovernance + /// Represents the settings that control the behavior of Azure AD entitlement management. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete navigation property settings for identityGovernance"; + command.Description = "Represents the settings that control the behavior of Azure AD entitlement management."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -35,18 +36,25 @@ public Command BuildDeleteCommand() { return command; } /// - /// Get settings from identityGovernance + /// Represents the settings that control the behavior of Azure AD entitlement management. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get settings from identityGovernance"; + command.Description = "Represents the settings that control the behavior of Azure AD entitlement management."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,18 +67,21 @@ public Command BuildGetCommand() { return command; } /// - /// Update the navigation property settings in identityGovernance + /// Represents the settings that control the behavior of Azure AD entitlement management. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the navigation property settings in identityGovernance"; + command.Description = "Represents the settings that control the behavior of Azure AD entitlement management."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -91,7 +102,7 @@ public SettingsRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// Delete navigation property settings for identityGovernance + /// Represents the settings that control the behavior of Azure AD entitlement management. /// Request headers /// Request options /// @@ -106,7 +117,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get settings from identityGovernance + /// Represents the settings that control the behavior of Azure AD entitlement management. /// Request headers /// Request options /// Request query parameters @@ -127,7 +138,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Update the navigation property settings in identityGovernance + /// Represents the settings that control the behavior of Azure AD entitlement management. /// /// Request headers /// Request options @@ -145,7 +156,7 @@ public RequestInformation CreatePatchRequestInformation(EntitlementManagementSet return requestInfo; } /// - /// Delete navigation property settings for identityGovernance + /// Represents the settings that control the behavior of Azure AD entitlement management. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -156,7 +167,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get settings from identityGovernance + /// Represents the settings that control the behavior of Azure AD entitlement management. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +179,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } /// - /// Update the navigation property settings in identityGovernance + /// Represents the settings that control the behavior of Azure AD entitlement management. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -180,7 +191,7 @@ public async Task PatchAsync(EntitlementManagementSettings model, ActionGet settings from identityGovernance + /// Represents the settings that control the behavior of Azure AD entitlement management. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/IdentityGovernanceRequestBuilder.cs b/src/generated/IdentityGovernance/IdentityGovernanceRequestBuilder.cs index 66b7ff8e1c7..aed216a6cf5 100644 --- a/src/generated/IdentityGovernance/IdentityGovernanceRequestBuilder.cs +++ b/src/generated/IdentityGovernance/IdentityGovernanceRequestBuilder.cs @@ -63,12 +63,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,12 +94,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityGovernance/TermsOfUse/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs b/src/generated/IdentityGovernance/TermsOfUse/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs index e5981a0be25..a464b27e091 100644 --- a/src/generated/IdentityGovernance/TermsOfUse/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs +++ b/src/generated/IdentityGovernance/TermsOfUse/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs @@ -30,18 +30,21 @@ public List BuildCommand() { return commands; } /// - /// Create new navigation property to agreementAcceptances for identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create new navigation property to agreementAcceptances for identityGovernance"; + command.Description = "Represents the current status of a user's response to a company's customizable terms of use agreement."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -54,30 +57,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Get agreementAcceptances from identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Get agreementAcceptances from identityGovernance"; + command.Description = "Represents the current status of a user's response to a company's customizable terms of use agreement."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -103,7 +126,7 @@ public AgreementAcceptancesRequestBuilder(Dictionary pathParamet RequestAdapter = requestAdapter; } /// - /// Get agreementAcceptances from identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// Request headers /// Request options /// Request query parameters @@ -124,7 +147,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Create new navigation property to agreementAcceptances for identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// /// Request headers /// Request options @@ -142,7 +165,7 @@ public RequestInformation CreatePostRequestInformation(AgreementAcceptance body, return requestInfo; } /// - /// Get agreementAcceptances from identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -154,7 +177,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } /// - /// Create new navigation property to agreementAcceptances for identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -166,7 +189,7 @@ public async Task PostAsync(AgreementAcceptance model, Acti var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Get agreementAcceptances from identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/IdentityGovernance/TermsOfUse/AgreementAcceptances/Item/AgreementAcceptanceRequestBuilder.cs b/src/generated/IdentityGovernance/TermsOfUse/AgreementAcceptances/Item/AgreementAcceptanceRequestBuilder.cs index 7ce8407396b..fbd791ad0d8 100644 --- a/src/generated/IdentityGovernance/TermsOfUse/AgreementAcceptances/Item/AgreementAcceptanceRequestBuilder.cs +++ b/src/generated/IdentityGovernance/TermsOfUse/AgreementAcceptances/Item/AgreementAcceptanceRequestBuilder.cs @@ -20,16 +20,18 @@ public class AgreementAcceptanceRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Delete navigation property agreementAcceptances for identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete navigation property agreementAcceptances for identityGovernance"; + command.Description = "Represents the current status of a user's response to a company's customizable terms of use agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance")); + var agreementAcceptanceIdOption = new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance"); + agreementAcceptanceIdOption.IsRequired = true; + command.AddOption(agreementAcceptanceIdOption); command.Handler = CommandHandler.Create(async (agreementAcceptanceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(agreementAcceptanceId)) requestInfo.PathParameters.Add("agreementAcceptance_id", agreementAcceptanceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -37,20 +39,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Get agreementAcceptances from identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get agreementAcceptances from identityGovernance"; + command.Description = "Represents the current status of a user's response to a company's customizable terms of use agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (agreementAcceptanceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementAcceptanceId)) requestInfo.PathParameters.Add("agreementAcceptance_id", agreementAcceptanceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var agreementAcceptanceIdOption = new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance"); + agreementAcceptanceIdOption.IsRequired = true; + command.AddOption(agreementAcceptanceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (agreementAcceptanceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,20 +73,24 @@ public Command BuildGetCommand() { return command; } /// - /// Update the navigation property agreementAcceptances in identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the navigation property agreementAcceptances in identityGovernance"; + command.Description = "Represents the current status of a user's response to a company's customizable terms of use agreement."; // Create options for all the parameters - command.AddOption(new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance")); - command.AddOption(new Option("--body")); + var agreementAcceptanceIdOption = new Option("--agreementacceptance-id", description: "key: id of agreementAcceptance"); + agreementAcceptanceIdOption.IsRequired = true; + command.AddOption(agreementAcceptanceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementAcceptanceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(agreementAcceptanceId)) requestInfo.PathParameters.Add("agreementAcceptance_id", agreementAcceptanceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -97,7 +111,7 @@ public AgreementAcceptanceRequestBuilder(Dictionary pathParamete RequestAdapter = requestAdapter; } /// - /// Delete navigation property agreementAcceptances for identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// Request headers /// Request options /// @@ -112,7 +126,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get agreementAcceptances from identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// Request headers /// Request options /// Request query parameters @@ -133,7 +147,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Update the navigation property agreementAcceptances in identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// /// Request headers /// Request options @@ -151,7 +165,7 @@ public RequestInformation CreatePatchRequestInformation(AgreementAcceptance body return requestInfo; } /// - /// Delete navigation property agreementAcceptances for identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +176,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get agreementAcceptances from identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +188,7 @@ public async Task GetAsync(Action q = d return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Update the navigation property agreementAcceptances in identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -186,7 +200,7 @@ public async Task PatchAsync(AgreementAcceptance model, ActionGet agreementAcceptances from identityGovernance + /// Represents the current status of a user's response to a company's customizable terms of use agreement. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/TermsOfUse/Agreements/AgreementsRequestBuilder.cs b/src/generated/IdentityGovernance/TermsOfUse/Agreements/AgreementsRequestBuilder.cs index de63acc3bf3..b0b81dfc489 100644 --- a/src/generated/IdentityGovernance/TermsOfUse/Agreements/AgreementsRequestBuilder.cs +++ b/src/generated/IdentityGovernance/TermsOfUse/Agreements/AgreementsRequestBuilder.cs @@ -30,18 +30,21 @@ public List BuildCommand() { return commands; } /// - /// Create new navigation property to agreements for identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create new navigation property to agreements for identityGovernance"; + command.Description = "Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD)."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -54,30 +57,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Get agreements from identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Get agreements from identityGovernance"; + command.Description = "Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD)."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -103,7 +126,7 @@ public AgreementsRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// Get agreements from identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// Request headers /// Request options /// Request query parameters @@ -124,7 +147,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Create new navigation property to agreements for identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// /// Request headers /// Request options @@ -142,7 +165,7 @@ public RequestInformation CreatePostRequestInformation(Agreement body, Action - /// Get agreements from identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -154,7 +177,7 @@ public async Task GetAsync(Action q = de return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Create new navigation property to agreements for identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// Cancellation token to use when cancelling requests /// Request headers /// @@ -166,7 +189,7 @@ public async Task PostAsync(Agreement model, Action(requestInfo, responseHandler, cancellationToken); } - /// Get agreements from identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/IdentityGovernance/TermsOfUse/Agreements/Item/AgreementRequestBuilder.cs b/src/generated/IdentityGovernance/TermsOfUse/Agreements/Item/AgreementRequestBuilder.cs index 0064bce53e8..58764751ab7 100644 --- a/src/generated/IdentityGovernance/TermsOfUse/Agreements/Item/AgreementRequestBuilder.cs +++ b/src/generated/IdentityGovernance/TermsOfUse/Agreements/Item/AgreementRequestBuilder.cs @@ -20,16 +20,18 @@ public class AgreementRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Delete navigation property agreements for identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete navigation property agreements for identityGovernance"; + command.Description = "Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD)."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); command.Handler = CommandHandler.Create(async (agreementId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -37,20 +39,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Get agreements from identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get agreements from identityGovernance"; + command.Description = "Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD)."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (agreementId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (agreementId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,20 +73,24 @@ public Command BuildGetCommand() { return command; } /// - /// Update the navigation property agreements in identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the navigation property agreements in identityGovernance"; + command.Description = "Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD)."; // Create options for all the parameters - command.AddOption(new Option("--agreement-id", description: "key: id of agreement")); - command.AddOption(new Option("--body")); + var agreementIdOption = new Option("--agreement-id", description: "key: id of agreement"); + agreementIdOption.IsRequired = true; + command.AddOption(agreementIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (agreementId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(agreementId)) requestInfo.PathParameters.Add("agreement_id", agreementId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -97,7 +111,7 @@ public AgreementRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// Delete navigation property agreements for identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// Request headers /// Request options /// @@ -112,7 +126,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Get agreements from identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// Request headers /// Request options /// Request query parameters @@ -133,7 +147,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Update the navigation property agreements in identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// /// Request headers /// Request options @@ -151,7 +165,7 @@ public RequestInformation CreatePatchRequestInformation(Agreement body, Action - /// Delete navigation property agreements for identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +176,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Get agreements from identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +188,7 @@ public async Task GetAsync(Action q = default, Ac return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Update the navigation property agreements in identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). /// Cancellation token to use when cancelling requests /// Request headers /// @@ -186,7 +200,7 @@ public async Task PatchAsync(Agreement model, Action var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// Get agreements from identityGovernance + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/IdentityGovernance/TermsOfUse/TermsOfUseRequestBuilder.cs b/src/generated/IdentityGovernance/TermsOfUse/TermsOfUseRequestBuilder.cs index dd64f766e58..508c423052c 100644 --- a/src/generated/IdentityGovernance/TermsOfUse/TermsOfUseRequestBuilder.cs +++ b/src/generated/IdentityGovernance/TermsOfUse/TermsOfUseRequestBuilder.cs @@ -43,7 +43,8 @@ public Command BuildDeleteCommand() { command.Description = "Delete navigation property termsOfUse for identityGovernance"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,12 +58,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get termsOfUse from identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,12 +89,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property termsOfUse in identityGovernance"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/IdentityProtection/IdentityProtectionRequestBuilder.cs b/src/generated/IdentityProtection/IdentityProtectionRequestBuilder.cs new file mode 100644 index 00000000000..0f544e8c924 --- /dev/null +++ b/src/generated/IdentityProtection/IdentityProtectionRequestBuilder.cs @@ -0,0 +1,178 @@ +using ApiSdk.IdentityProtection.RiskDetections; +using ApiSdk.IdentityProtection.RiskyUsers; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.IdentityProtection { + /// Builds and executes requests for operations under \identityProtection + public class IdentityProtectionRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Get identityProtection + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Get identityProtection"; + // Create options for all the parameters + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Update identityProtection + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Update identityProtection"; + // Create options for all the parameters + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + public Command BuildRiskDetectionsCommand() { + var command = new Command("risk-detections"); + var builder = new ApiSdk.IdentityProtection.RiskDetections.RiskDetectionsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + public Command BuildRiskyUsersCommand() { + var command = new Command("risky-users"); + var builder = new ApiSdk.IdentityProtection.RiskyUsers.RiskyUsersRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildConfirmCompromisedCommand()); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildDismissCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + /// + /// Instantiates a new IdentityProtectionRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public IdentityProtectionRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/identityProtection{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Get identityProtection + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Update identityProtection + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(ApiSdk.Models.Microsoft.Graph.IdentityProtection body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Get identityProtection + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Update identityProtection + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(ApiSdk.Models.Microsoft.Graph.IdentityProtection model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Get identityProtection + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/IdentityProtection/RiskDetections/Item/RiskDetectionRequestBuilder.cs b/src/generated/IdentityProtection/RiskDetections/Item/RiskDetectionRequestBuilder.cs new file mode 100644 index 00000000000..a5fb4cc70e0 --- /dev/null +++ b/src/generated/IdentityProtection/RiskDetections/Item/RiskDetectionRequestBuilder.cs @@ -0,0 +1,211 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.IdentityProtection.RiskDetections.Item { + /// Builds and executes requests for operations under \identityProtection\riskDetections\{riskDetection-id} + public class RiskDetectionRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Delete navigation property riskDetections for identityProtection + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Delete navigation property riskDetections for identityProtection"; + // Create options for all the parameters + var riskDetectionIdOption = new Option("--riskdetection-id", description: "key: id of riskDetection"); + riskDetectionIdOption.IsRequired = true; + command.AddOption(riskDetectionIdOption); + command.Handler = CommandHandler.Create(async (riskDetectionId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Get riskDetections from identityProtection + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Get riskDetections from identityProtection"; + // Create options for all the parameters + var riskDetectionIdOption = new Option("--riskdetection-id", description: "key: id of riskDetection"); + riskDetectionIdOption.IsRequired = true; + command.AddOption(riskDetectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (riskDetectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Update the navigation property riskDetections in identityProtection + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Update the navigation property riskDetections in identityProtection"; + // Create options for all the parameters + var riskDetectionIdOption = new Option("--riskdetection-id", description: "key: id of riskDetection"); + riskDetectionIdOption.IsRequired = true; + command.AddOption(riskDetectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (riskDetectionId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new RiskDetectionRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public RiskDetectionRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/identityProtection/riskDetections/{riskDetection_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Delete navigation property riskDetections for identityProtection + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Get riskDetections from identityProtection + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Update the navigation property riskDetections in identityProtection + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(RiskDetection body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Delete navigation property riskDetections for identityProtection + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Get riskDetections from identityProtection + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Update the navigation property riskDetections in identityProtection + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(RiskDetection model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Get riskDetections from identityProtection + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/IdentityProtection/RiskDetections/RiskDetectionsRequestBuilder.cs b/src/generated/IdentityProtection/RiskDetections/RiskDetectionsRequestBuilder.cs new file mode 100644 index 00000000000..a4e1220959b --- /dev/null +++ b/src/generated/IdentityProtection/RiskDetections/RiskDetectionsRequestBuilder.cs @@ -0,0 +1,212 @@ +using ApiSdk.IdentityProtection.RiskDetections.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.IdentityProtection.RiskDetections { + /// Builds and executes requests for operations under \identityProtection\riskDetections + public class RiskDetectionsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new RiskDetectionRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// Create new navigation property to riskDetections for identityProtection + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Create new navigation property to riskDetections for identityProtection"; + // Create options for all the parameters + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Get riskDetections from identityProtection + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Get riskDetections from identityProtection"; + // Create options for all the parameters + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new RiskDetectionsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public RiskDetectionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/identityProtection/riskDetections{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Get riskDetections from identityProtection + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Create new navigation property to riskDetections for identityProtection + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(RiskDetection body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Get riskDetections from identityProtection + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Create new navigation property to riskDetections for identityProtection + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(RiskDetection model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Get riskDetections from identityProtection + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/IdentityProtection/RiskDetections/RiskDetectionsResponse.cs b/src/generated/IdentityProtection/RiskDetections/RiskDetectionsResponse.cs new file mode 100644 index 00000000000..711b6877138 --- /dev/null +++ b/src/generated/IdentityProtection/RiskDetections/RiskDetectionsResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.IdentityProtection.RiskDetections { + public class RiskDetectionsResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new riskDetectionsResponse and sets the default values. + /// + public RiskDetectionsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as RiskDetectionsResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as RiskDetectionsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/IdentityProtection/RiskyUsers/ConfirmCompromised/ConfirmCompromisedRequestBody.cs b/src/generated/IdentityProtection/RiskyUsers/ConfirmCompromised/ConfirmCompromisedRequestBody.cs new file mode 100644 index 00000000000..d8d64a8452b --- /dev/null +++ b/src/generated/IdentityProtection/RiskyUsers/ConfirmCompromised/ConfirmCompromisedRequestBody.cs @@ -0,0 +1,35 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.IdentityProtection.RiskyUsers.ConfirmCompromised { + public class ConfirmCompromisedRequestBody : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public List UserIds { get; set; } + /// + /// Instantiates a new confirmCompromisedRequestBody and sets the default values. + /// + public ConfirmCompromisedRequestBody() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"userIds", (o,n) => { (o as ConfirmCompromisedRequestBody).UserIds = n.GetCollectionOfPrimitiveValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("userIds", UserIds); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/IdentityProtection/RiskyUsers/ConfirmCompromised/ConfirmCompromisedRequestBuilder.cs b/src/generated/IdentityProtection/RiskyUsers/ConfirmCompromised/ConfirmCompromisedRequestBuilder.cs new file mode 100644 index 00000000000..089424355d6 --- /dev/null +++ b/src/generated/IdentityProtection/RiskyUsers/ConfirmCompromised/ConfirmCompromisedRequestBuilder.cs @@ -0,0 +1,88 @@ +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.IdentityProtection.RiskyUsers.ConfirmCompromised { + /// Builds and executes requests for operations under \identityProtection\riskyUsers\microsoft.graph.confirmCompromised + public class ConfirmCompromisedRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action confirmCompromised + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action confirmCompromised"; + // Create options for all the parameters + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new ConfirmCompromisedRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public ConfirmCompromisedRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/identityProtection/riskyUsers/microsoft.graph.confirmCompromised"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action confirmCompromised + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(ConfirmCompromisedRequestBody body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action confirmCompromised + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(ConfirmCompromisedRequestBody model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + } +} diff --git a/src/generated/IdentityProtection/RiskyUsers/Dismiss/DismissRequestBody.cs b/src/generated/IdentityProtection/RiskyUsers/Dismiss/DismissRequestBody.cs new file mode 100644 index 00000000000..e61d5698e2d --- /dev/null +++ b/src/generated/IdentityProtection/RiskyUsers/Dismiss/DismissRequestBody.cs @@ -0,0 +1,35 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.IdentityProtection.RiskyUsers.Dismiss { + public class DismissRequestBody : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public List UserIds { get; set; } + /// + /// Instantiates a new dismissRequestBody and sets the default values. + /// + public DismissRequestBody() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"userIds", (o,n) => { (o as DismissRequestBody).UserIds = n.GetCollectionOfPrimitiveValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("userIds", UserIds); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/IdentityProtection/RiskyUsers/Dismiss/DismissRequestBuilder.cs b/src/generated/IdentityProtection/RiskyUsers/Dismiss/DismissRequestBuilder.cs new file mode 100644 index 00000000000..8308422c2ea --- /dev/null +++ b/src/generated/IdentityProtection/RiskyUsers/Dismiss/DismissRequestBuilder.cs @@ -0,0 +1,88 @@ +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.IdentityProtection.RiskyUsers.Dismiss { + /// Builds and executes requests for operations under \identityProtection\riskyUsers\microsoft.graph.dismiss + public class DismissRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Invoke action dismiss + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Invoke action dismiss"; + // Create options for all the parameters + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new DismissRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public DismissRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/identityProtection/riskyUsers/microsoft.graph.dismiss"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Invoke action dismiss + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(DismissRequestBody body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Invoke action dismiss + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(DismissRequestBody model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + } +} diff --git a/src/generated/IdentityProtection/RiskyUsers/Item/History/HistoryRequestBuilder.cs b/src/generated/IdentityProtection/RiskyUsers/Item/History/HistoryRequestBuilder.cs new file mode 100644 index 00000000000..7fc8df901a5 --- /dev/null +++ b/src/generated/IdentityProtection/RiskyUsers/Item/History/HistoryRequestBuilder.cs @@ -0,0 +1,218 @@ +using ApiSdk.IdentityProtection.RiskyUsers.Item.History.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.IdentityProtection.RiskyUsers.Item.History { + /// Builds and executes requests for operations under \identityProtection\riskyUsers\{riskyUser-id}\history + public class HistoryRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new RiskyUserHistoryItemRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// The activity related to user risk level change + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "The activity related to user risk level change"; + // Create options for all the parameters + var riskyUserIdOption = new Option("--riskyuser-id", description: "key: id of riskyUser"); + riskyUserIdOption.IsRequired = true; + command.AddOption(riskyUserIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (riskyUserId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// The activity related to user risk level change + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "The activity related to user risk level change"; + // Create options for all the parameters + var riskyUserIdOption = new Option("--riskyuser-id", description: "key: id of riskyUser"); + riskyUserIdOption.IsRequired = true; + command.AddOption(riskyUserIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (riskyUserId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new HistoryRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public HistoryRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/identityProtection/riskyUsers/{riskyUser_id}/history{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// The activity related to user risk level change + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The activity related to user risk level change + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(RiskyUserHistoryItem body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The activity related to user risk level change + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The activity related to user risk level change + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(RiskyUserHistoryItem model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// The activity related to user risk level change + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/IdentityProtection/RiskyUsers/Item/History/HistoryResponse.cs b/src/generated/IdentityProtection/RiskyUsers/Item/History/HistoryResponse.cs new file mode 100644 index 00000000000..a5edd158e75 --- /dev/null +++ b/src/generated/IdentityProtection/RiskyUsers/Item/History/HistoryResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.IdentityProtection.RiskyUsers.Item.History { + public class HistoryResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new historyResponse and sets the default values. + /// + public HistoryResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as HistoryResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as HistoryResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/IdentityProtection/RiskyUsers/Item/History/Item/RiskyUserHistoryItemRequestBuilder.cs b/src/generated/IdentityProtection/RiskyUsers/Item/History/Item/RiskyUserHistoryItemRequestBuilder.cs new file mode 100644 index 00000000000..f4f2be9ff40 --- /dev/null +++ b/src/generated/IdentityProtection/RiskyUsers/Item/History/Item/RiskyUserHistoryItemRequestBuilder.cs @@ -0,0 +1,220 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.IdentityProtection.RiskyUsers.Item.History.Item { + /// Builds and executes requests for operations under \identityProtection\riskyUsers\{riskyUser-id}\history\{riskyUserHistoryItem-id} + public class RiskyUserHistoryItemRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// The activity related to user risk level change + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "The activity related to user risk level change"; + // Create options for all the parameters + var riskyUserIdOption = new Option("--riskyuser-id", description: "key: id of riskyUser"); + riskyUserIdOption.IsRequired = true; + command.AddOption(riskyUserIdOption); + var riskyUserHistoryItemIdOption = new Option("--riskyuserhistoryitem-id", description: "key: id of riskyUserHistoryItem"); + riskyUserHistoryItemIdOption.IsRequired = true; + command.AddOption(riskyUserHistoryItemIdOption); + command.Handler = CommandHandler.Create(async (riskyUserId, riskyUserHistoryItemId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The activity related to user risk level change + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "The activity related to user risk level change"; + // Create options for all the parameters + var riskyUserIdOption = new Option("--riskyuser-id", description: "key: id of riskyUser"); + riskyUserIdOption.IsRequired = true; + command.AddOption(riskyUserIdOption); + var riskyUserHistoryItemIdOption = new Option("--riskyuserhistoryitem-id", description: "key: id of riskyUserHistoryItem"); + riskyUserHistoryItemIdOption.IsRequired = true; + command.AddOption(riskyUserHistoryItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (riskyUserId, riskyUserHistoryItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// The activity related to user risk level change + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "The activity related to user risk level change"; + // Create options for all the parameters + var riskyUserIdOption = new Option("--riskyuser-id", description: "key: id of riskyUser"); + riskyUserIdOption.IsRequired = true; + command.AddOption(riskyUserIdOption); + var riskyUserHistoryItemIdOption = new Option("--riskyuserhistoryitem-id", description: "key: id of riskyUserHistoryItem"); + riskyUserHistoryItemIdOption.IsRequired = true; + command.AddOption(riskyUserHistoryItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (riskyUserId, riskyUserHistoryItemId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new RiskyUserHistoryItemRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public RiskyUserHistoryItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/identityProtection/riskyUsers/{riskyUser_id}/history/{riskyUserHistoryItem_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// The activity related to user risk level change + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The activity related to user risk level change + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The activity related to user risk level change + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(RiskyUserHistoryItem body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The activity related to user risk level change + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The activity related to user risk level change + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The activity related to user risk level change + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(RiskyUserHistoryItem model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// The activity related to user risk level change + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/IdentityProtection/RiskyUsers/Item/RiskyUserRequestBuilder.cs b/src/generated/IdentityProtection/RiskyUsers/Item/RiskyUserRequestBuilder.cs new file mode 100644 index 00000000000..4dbaa9d5134 --- /dev/null +++ b/src/generated/IdentityProtection/RiskyUsers/Item/RiskyUserRequestBuilder.cs @@ -0,0 +1,219 @@ +using ApiSdk.IdentityProtection.RiskyUsers.Item.History; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.IdentityProtection.RiskyUsers.Item { + /// Builds and executes requests for operations under \identityProtection\riskyUsers\{riskyUser-id} + public class RiskyUserRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Delete navigation property riskyUsers for identityProtection + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Delete navigation property riskyUsers for identityProtection"; + // Create options for all the parameters + var riskyUserIdOption = new Option("--riskyuser-id", description: "key: id of riskyUser"); + riskyUserIdOption.IsRequired = true; + command.AddOption(riskyUserIdOption); + command.Handler = CommandHandler.Create(async (riskyUserId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Get riskyUsers from identityProtection + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Get riskyUsers from identityProtection"; + // Create options for all the parameters + var riskyUserIdOption = new Option("--riskyuser-id", description: "key: id of riskyUser"); + riskyUserIdOption.IsRequired = true; + command.AddOption(riskyUserIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (riskyUserId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + public Command BuildHistoryCommand() { + var command = new Command("history"); + var builder = new ApiSdk.IdentityProtection.RiskyUsers.Item.History.HistoryRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + /// + /// Update the navigation property riskyUsers in identityProtection + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Update the navigation property riskyUsers in identityProtection"; + // Create options for all the parameters + var riskyUserIdOption = new Option("--riskyuser-id", description: "key: id of riskyUser"); + riskyUserIdOption.IsRequired = true; + command.AddOption(riskyUserIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (riskyUserId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new RiskyUserRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public RiskyUserRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/identityProtection/riskyUsers/{riskyUser_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Delete navigation property riskyUsers for identityProtection + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Get riskyUsers from identityProtection + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Update the navigation property riskyUsers in identityProtection + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(RiskyUser body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Delete navigation property riskyUsers for identityProtection + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Get riskyUsers from identityProtection + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Update the navigation property riskyUsers in identityProtection + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(RiskyUser model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Get riskyUsers from identityProtection + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/IdentityProtection/RiskyUsers/RiskyUsersRequestBuilder.cs b/src/generated/IdentityProtection/RiskyUsers/RiskyUsersRequestBuilder.cs new file mode 100644 index 00000000000..3e1399d57b9 --- /dev/null +++ b/src/generated/IdentityProtection/RiskyUsers/RiskyUsersRequestBuilder.cs @@ -0,0 +1,227 @@ +using ApiSdk.IdentityProtection.RiskyUsers.ConfirmCompromised; +using ApiSdk.IdentityProtection.RiskyUsers.Dismiss; +using ApiSdk.IdentityProtection.RiskyUsers.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.IdentityProtection.RiskyUsers { + /// Builds and executes requests for operations under \identityProtection\riskyUsers + public class RiskyUsersRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new RiskyUserRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildHistoryCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + public Command BuildConfirmCompromisedCommand() { + var command = new Command("confirm-compromised"); + var builder = new ApiSdk.IdentityProtection.RiskyUsers.ConfirmCompromised.ConfirmCompromisedRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + /// + /// Create new navigation property to riskyUsers for identityProtection + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Create new navigation property to riskyUsers for identityProtection"; + // Create options for all the parameters + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + public Command BuildDismissCommand() { + var command = new Command("dismiss"); + var builder = new ApiSdk.IdentityProtection.RiskyUsers.Dismiss.DismissRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + /// + /// Get riskyUsers from identityProtection + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Get riskyUsers from identityProtection"; + // Create options for all the parameters + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new RiskyUsersRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public RiskyUsersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/identityProtection/riskyUsers{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Get riskyUsers from identityProtection + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Create new navigation property to riskyUsers for identityProtection + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(RiskyUser body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Get riskyUsers from identityProtection + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Create new navigation property to riskyUsers for identityProtection + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(RiskyUser model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Get riskyUsers from identityProtection + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/IdentityProtection/RiskyUsers/RiskyUsersResponse.cs b/src/generated/IdentityProtection/RiskyUsers/RiskyUsersResponse.cs new file mode 100644 index 00000000000..f3c6d904917 --- /dev/null +++ b/src/generated/IdentityProtection/RiskyUsers/RiskyUsersResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.IdentityProtection.RiskyUsers { + public class RiskyUsersResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new riskyUsersResponse and sets the default values. + /// + public RiskyUsersResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as RiskyUsersResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as RiskyUsersResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/IdentityProviders/AvailableProviderTypes/AvailableProviderTypesRequestBuilder.cs b/src/generated/IdentityProviders/AvailableProviderTypes/AvailableProviderTypesRequestBuilder.cs index 05d5f818cf2..67062ca9a74 100644 --- a/src/generated/IdentityProviders/AvailableProviderTypes/AvailableProviderTypesRequestBuilder.cs +++ b/src/generated/IdentityProviders/AvailableProviderTypes/AvailableProviderTypesRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function availableProviderTypes"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityProviders/IdentityProvidersRequestBuilder.cs b/src/generated/IdentityProviders/IdentityProvidersRequestBuilder.cs index 4f234f825c5..5b9c1fd3de9 100644 --- a/src/generated/IdentityProviders/IdentityProvidersRequestBuilder.cs +++ b/src/generated/IdentityProviders/IdentityProvidersRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to identityProviders"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,24 +70,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from identityProviders"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/IdentityProviders/Item/IdentityProviderRequestBuilder.cs b/src/generated/IdentityProviders/Item/IdentityProviderRequestBuilder.cs index d5a6cdbed8c..96ef3d6d4e3 100644 --- a/src/generated/IdentityProviders/Item/IdentityProviderRequestBuilder.cs +++ b/src/generated/IdentityProviders/Item/IdentityProviderRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from identityProviders"; // Create options for all the parameters - command.AddOption(new Option("--identityprovider-id", description: "key: id of identityProvider")); + var identityProviderIdOption = new Option("--identityprovider-id", description: "key: id of identityProvider"); + identityProviderIdOption.IsRequired = true; + command.AddOption(identityProviderIdOption); command.Handler = CommandHandler.Create(async (identityProviderId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(identityProviderId)) requestInfo.PathParameters.Add("identityProvider_id", identityProviderId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from identityProviders by key"; // Create options for all the parameters - command.AddOption(new Option("--identityprovider-id", description: "key: id of identityProvider")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (identityProviderId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(identityProviderId)) requestInfo.PathParameters.Add("identityProvider_id", identityProviderId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var identityProviderIdOption = new Option("--identityprovider-id", description: "key: id of identityProvider"); + identityProviderIdOption.IsRequired = true; + command.AddOption(identityProviderIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (identityProviderId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in identityProviders"; // Create options for all the parameters - command.AddOption(new Option("--identityprovider-id", description: "key: id of identityProvider")); - command.AddOption(new Option("--body")); + var identityProviderIdOption = new Option("--identityprovider-id", description: "key: id of identityProvider"); + identityProviderIdOption.IsRequired = true; + command.AddOption(identityProviderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (identityProviderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(identityProviderId)) requestInfo.PathParameters.Add("identityProvider_id", identityProviderId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/InformationProtection/Bitlocker/BitlockerRequestBuilder.cs b/src/generated/InformationProtection/Bitlocker/BitlockerRequestBuilder.cs index 96f56c10620..a1440226824 100644 --- a/src/generated/InformationProtection/Bitlocker/BitlockerRequestBuilder.cs +++ b/src/generated/InformationProtection/Bitlocker/BitlockerRequestBuilder.cs @@ -28,7 +28,8 @@ public Command BuildDeleteCommand() { command.Description = "Delete navigation property bitlocker for informationProtection"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,12 +43,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get bitlocker from informationProtection"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,12 +74,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property bitlocker in informationProtection"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/InformationProtection/Bitlocker/RecoveryKeys/Item/BitlockerRecoveryKeyRequestBuilder.cs b/src/generated/InformationProtection/Bitlocker/RecoveryKeys/Item/BitlockerRecoveryKeyRequestBuilder.cs index 829140c6b39..733ef8e6f6f 100644 --- a/src/generated/InformationProtection/Bitlocker/RecoveryKeys/Item/BitlockerRecoveryKeyRequestBuilder.cs +++ b/src/generated/InformationProtection/Bitlocker/RecoveryKeys/Item/BitlockerRecoveryKeyRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The recovery keys associated with the bitlocker entity."; // Create options for all the parameters - command.AddOption(new Option("--bitlockerrecoverykey-id", description: "key: id of bitlockerRecoveryKey")); + var bitlockerRecoveryKeyIdOption = new Option("--bitlockerrecoverykey-id", description: "key: id of bitlockerRecoveryKey"); + bitlockerRecoveryKeyIdOption.IsRequired = true; + command.AddOption(bitlockerRecoveryKeyIdOption); command.Handler = CommandHandler.Create(async (bitlockerRecoveryKeyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(bitlockerRecoveryKeyId)) requestInfo.PathParameters.Add("bitlockerRecoveryKey_id", bitlockerRecoveryKeyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The recovery keys associated with the bitlocker entity."; // Create options for all the parameters - command.AddOption(new Option("--bitlockerrecoverykey-id", description: "key: id of bitlockerRecoveryKey")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (bitlockerRecoveryKeyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(bitlockerRecoveryKeyId)) requestInfo.PathParameters.Add("bitlockerRecoveryKey_id", bitlockerRecoveryKeyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var bitlockerRecoveryKeyIdOption = new Option("--bitlockerrecoverykey-id", description: "key: id of bitlockerRecoveryKey"); + bitlockerRecoveryKeyIdOption.IsRequired = true; + command.AddOption(bitlockerRecoveryKeyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bitlockerRecoveryKeyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The recovery keys associated with the bitlocker entity."; // Create options for all the parameters - command.AddOption(new Option("--bitlockerrecoverykey-id", description: "key: id of bitlockerRecoveryKey")); - command.AddOption(new Option("--body")); + var bitlockerRecoveryKeyIdOption = new Option("--bitlockerrecoverykey-id", description: "key: id of bitlockerRecoveryKey"); + bitlockerRecoveryKeyIdOption.IsRequired = true; + command.AddOption(bitlockerRecoveryKeyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (bitlockerRecoveryKeyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(bitlockerRecoveryKeyId)) requestInfo.PathParameters.Add("bitlockerRecoveryKey_id", bitlockerRecoveryKeyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/InformationProtection/Bitlocker/RecoveryKeys/RecoveryKeysRequestBuilder.cs b/src/generated/InformationProtection/Bitlocker/RecoveryKeys/RecoveryKeysRequestBuilder.cs index 1910081587e..42e1f4711e7 100644 --- a/src/generated/InformationProtection/Bitlocker/RecoveryKeys/RecoveryKeysRequestBuilder.cs +++ b/src/generated/InformationProtection/Bitlocker/RecoveryKeys/RecoveryKeysRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The recovery keys associated with the bitlocker entity."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The recovery keys associated with the bitlocker entity."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/InformationProtection/InformationProtectionRequestBuilder.cs b/src/generated/InformationProtection/InformationProtectionRequestBuilder.cs index ccc45905824..e23bcdc6d78 100644 --- a/src/generated/InformationProtection/InformationProtectionRequestBuilder.cs +++ b/src/generated/InformationProtection/InformationProtectionRequestBuilder.cs @@ -37,12 +37,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get informationProtection"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,12 +68,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update informationProtection"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/InformationProtection/ThreatAssessmentRequests/Item/Results/Item/ThreatAssessmentResultRequestBuilder.cs b/src/generated/InformationProtection/ThreatAssessmentRequests/Item/Results/Item/ThreatAssessmentResultRequestBuilder.cs index 0daa16aac7a..87bcd4044e4 100644 --- a/src/generated/InformationProtection/ThreatAssessmentRequests/Item/Results/Item/ThreatAssessmentResultRequestBuilder.cs +++ b/src/generated/InformationProtection/ThreatAssessmentRequests/Item/Results/Item/ThreatAssessmentResultRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of threat assessment results. Read-only. By default, a GET /threatAssessmentRequests/{id} does not return this property unless you apply $expand on it."; // Create options for all the parameters - command.AddOption(new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest")); - command.AddOption(new Option("--threatassessmentresult-id", description: "key: id of threatAssessmentResult")); + var threatAssessmentRequestIdOption = new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest"); + threatAssessmentRequestIdOption.IsRequired = true; + command.AddOption(threatAssessmentRequestIdOption); + var threatAssessmentResultIdOption = new Option("--threatassessmentresult-id", description: "key: id of threatAssessmentResult"); + threatAssessmentResultIdOption.IsRequired = true; + command.AddOption(threatAssessmentResultIdOption); command.Handler = CommandHandler.Create(async (threatAssessmentRequestId, threatAssessmentResultId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(threatAssessmentRequestId)) requestInfo.PathParameters.Add("threatAssessmentRequest_id", threatAssessmentRequestId); - if (!String.IsNullOrEmpty(threatAssessmentResultId)) requestInfo.PathParameters.Add("threatAssessmentResult_id", threatAssessmentResultId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of threat assessment results. Read-only. By default, a GET /threatAssessmentRequests/{id} does not return this property unless you apply $expand on it."; // Create options for all the parameters - command.AddOption(new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest")); - command.AddOption(new Option("--threatassessmentresult-id", description: "key: id of threatAssessmentResult")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (threatAssessmentRequestId, threatAssessmentResultId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(threatAssessmentRequestId)) requestInfo.PathParameters.Add("threatAssessmentRequest_id", threatAssessmentRequestId); - if (!String.IsNullOrEmpty(threatAssessmentResultId)) requestInfo.PathParameters.Add("threatAssessmentResult_id", threatAssessmentResultId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var threatAssessmentRequestIdOption = new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest"); + threatAssessmentRequestIdOption.IsRequired = true; + command.AddOption(threatAssessmentRequestIdOption); + var threatAssessmentResultIdOption = new Option("--threatassessmentresult-id", description: "key: id of threatAssessmentResult"); + threatAssessmentResultIdOption.IsRequired = true; + command.AddOption(threatAssessmentResultIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (threatAssessmentRequestId, threatAssessmentResultId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of threat assessment results. Read-only. By default, a GET /threatAssessmentRequests/{id} does not return this property unless you apply $expand on it."; // Create options for all the parameters - command.AddOption(new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest")); - command.AddOption(new Option("--threatassessmentresult-id", description: "key: id of threatAssessmentResult")); - command.AddOption(new Option("--body")); + var threatAssessmentRequestIdOption = new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest"); + threatAssessmentRequestIdOption.IsRequired = true; + command.AddOption(threatAssessmentRequestIdOption); + var threatAssessmentResultIdOption = new Option("--threatassessmentresult-id", description: "key: id of threatAssessmentResult"); + threatAssessmentResultIdOption.IsRequired = true; + command.AddOption(threatAssessmentResultIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (threatAssessmentRequestId, threatAssessmentResultId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(threatAssessmentRequestId)) requestInfo.PathParameters.Add("threatAssessmentRequest_id", threatAssessmentRequestId); - if (!String.IsNullOrEmpty(threatAssessmentResultId)) requestInfo.PathParameters.Add("threatAssessmentResult_id", threatAssessmentResultId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/InformationProtection/ThreatAssessmentRequests/Item/Results/ResultsRequestBuilder.cs b/src/generated/InformationProtection/ThreatAssessmentRequests/Item/Results/ResultsRequestBuilder.cs index 73d83dc3dd1..bcee04d4398 100644 --- a/src/generated/InformationProtection/ThreatAssessmentRequests/Item/Results/ResultsRequestBuilder.cs +++ b/src/generated/InformationProtection/ThreatAssessmentRequests/Item/Results/ResultsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of threat assessment results. Read-only. By default, a GET /threatAssessmentRequests/{id} does not return this property unless you apply $expand on it."; // Create options for all the parameters - command.AddOption(new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest")); - command.AddOption(new Option("--body")); + var threatAssessmentRequestIdOption = new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest"); + threatAssessmentRequestIdOption.IsRequired = true; + command.AddOption(threatAssessmentRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (threatAssessmentRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(threatAssessmentRequestId)) requestInfo.PathParameters.Add("threatAssessmentRequest_id", threatAssessmentRequestId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of threat assessment results. Read-only. By default, a GET /threatAssessmentRequests/{id} does not return this property unless you apply $expand on it."; // Create options for all the parameters - command.AddOption(new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (threatAssessmentRequestId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(threatAssessmentRequestId)) requestInfo.PathParameters.Add("threatAssessmentRequest_id", threatAssessmentRequestId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var threatAssessmentRequestIdOption = new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest"); + threatAssessmentRequestIdOption.IsRequired = true; + command.AddOption(threatAssessmentRequestIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (threatAssessmentRequestId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/InformationProtection/ThreatAssessmentRequests/Item/ThreatAssessmentRequestRequestBuilder.cs b/src/generated/InformationProtection/ThreatAssessmentRequests/Item/ThreatAssessmentRequestRequestBuilder.cs index efe2595572c..7eb10d4f77e 100644 --- a/src/generated/InformationProtection/ThreatAssessmentRequests/Item/ThreatAssessmentRequestRequestBuilder.cs +++ b/src/generated/InformationProtection/ThreatAssessmentRequests/Item/ThreatAssessmentRequestRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property threatAssessmentRequests for informationProtection"; // Create options for all the parameters - command.AddOption(new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest")); + var threatAssessmentRequestIdOption = new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest"); + threatAssessmentRequestIdOption.IsRequired = true; + command.AddOption(threatAssessmentRequestIdOption); command.Handler = CommandHandler.Create(async (threatAssessmentRequestId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(threatAssessmentRequestId)) requestInfo.PathParameters.Add("threatAssessmentRequest_id", threatAssessmentRequestId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get threatAssessmentRequests from informationProtection"; // Create options for all the parameters - command.AddOption(new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (threatAssessmentRequestId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(threatAssessmentRequestId)) requestInfo.PathParameters.Add("threatAssessmentRequest_id", threatAssessmentRequestId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var threatAssessmentRequestIdOption = new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest"); + threatAssessmentRequestIdOption.IsRequired = true; + command.AddOption(threatAssessmentRequestIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (threatAssessmentRequestId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,14 +80,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property threatAssessmentRequests in informationProtection"; // Create options for all the parameters - command.AddOption(new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest")); - command.AddOption(new Option("--body")); + var threatAssessmentRequestIdOption = new Option("--threatassessmentrequest-id", description: "key: id of threatAssessmentRequest"); + threatAssessmentRequestIdOption.IsRequired = true; + command.AddOption(threatAssessmentRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (threatAssessmentRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(threatAssessmentRequestId)) requestInfo.PathParameters.Add("threatAssessmentRequest_id", threatAssessmentRequestId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/InformationProtection/ThreatAssessmentRequests/ThreatAssessmentRequestsRequestBuilder.cs b/src/generated/InformationProtection/ThreatAssessmentRequests/ThreatAssessmentRequestsRequestBuilder.cs index 33769684827..873a6a77a2a 100644 --- a/src/generated/InformationProtection/ThreatAssessmentRequests/ThreatAssessmentRequestsRequestBuilder.cs +++ b/src/generated/InformationProtection/ThreatAssessmentRequests/ThreatAssessmentRequestsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to threatAssessmentRequests for informationProtection"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get threatAssessmentRequests from informationProtection"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Invitations/InvitationsRequestBuilder.cs b/src/generated/Invitations/InvitationsRequestBuilder.cs index 7d2e346e0b8..321d7a93bdb 100644 --- a/src/generated/Invitations/InvitationsRequestBuilder.cs +++ b/src/generated/Invitations/InvitationsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to invitations"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from invitations"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Invitations/Item/InvitationRequestBuilder.cs b/src/generated/Invitations/Item/InvitationRequestBuilder.cs index f2472a18558..b113eaf9ee9 100644 --- a/src/generated/Invitations/Item/InvitationRequestBuilder.cs +++ b/src/generated/Invitations/Item/InvitationRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from invitations"; // Create options for all the parameters - command.AddOption(new Option("--invitation-id", description: "key: id of invitation")); + var invitationIdOption = new Option("--invitation-id", description: "key: id of invitation"); + invitationIdOption.IsRequired = true; + command.AddOption(invitationIdOption); command.Handler = CommandHandler.Create(async (invitationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(invitationId)) requestInfo.PathParameters.Add("invitation_id", invitationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from invitations by key"; // Create options for all the parameters - command.AddOption(new Option("--invitation-id", description: "key: id of invitation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (invitationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(invitationId)) requestInfo.PathParameters.Add("invitation_id", invitationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var invitationIdOption = new Option("--invitation-id", description: "key: id of invitation"); + invitationIdOption.IsRequired = true; + command.AddOption(invitationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (invitationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in invitations"; // Create options for all the parameters - command.AddOption(new Option("--invitation-id", description: "key: id of invitation")); - command.AddOption(new Option("--body")); + var invitationIdOption = new Option("--invitation-id", description: "key: id of invitation"); + invitationIdOption.IsRequired = true; + command.AddOption(invitationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (invitationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(invitationId)) requestInfo.PathParameters.Add("invitation_id", invitationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Invitations/Item/InvitedUser/@Ref/RefRequestBuilder.cs b/src/generated/Invitations/Item/InvitedUser/@Ref/RefRequestBuilder.cs index 2b069bdf79e..9edbf8e4ef7 100644 --- a/src/generated/Invitations/Item/InvitedUser/@Ref/RefRequestBuilder.cs +++ b/src/generated/Invitations/Item/InvitedUser/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user created as part of the invitation creation. Read-Only"; // Create options for all the parameters - command.AddOption(new Option("--invitation-id", description: "key: id of invitation")); + var invitationIdOption = new Option("--invitation-id", description: "key: id of invitation"); + invitationIdOption.IsRequired = true; + command.AddOption(invitationIdOption); command.Handler = CommandHandler.Create(async (invitationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(invitationId)) requestInfo.PathParameters.Add("invitation_id", invitationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user created as part of the invitation creation. Read-Only"; // Create options for all the parameters - command.AddOption(new Option("--invitation-id", description: "key: id of invitation")); + var invitationIdOption = new Option("--invitation-id", description: "key: id of invitation"); + invitationIdOption.IsRequired = true; + command.AddOption(invitationIdOption); command.Handler = CommandHandler.Create(async (invitationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(invitationId)) requestInfo.PathParameters.Add("invitation_id", invitationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The user created as part of the invitation creation. Read-Only"; // Create options for all the parameters - command.AddOption(new Option("--invitation-id", description: "key: id of invitation")); - command.AddOption(new Option("--body")); + var invitationIdOption = new Option("--invitation-id", description: "key: id of invitation"); + invitationIdOption.IsRequired = true; + command.AddOption(invitationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (invitationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(invitationId)) requestInfo.PathParameters.Add("invitation_id", invitationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Invitations/Item/InvitedUser/InvitedUserRequestBuilder.cs b/src/generated/Invitations/Item/InvitedUser/InvitedUserRequestBuilder.cs index 39ff5c52e16..41c70b17a19 100644 --- a/src/generated/Invitations/Item/InvitedUser/InvitedUserRequestBuilder.cs +++ b/src/generated/Invitations/Item/InvitedUser/InvitedUserRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user created as part of the invitation creation. Read-Only"; // Create options for all the parameters - command.AddOption(new Option("--invitation-id", description: "key: id of invitation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (invitationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(invitationId)) requestInfo.PathParameters.Add("invitation_id", invitationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var invitationIdOption = new Option("--invitation-id", description: "key: id of invitation"); + invitationIdOption.IsRequired = true; + command.AddOption(invitationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (invitationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Localizations/Item/OrganizationalBrandingLocalizationRequestBuilder.cs b/src/generated/Localizations/Item/OrganizationalBrandingLocalizationRequestBuilder.cs index c80d07c3db0..82c46454f4a 100644 --- a/src/generated/Localizations/Item/OrganizationalBrandingLocalizationRequestBuilder.cs +++ b/src/generated/Localizations/Item/OrganizationalBrandingLocalizationRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from localizations"; // Create options for all the parameters - command.AddOption(new Option("--organizationalbrandinglocalization-id", description: "key: id of organizationalBrandingLocalization")); + var organizationalBrandingLocalizationIdOption = new Option("--organizationalbrandinglocalization-id", description: "key: id of organizationalBrandingLocalization"); + organizationalBrandingLocalizationIdOption.IsRequired = true; + command.AddOption(organizationalBrandingLocalizationIdOption); command.Handler = CommandHandler.Create(async (organizationalBrandingLocalizationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(organizationalBrandingLocalizationId)) requestInfo.PathParameters.Add("organizationalBrandingLocalization_id", organizationalBrandingLocalizationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from localizations by key"; // Create options for all the parameters - command.AddOption(new Option("--organizationalbrandinglocalization-id", description: "key: id of organizationalBrandingLocalization")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (organizationalBrandingLocalizationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(organizationalBrandingLocalizationId)) requestInfo.PathParameters.Add("organizationalBrandingLocalization_id", organizationalBrandingLocalizationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var organizationalBrandingLocalizationIdOption = new Option("--organizationalbrandinglocalization-id", description: "key: id of organizationalBrandingLocalization"); + organizationalBrandingLocalizationIdOption.IsRequired = true; + command.AddOption(organizationalBrandingLocalizationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (organizationalBrandingLocalizationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in localizations"; // Create options for all the parameters - command.AddOption(new Option("--organizationalbrandinglocalization-id", description: "key: id of organizationalBrandingLocalization")); - command.AddOption(new Option("--body")); + var organizationalBrandingLocalizationIdOption = new Option("--organizationalbrandinglocalization-id", description: "key: id of organizationalBrandingLocalization"); + organizationalBrandingLocalizationIdOption.IsRequired = true; + command.AddOption(organizationalBrandingLocalizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (organizationalBrandingLocalizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(organizationalBrandingLocalizationId)) requestInfo.PathParameters.Add("organizationalBrandingLocalization_id", organizationalBrandingLocalizationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Localizations/LocalizationsRequestBuilder.cs b/src/generated/Localizations/LocalizationsRequestBuilder.cs index 08e6aca8e2c..116ee565f4e 100644 --- a/src/generated/Localizations/LocalizationsRequestBuilder.cs +++ b/src/generated/Localizations/LocalizationsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to localizations"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from localizations"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Activities/ActivitiesRequestBuilder.cs b/src/generated/Me/Activities/ActivitiesRequestBuilder.cs index f6f89c0d209..f1466c1f1cc 100644 --- a/src/generated/Me/Activities/ActivitiesRequestBuilder.cs +++ b/src/generated/Me/Activities/ActivitiesRequestBuilder.cs @@ -38,12 +38,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The user's activities across devices. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +65,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The user's activities across devices. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Activities/Item/HistoryItems/HistoryItemsRequestBuilder.cs b/src/generated/Me/Activities/Item/HistoryItems/HistoryItemsRequestBuilder.cs index f996570ebf9..7609c1cfee6 100644 --- a/src/generated/Me/Activities/Item/HistoryItems/HistoryItemsRequestBuilder.cs +++ b/src/generated/Me/Activities/Item/HistoryItems/HistoryItemsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the activity's historyItems."; // Create options for all the parameters - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--body")); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userActivityId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the activity's historyItems."; // Create options for all the parameters - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userActivityId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userActivityId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Activities/Item/HistoryItems/Item/Activity/@Ref/RefRequestBuilder.cs b/src/generated/Me/Activities/Item/HistoryItems/Item/Activity/@Ref/RefRequestBuilder.cs index 28b28e0ec52..03ce5bf1fc5 100644 --- a/src/generated/Me/Activities/Item/HistoryItems/Item/Activity/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/Activities/Item/HistoryItems/Item/Activity/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the associated activity."; // Create options for all the parameters - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem")); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var activityHistoryItemIdOption = new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem"); + activityHistoryItemIdOption.IsRequired = true; + command.AddOption(activityHistoryItemIdOption); command.Handler = CommandHandler.Create(async (userActivityId, activityHistoryItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - if (!String.IsNullOrEmpty(activityHistoryItemId)) requestInfo.PathParameters.Add("activityHistoryItem_id", activityHistoryItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the associated activity."; // Create options for all the parameters - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem")); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var activityHistoryItemIdOption = new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem"); + activityHistoryItemIdOption.IsRequired = true; + command.AddOption(activityHistoryItemIdOption); command.Handler = CommandHandler.Create(async (userActivityId, activityHistoryItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - if (!String.IsNullOrEmpty(activityHistoryItemId)) requestInfo.PathParameters.Add("activityHistoryItem_id", activityHistoryItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the associated activity."; // Create options for all the parameters - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem")); - command.AddOption(new Option("--body")); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var activityHistoryItemIdOption = new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem"); + activityHistoryItemIdOption.IsRequired = true; + command.AddOption(activityHistoryItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userActivityId, activityHistoryItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - if (!String.IsNullOrEmpty(activityHistoryItemId)) requestInfo.PathParameters.Add("activityHistoryItem_id", activityHistoryItemId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Activities/Item/HistoryItems/Item/Activity/ActivityRequestBuilder.cs b/src/generated/Me/Activities/Item/HistoryItems/Item/Activity/ActivityRequestBuilder.cs index 197b8c26dfb..c40ac2f198a 100644 --- a/src/generated/Me/Activities/Item/HistoryItems/Item/Activity/ActivityRequestBuilder.cs +++ b/src/generated/Me/Activities/Item/HistoryItems/Item/Activity/ActivityRequestBuilder.cs @@ -27,16 +27,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the associated activity."; // Create options for all the parameters - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userActivityId, activityHistoryItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - if (!String.IsNullOrEmpty(activityHistoryItemId)) requestInfo.PathParameters.Add("activityHistoryItem_id", activityHistoryItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var activityHistoryItemIdOption = new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem"); + activityHistoryItemIdOption.IsRequired = true; + command.AddOption(activityHistoryItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userActivityId, activityHistoryItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Activities/Item/HistoryItems/Item/ActivityHistoryItemRequestBuilder.cs b/src/generated/Me/Activities/Item/HistoryItems/Item/ActivityHistoryItemRequestBuilder.cs index 5287374af57..a1c29c29310 100644 --- a/src/generated/Me/Activities/Item/HistoryItems/Item/ActivityHistoryItemRequestBuilder.cs +++ b/src/generated/Me/Activities/Item/HistoryItems/Item/ActivityHistoryItemRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the activity's historyItems."; // Create options for all the parameters - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem")); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var activityHistoryItemIdOption = new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem"); + activityHistoryItemIdOption.IsRequired = true; + command.AddOption(activityHistoryItemIdOption); command.Handler = CommandHandler.Create(async (userActivityId, activityHistoryItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - if (!String.IsNullOrEmpty(activityHistoryItemId)) requestInfo.PathParameters.Add("activityHistoryItem_id", activityHistoryItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the activity's historyItems."; // Create options for all the parameters - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userActivityId, activityHistoryItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - if (!String.IsNullOrEmpty(activityHistoryItemId)) requestInfo.PathParameters.Add("activityHistoryItem_id", activityHistoryItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var activityHistoryItemIdOption = new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem"); + activityHistoryItemIdOption.IsRequired = true; + command.AddOption(activityHistoryItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userActivityId, activityHistoryItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the activity's historyItems."; // Create options for all the parameters - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem")); - command.AddOption(new Option("--body")); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var activityHistoryItemIdOption = new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem"); + activityHistoryItemIdOption.IsRequired = true; + command.AddOption(activityHistoryItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userActivityId, activityHistoryItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - if (!String.IsNullOrEmpty(activityHistoryItemId)) requestInfo.PathParameters.Add("activityHistoryItem_id", activityHistoryItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Activities/Item/UserActivityRequestBuilder.cs b/src/generated/Me/Activities/Item/UserActivityRequestBuilder.cs index 049743f594f..52101eed48e 100644 --- a/src/generated/Me/Activities/Item/UserActivityRequestBuilder.cs +++ b/src/generated/Me/Activities/Item/UserActivityRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's activities across devices. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); command.Handler = CommandHandler.Create(async (userActivityId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's activities across devices. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userActivityId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userActivityId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's activities across devices. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--body")); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userActivityId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Activities/Recent/RecentRequestBuilder.cs b/src/generated/Me/Activities/Recent/RecentRequestBuilder.cs index 401d15acb7f..d684275603e 100644 --- a/src/generated/Me/Activities/Recent/RecentRequestBuilder.cs +++ b/src/generated/Me/Activities/Recent/RecentRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function recent"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/AgreementAcceptances/@Ref/RefRequestBuilder.cs b/src/generated/Me/AgreementAcceptances/@Ref/RefRequestBuilder.cs index b982a3772b1..a252903faed 100644 --- a/src/generated/Me/AgreementAcceptances/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/AgreementAcceptances/@Ref/RefRequestBuilder.cs @@ -25,20 +25,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's terms of use acceptance statuses. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,12 +71,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The user's terms of use acceptance statuses. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs b/src/generated/Me/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs index 94307546d7d..39a0ac7a6d5 100644 --- a/src/generated/Me/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs +++ b/src/generated/Me/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs @@ -26,24 +26,44 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's terms of use acceptance statuses. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs b/src/generated/Me/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs index d46b3f73e6c..e30941c9a38 100644 --- a/src/generated/Me/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs +++ b/src/generated/Me/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents the app roles a user has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents the app roles a user has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs b/src/generated/Me/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs index 37c2c11e33e..4743f309f2c 100644 --- a/src/generated/Me/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs +++ b/src/generated/Me/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the app roles a user has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (appRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the app roles a user has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (appRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (appRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the app roles a user has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); - command.AddOption(new Option("--body")); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (appRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/AssignLicense/AssignLicenseRequestBuilder.cs b/src/generated/Me/AssignLicense/AssignLicenseRequestBuilder.cs index 1b2b2d7526d..9a874ff4874 100644 --- a/src/generated/Me/AssignLicense/AssignLicenseRequestBuilder.cs +++ b/src/generated/Me/AssignLicense/AssignLicenseRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assignLicense"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Authentication/AuthenticationRequestBuilder.cs b/src/generated/Me/Authentication/AuthenticationRequestBuilder.cs index ad3c5ee06be..5df4e8a148c 100644 --- a/src/generated/Me/Authentication/AuthenticationRequestBuilder.cs +++ b/src/generated/Me/Authentication/AuthenticationRequestBuilder.cs @@ -31,7 +31,8 @@ public Command BuildDeleteCommand() { command.Description = "Delete navigation property authentication for me"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,12 +53,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get authentication from me"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -90,12 +98,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property authentication in me"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Authentication/Fido2Methods/Fido2MethodsRequestBuilder.cs b/src/generated/Me/Authentication/Fido2Methods/Fido2MethodsRequestBuilder.cs index b2286aa04ea..49a8058ae80 100644 --- a/src/generated/Me/Authentication/Fido2Methods/Fido2MethodsRequestBuilder.cs +++ b/src/generated/Me/Authentication/Fido2Methods/Fido2MethodsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to fido2Methods for me"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get fido2Methods from me"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Authentication/Fido2Methods/Item/Fido2AuthenticationMethodRequestBuilder.cs b/src/generated/Me/Authentication/Fido2Methods/Item/Fido2AuthenticationMethodRequestBuilder.cs index 50b1f0b768a..1df69875f26 100644 --- a/src/generated/Me/Authentication/Fido2Methods/Item/Fido2AuthenticationMethodRequestBuilder.cs +++ b/src/generated/Me/Authentication/Fido2Methods/Item/Fido2AuthenticationMethodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property fido2Methods for me"; // Create options for all the parameters - command.AddOption(new Option("--fido2authenticationmethod-id", description: "key: id of fido2AuthenticationMethod")); + var fido2AuthenticationMethodIdOption = new Option("--fido2authenticationmethod-id", description: "key: id of fido2AuthenticationMethod"); + fido2AuthenticationMethodIdOption.IsRequired = true; + command.AddOption(fido2AuthenticationMethodIdOption); command.Handler = CommandHandler.Create(async (fido2AuthenticationMethodId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(fido2AuthenticationMethodId)) requestInfo.PathParameters.Add("fido2AuthenticationMethod_id", fido2AuthenticationMethodId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get fido2Methods from me"; // Create options for all the parameters - command.AddOption(new Option("--fido2authenticationmethod-id", description: "key: id of fido2AuthenticationMethod")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (fido2AuthenticationMethodId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(fido2AuthenticationMethodId)) requestInfo.PathParameters.Add("fido2AuthenticationMethod_id", fido2AuthenticationMethodId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var fido2AuthenticationMethodIdOption = new Option("--fido2authenticationmethod-id", description: "key: id of fido2AuthenticationMethod"); + fido2AuthenticationMethodIdOption.IsRequired = true; + command.AddOption(fido2AuthenticationMethodIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (fido2AuthenticationMethodId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property fido2Methods in me"; // Create options for all the parameters - command.AddOption(new Option("--fido2authenticationmethod-id", description: "key: id of fido2AuthenticationMethod")); - command.AddOption(new Option("--body")); + var fido2AuthenticationMethodIdOption = new Option("--fido2authenticationmethod-id", description: "key: id of fido2AuthenticationMethod"); + fido2AuthenticationMethodIdOption.IsRequired = true; + command.AddOption(fido2AuthenticationMethodIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (fido2AuthenticationMethodId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(fido2AuthenticationMethodId)) requestInfo.PathParameters.Add("fido2AuthenticationMethod_id", fido2AuthenticationMethodId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Authentication/Methods/Item/AuthenticationMethodRequestBuilder.cs b/src/generated/Me/Authentication/Methods/Item/AuthenticationMethodRequestBuilder.cs index b187e547835..e29cb115c96 100644 --- a/src/generated/Me/Authentication/Methods/Item/AuthenticationMethodRequestBuilder.cs +++ b/src/generated/Me/Authentication/Methods/Item/AuthenticationMethodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property methods for me"; // Create options for all the parameters - command.AddOption(new Option("--authenticationmethod-id", description: "key: id of authenticationMethod")); + var authenticationMethodIdOption = new Option("--authenticationmethod-id", description: "key: id of authenticationMethod"); + authenticationMethodIdOption.IsRequired = true; + command.AddOption(authenticationMethodIdOption); command.Handler = CommandHandler.Create(async (authenticationMethodId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(authenticationMethodId)) requestInfo.PathParameters.Add("authenticationMethod_id", authenticationMethodId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get methods from me"; // Create options for all the parameters - command.AddOption(new Option("--authenticationmethod-id", description: "key: id of authenticationMethod")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (authenticationMethodId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(authenticationMethodId)) requestInfo.PathParameters.Add("authenticationMethod_id", authenticationMethodId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var authenticationMethodIdOption = new Option("--authenticationmethod-id", description: "key: id of authenticationMethod"); + authenticationMethodIdOption.IsRequired = true; + command.AddOption(authenticationMethodIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (authenticationMethodId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property methods in me"; // Create options for all the parameters - command.AddOption(new Option("--authenticationmethod-id", description: "key: id of authenticationMethod")); - command.AddOption(new Option("--body")); + var authenticationMethodIdOption = new Option("--authenticationmethod-id", description: "key: id of authenticationMethod"); + authenticationMethodIdOption.IsRequired = true; + command.AddOption(authenticationMethodIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (authenticationMethodId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(authenticationMethodId)) requestInfo.PathParameters.Add("authenticationMethod_id", authenticationMethodId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Authentication/Methods/MethodsRequestBuilder.cs b/src/generated/Me/Authentication/Methods/MethodsRequestBuilder.cs index e528a404935..b89440853c5 100644 --- a/src/generated/Me/Authentication/Methods/MethodsRequestBuilder.cs +++ b/src/generated/Me/Authentication/Methods/MethodsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to methods for me"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get methods from me"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Authentication/MicrosoftAuthenticatorMethods/Item/Device/DeviceRequestBuilder.cs b/src/generated/Me/Authentication/MicrosoftAuthenticatorMethods/Item/Device/DeviceRequestBuilder.cs index 66791ac2a58..8505c1c01a6 100644 --- a/src/generated/Me/Authentication/MicrosoftAuthenticatorMethods/Item/Device/DeviceRequestBuilder.cs +++ b/src/generated/Me/Authentication/MicrosoftAuthenticatorMethods/Item/Device/DeviceRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The registered device on which Microsoft Authenticator resides. This property is null if the device is not registered for passwordless Phone Sign-In."; // Create options for all the parameters - command.AddOption(new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod")); + var microsoftAuthenticatorAuthenticationMethodIdOption = new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod"); + microsoftAuthenticatorAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(microsoftAuthenticatorAuthenticationMethodIdOption); command.Handler = CommandHandler.Create(async (microsoftAuthenticatorAuthenticationMethodId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(microsoftAuthenticatorAuthenticationMethodId)) requestInfo.PathParameters.Add("microsoftAuthenticatorAuthenticationMethod_id", microsoftAuthenticatorAuthenticationMethodId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The registered device on which Microsoft Authenticator resides. This property is null if the device is not registered for passwordless Phone Sign-In."; // Create options for all the parameters - command.AddOption(new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (microsoftAuthenticatorAuthenticationMethodId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(microsoftAuthenticatorAuthenticationMethodId)) requestInfo.PathParameters.Add("microsoftAuthenticatorAuthenticationMethod_id", microsoftAuthenticatorAuthenticationMethodId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var microsoftAuthenticatorAuthenticationMethodIdOption = new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod"); + microsoftAuthenticatorAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(microsoftAuthenticatorAuthenticationMethodIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (microsoftAuthenticatorAuthenticationMethodId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The registered device on which Microsoft Authenticator resides. This property is null if the device is not registered for passwordless Phone Sign-In."; // Create options for all the parameters - command.AddOption(new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod")); - command.AddOption(new Option("--body")); + var microsoftAuthenticatorAuthenticationMethodIdOption = new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod"); + microsoftAuthenticatorAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(microsoftAuthenticatorAuthenticationMethodIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (microsoftAuthenticatorAuthenticationMethodId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(microsoftAuthenticatorAuthenticationMethodId)) requestInfo.PathParameters.Add("microsoftAuthenticatorAuthenticationMethod_id", microsoftAuthenticatorAuthenticationMethodId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Authentication/MicrosoftAuthenticatorMethods/Item/MicrosoftAuthenticatorAuthenticationMethodRequestBuilder.cs b/src/generated/Me/Authentication/MicrosoftAuthenticatorMethods/Item/MicrosoftAuthenticatorAuthenticationMethodRequestBuilder.cs index 131c99d60cc..3873c5996ce 100644 --- a/src/generated/Me/Authentication/MicrosoftAuthenticatorMethods/Item/MicrosoftAuthenticatorAuthenticationMethodRequestBuilder.cs +++ b/src/generated/Me/Authentication/MicrosoftAuthenticatorMethods/Item/MicrosoftAuthenticatorAuthenticationMethodRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property microsoftAuthenticatorMethods for me"; // Create options for all the parameters - command.AddOption(new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod")); + var microsoftAuthenticatorAuthenticationMethodIdOption = new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod"); + microsoftAuthenticatorAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(microsoftAuthenticatorAuthenticationMethodIdOption); command.Handler = CommandHandler.Create(async (microsoftAuthenticatorAuthenticationMethodId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(microsoftAuthenticatorAuthenticationMethodId)) requestInfo.PathParameters.Add("microsoftAuthenticatorAuthenticationMethod_id", microsoftAuthenticatorAuthenticationMethodId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,14 +54,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get microsoftAuthenticatorMethods from me"; // Create options for all the parameters - command.AddOption(new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (microsoftAuthenticatorAuthenticationMethodId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(microsoftAuthenticatorAuthenticationMethodId)) requestInfo.PathParameters.Add("microsoftAuthenticatorAuthenticationMethod_id", microsoftAuthenticatorAuthenticationMethodId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var microsoftAuthenticatorAuthenticationMethodIdOption = new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod"); + microsoftAuthenticatorAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(microsoftAuthenticatorAuthenticationMethodIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (microsoftAuthenticatorAuthenticationMethodId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,14 +88,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property microsoftAuthenticatorMethods in me"; // Create options for all the parameters - command.AddOption(new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod")); - command.AddOption(new Option("--body")); + var microsoftAuthenticatorAuthenticationMethodIdOption = new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod"); + microsoftAuthenticatorAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(microsoftAuthenticatorAuthenticationMethodIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (microsoftAuthenticatorAuthenticationMethodId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(microsoftAuthenticatorAuthenticationMethodId)) requestInfo.PathParameters.Add("microsoftAuthenticatorAuthenticationMethod_id", microsoftAuthenticatorAuthenticationMethodId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Authentication/MicrosoftAuthenticatorMethods/MicrosoftAuthenticatorMethodsRequestBuilder.cs b/src/generated/Me/Authentication/MicrosoftAuthenticatorMethods/MicrosoftAuthenticatorMethodsRequestBuilder.cs index bb344456189..86f7c96c91b 100644 --- a/src/generated/Me/Authentication/MicrosoftAuthenticatorMethods/MicrosoftAuthenticatorMethodsRequestBuilder.cs +++ b/src/generated/Me/Authentication/MicrosoftAuthenticatorMethods/MicrosoftAuthenticatorMethodsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to microsoftAuthenticatorMethods for me"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get microsoftAuthenticatorMethods from me"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Authentication/WindowsHelloForBusinessMethods/Item/Device/DeviceRequestBuilder.cs b/src/generated/Me/Authentication/WindowsHelloForBusinessMethods/Item/Device/DeviceRequestBuilder.cs index f53930d30a8..1dc745db025 100644 --- a/src/generated/Me/Authentication/WindowsHelloForBusinessMethods/Item/Device/DeviceRequestBuilder.cs +++ b/src/generated/Me/Authentication/WindowsHelloForBusinessMethods/Item/Device/DeviceRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The registered device on which this Windows Hello for Business key resides."; // Create options for all the parameters - command.AddOption(new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod")); + var windowsHelloForBusinessAuthenticationMethodIdOption = new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod"); + windowsHelloForBusinessAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(windowsHelloForBusinessAuthenticationMethodIdOption); command.Handler = CommandHandler.Create(async (windowsHelloForBusinessAuthenticationMethodId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(windowsHelloForBusinessAuthenticationMethodId)) requestInfo.PathParameters.Add("windowsHelloForBusinessAuthenticationMethod_id", windowsHelloForBusinessAuthenticationMethodId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The registered device on which this Windows Hello for Business key resides."; // Create options for all the parameters - command.AddOption(new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (windowsHelloForBusinessAuthenticationMethodId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(windowsHelloForBusinessAuthenticationMethodId)) requestInfo.PathParameters.Add("windowsHelloForBusinessAuthenticationMethod_id", windowsHelloForBusinessAuthenticationMethodId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var windowsHelloForBusinessAuthenticationMethodIdOption = new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod"); + windowsHelloForBusinessAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(windowsHelloForBusinessAuthenticationMethodIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (windowsHelloForBusinessAuthenticationMethodId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The registered device on which this Windows Hello for Business key resides."; // Create options for all the parameters - command.AddOption(new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod")); - command.AddOption(new Option("--body")); + var windowsHelloForBusinessAuthenticationMethodIdOption = new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod"); + windowsHelloForBusinessAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(windowsHelloForBusinessAuthenticationMethodIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (windowsHelloForBusinessAuthenticationMethodId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(windowsHelloForBusinessAuthenticationMethodId)) requestInfo.PathParameters.Add("windowsHelloForBusinessAuthenticationMethod_id", windowsHelloForBusinessAuthenticationMethodId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Authentication/WindowsHelloForBusinessMethods/Item/WindowsHelloForBusinessAuthenticationMethodRequestBuilder.cs b/src/generated/Me/Authentication/WindowsHelloForBusinessMethods/Item/WindowsHelloForBusinessAuthenticationMethodRequestBuilder.cs index 6a09e873a2b..1168ffd278d 100644 --- a/src/generated/Me/Authentication/WindowsHelloForBusinessMethods/Item/WindowsHelloForBusinessAuthenticationMethodRequestBuilder.cs +++ b/src/generated/Me/Authentication/WindowsHelloForBusinessMethods/Item/WindowsHelloForBusinessAuthenticationMethodRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property windowsHelloForBusinessMethods for me"; // Create options for all the parameters - command.AddOption(new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod")); + var windowsHelloForBusinessAuthenticationMethodIdOption = new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod"); + windowsHelloForBusinessAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(windowsHelloForBusinessAuthenticationMethodIdOption); command.Handler = CommandHandler.Create(async (windowsHelloForBusinessAuthenticationMethodId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(windowsHelloForBusinessAuthenticationMethodId)) requestInfo.PathParameters.Add("windowsHelloForBusinessAuthenticationMethod_id", windowsHelloForBusinessAuthenticationMethodId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,14 +54,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get windowsHelloForBusinessMethods from me"; // Create options for all the parameters - command.AddOption(new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (windowsHelloForBusinessAuthenticationMethodId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(windowsHelloForBusinessAuthenticationMethodId)) requestInfo.PathParameters.Add("windowsHelloForBusinessAuthenticationMethod_id", windowsHelloForBusinessAuthenticationMethodId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var windowsHelloForBusinessAuthenticationMethodIdOption = new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod"); + windowsHelloForBusinessAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(windowsHelloForBusinessAuthenticationMethodIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (windowsHelloForBusinessAuthenticationMethodId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,14 +88,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property windowsHelloForBusinessMethods in me"; // Create options for all the parameters - command.AddOption(new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod")); - command.AddOption(new Option("--body")); + var windowsHelloForBusinessAuthenticationMethodIdOption = new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod"); + windowsHelloForBusinessAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(windowsHelloForBusinessAuthenticationMethodIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (windowsHelloForBusinessAuthenticationMethodId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(windowsHelloForBusinessAuthenticationMethodId)) requestInfo.PathParameters.Add("windowsHelloForBusinessAuthenticationMethod_id", windowsHelloForBusinessAuthenticationMethodId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Authentication/WindowsHelloForBusinessMethods/WindowsHelloForBusinessMethodsRequestBuilder.cs b/src/generated/Me/Authentication/WindowsHelloForBusinessMethods/WindowsHelloForBusinessMethodsRequestBuilder.cs index 28739665c87..c8134734528 100644 --- a/src/generated/Me/Authentication/WindowsHelloForBusinessMethods/WindowsHelloForBusinessMethodsRequestBuilder.cs +++ b/src/generated/Me/Authentication/WindowsHelloForBusinessMethods/WindowsHelloForBusinessMethodsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to windowsHelloForBusinessMethods for me"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get windowsHelloForBusinessMethods from me"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Me/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index fc4f85c35aa..0d090367ff1 100644 --- a/src/generated/Me/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Me/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs b/src/generated/Me/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs index e56f4a56713..e2f51f1de2f 100644 --- a/src/generated/Me/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,20 +63,35 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs b/src/generated/Me/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs index be67373f986..b21708ac956 100644 --- a/src/generated/Me/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); command.Handler = CommandHandler.Create(async (calendarPermissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,12 +45,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarPermissionId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); - requestInfo.QueryParameters.Add("select", select); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarPermissionId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,14 +74,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--body")); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarPermissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarRequestBuilder.cs b/src/generated/Me/Calendar/CalendarRequestBuilder.cs index 25cda98d771..d87a0370002 100644 --- a/src/generated/Me/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarRequestBuilder.cs @@ -56,7 +56,8 @@ public Command BuildDeleteCommand() { command.Description = "The user's primary calendar. Read-only."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -77,10 +78,14 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's primary calendar. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,12 +117,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's primary calendar. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/CalendarViewRequestBuilder.cs index f98343dfa66..7676c84aca2 100644 --- a/src/generated/Me/Calendar/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/CalendarViewRequestBuilder.cs @@ -50,12 +50,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,24 +77,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/CalendarView/Delta/Delta.cs b/src/generated/Me/Calendar/CalendarView/Delta/Delta.cs index 2b5d2da29cc..b50b6b75678 100644 --- a/src/generated/Me/Calendar/CalendarView/Delta/Delta.cs +++ b/src/generated/Me/Calendar/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.Calendar.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs index 250db513fc8..b27f74bf408 100644 --- a/src/generated/Me/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs index 9233d3fb59d..e1249ddcfb3 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs index a8ecdecf8ec..d8ae4f68047 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,24 +73,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 8ede44f08b9..d60eb9c7d90 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs index 8c6cb2fe2db..607a7d7ab3c 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index e4dbc7fb1cc..abf1e4df093 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Calendar/CalendarRequestBuilder.cs index 8571b154160..bdc8ec92ccf 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Calendar/CalendarRequestBuilder.cs @@ -36,10 +36,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,12 +55,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,14 +90,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index b4ccce9854c..bba89fbdb63 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs index 3651a9cd125..a6aa9081e13 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs index 352f130d5a7..49bf280aa00 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index 9840f38a701..933849c838f 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/EventRequestBuilder.cs index 484074e4470..a25ffad64f1 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/EventRequestBuilder.cs @@ -74,10 +74,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -110,16 +112,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, startDateTime, endDateTime, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, startDateTime, endDateTime, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -152,14 +163,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs index 293e13caf31..f2b66b4f6b6 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +66,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs index 5498b2429d8..c89b34e698a 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs index d4e61366fb5..1f24e6d4211 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Instances/Delta/Delta.cs b/src/generated/Me/Calendar/CalendarView/Item/Instances/Delta/Delta.cs index 58a1e456c36..707005d872b 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Instances/Delta/Delta.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.Calendar.CalendarView.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/Calendar/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs index 006889288a3..a5c17d0b83e 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Instances/InstancesRequestBuilder.cs index 63bdd584994..ab36d03d9b5 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Instances/InstancesRequestBuilder.cs @@ -44,14 +44,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,22 +74,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index 10620ae9ca4..d42b07346ec 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index 15d2b4e3ae1..b0a9cdf129a 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index 8c0fd02edef..619b6e59624 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index 74b00fa3e6f..9f4ad297942 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/EventRequestBuilder.cs index 277da158d2c..2dbc45977f2 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/EventRequestBuilder.cs @@ -51,12 +51,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -82,14 +85,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,16 +117,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index 266491dfdc0..17ae49a9756 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 36f0318316e..d4c8e773b28 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 9ecc4482910..5c3d7e1f822 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index fb53a705cb6..b4dce8d1334 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index b465016ee7e..f7638916c17 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index ba202a2e209..9ac8d8b0b54 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 8c4e8fb7fd4..d01430093a5 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 14e8660642c..54fa2490106 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 2ebce4c3bf1..9646e0e8bc7 100644 --- a/src/generated/Me/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Delta/Delta.cs b/src/generated/Me/Calendar/Events/Delta/Delta.cs index ebce5bfe4fa..f4c035b30db 100644 --- a/src/generated/Me/Calendar/Events/Delta/Delta.cs +++ b/src/generated/Me/Calendar/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.Calendar.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/Calendar/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Calendar/Events/Delta/DeltaRequestBuilder.cs index a7093742b4b..94cbad680e9 100644 --- a/src/generated/Me/Calendar/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/Events/EventsRequestBuilder.cs b/src/generated/Me/Calendar/Events/EventsRequestBuilder.cs index 315a7f54ecf..df2874ebcb2 100644 --- a/src/generated/Me/Calendar/Events/EventsRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/EventsRequestBuilder.cs @@ -50,12 +50,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,20 +77,35 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs index 75da02c183e..09180aea0b6 100644 --- a/src/generated/Me/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Attachments/AttachmentsRequestBuilder.cs index dd49c849f0c..dddece062b9 100644 --- a/src/generated/Me/Calendar/Events/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,24 +73,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 0854d92d51c..3b4b357dca9 100644 --- a/src/generated/Me/Calendar/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs index 5add69631f6..ebcb8717344 100644 --- a/src/generated/Me/Calendar/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 0c11f94c880..6dcfbb72373 100644 --- a/src/generated/Me/Calendar/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/Events/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Calendar/CalendarRequestBuilder.cs index d89538d0315..0851df654ae 100644 --- a/src/generated/Me/Calendar/Events/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Calendar/CalendarRequestBuilder.cs @@ -36,10 +36,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,12 +55,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,14 +90,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 9c6be0ca9dd..c1ddc0376b1 100644 --- a/src/generated/Me/Calendar/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs index b03fda3304f..deaeef0b51e 100644 --- a/src/generated/Me/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs index 8a500af0ce0..3f5b949e3d0 100644 --- a/src/generated/Me/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index 3cd206336e7..e6a2138ad78 100644 --- a/src/generated/Me/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/EventRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/EventRequestBuilder.cs index 4ad5d1c6e91..a172ac48e3a 100644 --- a/src/generated/Me/Calendar/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/EventRequestBuilder.cs @@ -74,10 +74,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -110,12 +112,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -148,14 +155,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Extensions/ExtensionsRequestBuilder.cs index 0582c154f79..b8b9a48f73a 100644 --- a/src/generated/Me/Calendar/Events/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +66,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs index a7ed73cc190..8d942fbfce4 100644 --- a/src/generated/Me/Calendar/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs index 12ce19cada2..38a67d1d16e 100644 --- a/src/generated/Me/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/Instances/Delta/Delta.cs b/src/generated/Me/Calendar/Events/Item/Instances/Delta/Delta.cs index aa4aa8e6774..116d1b942de 100644 --- a/src/generated/Me/Calendar/Events/Item/Instances/Delta/Delta.cs +++ b/src/generated/Me/Calendar/Events/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.Calendar.Events.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/Calendar/Events/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Instances/Delta/DeltaRequestBuilder.cs index 8883556e4f7..d45dfbe31c7 100644 --- a/src/generated/Me/Calendar/Events/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/Events/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Instances/InstancesRequestBuilder.cs index f551aee18ba..76504483c98 100644 --- a/src/generated/Me/Calendar/Events/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Instances/InstancesRequestBuilder.cs @@ -44,14 +44,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,22 +74,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index d658bfc04b0..c636866da4b 100644 --- a/src/generated/Me/Calendar/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index 066459ad939..88712fe5b2c 100644 --- a/src/generated/Me/Calendar/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index 2ac1e764b94..c8f7540c55b 100644 --- a/src/generated/Me/Calendar/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index 96c36e65f3e..c7ee12c9d49 100644 --- a/src/generated/Me/Calendar/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Instances/Item/EventRequestBuilder.cs index 3e81ffb9868..83498f4d1ca 100644 --- a/src/generated/Me/Calendar/Events/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Instances/Item/EventRequestBuilder.cs @@ -51,12 +51,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -82,14 +85,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,16 +117,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index 61e59cfb15f..d0379062f59 100644 --- a/src/generated/Me/Calendar/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index f5b4add7f5a..3d71adaa41b 100644 --- a/src/generated/Me/Calendar/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index eb758559000..3624af441ec 100644 --- a/src/generated/Me/Calendar/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 846309fb989..ef4ba2a4396 100644 --- a/src/generated/Me/Calendar/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index f0013aef51e..41dbc7b388f 100644 --- a/src/generated/Me/Calendar/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 45a1b331674..72991376ea2 100644 --- a/src/generated/Me/Calendar/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 97d484d6e6c..9c9fba210dc 100644 --- a/src/generated/Me/Calendar/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 7b8a5708457..632bda625e1 100644 --- a/src/generated/Me/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 8546e23e8de..570dc93d8ea 100644 --- a/src/generated/Me/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Me/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 2701fbb187e..b5160171f78 100644 --- a/src/generated/Me/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Me/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 596acb37bd1..86a9112217e 100644 --- a/src/generated/Me/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 6f1f14f906a..b4e6d31925e 100644 --- a/src/generated/Me/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 6738cad662a..1c457da76e5 100644 --- a/src/generated/Me/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index ed6d6b82ea5..492a0b426ad 100644 --- a/src/generated/Me/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/CalendarGroupsRequestBuilder.cs b/src/generated/Me/CalendarGroups/CalendarGroupsRequestBuilder.cs index ba3fafde2a1..9a995241627 100644 --- a/src/generated/Me/CalendarGroups/CalendarGroupsRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/CalendarGroupsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The user's calendar groups. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,20 +64,35 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The user's calendar groups. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/CalendarGroupRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/CalendarGroupRequestBuilder.cs index 2df5c6abf1f..fae1ebd0cbe 100644 --- a/src/generated/Me/CalendarGroups/Item/CalendarGroupRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/CalendarGroupRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's calendar groups. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,12 +53,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's calendar groups. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,14 +82,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's calendar groups. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/CalendarsRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/CalendarsRequestBuilder.cs index a3b040f3ed5..ea2db08d76c 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/CalendarsRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/CalendarsRequestBuilder.cs @@ -42,14 +42,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendars in the calendar group. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,22 +72,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendars in the calendar group. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index ad9124d84a6..3685dc2bab3 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs index d8dd768f787..529de2580ee 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +69,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs index 9b8fa7850ac..6a5ffb741e8 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, calendarPermissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,16 +51,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, calendarPermissionId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, calendarPermissionId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,18 +86,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, calendarPermissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarRequestBuilder.cs index ba13fcd4c1b..300b9e56196 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarRequestBuilder.cs @@ -55,12 +55,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendars in the calendar group. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -81,14 +84,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendars in the calendar group. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,16 +129,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendars in the calendar group. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs index d7d047f00c1..3466f92ccde 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs @@ -50,16 +50,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,24 +83,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/Delta.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/Delta.cs index 1e023c8b459..ddf98028632 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/Delta.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.CalendarGroups.Item.Calendars.Item.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs index 4656ac4b7ea..e47e9460bd6 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs index 26b4deb9c47..80bad308698 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs index 6b9334c67d9..6c16277bea7 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,18 +37,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,28 +79,49 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index d1f91cb694e..8c3634d651b 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs index 830ebf2bbe7..cfb3855f88d 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 94f247a50b8..c287abf156c 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs index ae1be4b5712..8315a5bb632 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,16 +61,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +102,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index d74998944cc..c1a6522eb3c 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs index c86e5e9ef3c..0457637207e 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs index de219df4252..2a901070078 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index 1a481032325..31370cae63a 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs index 97f319742d6..80c28567d3a 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs @@ -74,14 +74,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -114,16 +118,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -156,18 +167,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs index cda40613467..8d175e3be84 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +72,49 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs index 0f535b67acb..a7d8ce384d9 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs index 138e9dea658..2d169bd10b0 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs index 656226024c3..29464351e7c 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.CalendarGroups.Item.Calendars.Item.CalendarView.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs index ca71aa5fa31..7d03ebb3fe7 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs index 887b0c17970..4090f938ee2 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs @@ -44,18 +44,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,26 +80,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index a1848bc03c2..5ea99c89071 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index af147de1873..fbf38811293 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index d2bb2dab4d3..396de61358e 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index 469870ec187..cbae2555bbd 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs index 3e42d41d854..d7c805b9ccd 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs @@ -51,16 +51,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -86,18 +91,26 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -116,20 +129,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index a762ba8b918..0f8e5db59d4 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 9af8933a5cf..982fc1ea03f 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 75c34cfbeb2..9adf68374d6 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index a7341e2900b..dd4092f73d4 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 56de27abeb7..a57600def88 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index d1d85797eab..3c6e315bec9 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 05d3f409956..9ff49bf2452 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index be7986112d4..981a42a6650 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index c182d8524ea..bdaff2fcf32 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Delta/Delta.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Delta/Delta.cs index 45deafdd769..435d254739a 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Delta/Delta.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.CalendarGroups.Item.Calendars.Item.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs index 6dea3f9953d..4604ad15413 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/EventsRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/EventsRequestBuilder.cs index e987564a54c..f21674c85e4 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/EventsRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/EventsRequestBuilder.cs @@ -50,16 +50,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,24 +83,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs index 2bab30fe099..32e3ce52ce8 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs index 8aae983f074..4e90692899f 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,18 +37,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,28 +79,49 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 3be381bf304..a41916ff25e 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs index 37c2ad7158a..9c9c1776523 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 552948b979d..b5004b7365a 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs index 640a38404c0..c58a8189cef 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,16 +61,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +102,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 369a8c676b9..f9cdc429ee4 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs index 2f5005931ac..6034a500646 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs index f7328c8cc5c..f015532d114 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index fd93403e13c..b55016ece47 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/EventRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/EventRequestBuilder.cs index bfc6cb41b17..0868ea3d8c6 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/EventRequestBuilder.cs @@ -74,14 +74,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -114,16 +118,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -156,18 +167,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs index b6baa9462c0..e76f9403fe0 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +72,49 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs index 72b37997ecc..15845996b56 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs index 416dec02a25..a45697d982e 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/Delta.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/Delta.cs index 40f6385e814..c91536acde8 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/Delta.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.CalendarGroups.Item.Calendars.Item.Events.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs index 718a42b0045..e910126493e 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs index bf16df85389..53f2142009e 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs @@ -44,18 +44,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,26 +80,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index f7f05859651..2ee0032f2b8 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index 3f5dd7ec9a2..6a187a19bd8 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index f038e5bf5d5..1cbf6aee90b 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index c9b3ba5839e..50492778590 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs index 995ae37ef5a..171e816578a 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs @@ -51,16 +51,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -86,18 +91,26 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -116,20 +129,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index 269fdf95267..0e1be38236c 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index df44ea3f585..9ba0178d96f 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 4eb53027f6b..db02b073dfd 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index ec90ae17d59..65f01c2d4ee 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index ff6ed509ae6..7a5f3a18ba2 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 7a76a855af4..4e0e762f839 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 8bc472b02e6..34934fce04b 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 0c4b4ae0abb..afa307a6db5 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 7d3b5211d56..63479ad114e 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs index 12eb4efa226..fbc0bd2fbb7 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 108ee40b977..96b2c13286b 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index bd845df89e0..da959f9ecd3 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 2a147399cad..5f41bc81fb7 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index e23f120b3d8..116aba5fab2 100644 --- a/src/generated/Me/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarGroupId, calendarId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Me/CalendarView/CalendarViewRequestBuilder.cs index f3c84bfff81..97c5874e197 100644 --- a/src/generated/Me/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Me/CalendarView/CalendarViewRequestBuilder.cs @@ -50,12 +50,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,24 +77,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Delta/Delta.cs b/src/generated/Me/CalendarView/Delta/Delta.cs index 9cb471051f3..6606e6adce7 100644 --- a/src/generated/Me/CalendarView/Delta/Delta.cs +++ b/src/generated/Me/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Me/CalendarView/Delta/DeltaRequestBuilder.cs index 1e2b564d608..6e1833e587d 100644 --- a/src/generated/Me/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Accept/AcceptRequestBuilder.cs index d2737994c0c..981e4d2814b 100644 --- a/src/generated/Me/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs index 5ebed0b2e80..09e98783636 100644 --- a/src/generated/Me/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,24 +73,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 1b91da3144e..830c41e39cd 100644 --- a/src/generated/Me/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs index 1c323ad9eab..49381ca6e59 100644 --- a/src/generated/Me/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 1476f2dd782..fe1b6564d10 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs index 17b862fd4cb..9efc98edbfb 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +66,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs index a831c8507dc..10617fea86b 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); command.Handler = CommandHandler.Create(async (eventId, calendarPermissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +48,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, calendarPermissionId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, calendarPermissionId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,16 +80,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, calendarPermissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/CalendarRequestBuilder.cs index c37296e2c54..658be2b6ce5 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/CalendarRequestBuilder.cs @@ -55,10 +55,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -79,12 +81,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -116,14 +123,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs index 46102d0d0ac..0225c7eee74 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs @@ -44,14 +44,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,22 +74,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Delta/Delta.cs b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Delta/Delta.cs index 459e125dd54..b633428dcf5 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Delta/Delta.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.CalendarView.Item.Calendar.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs index b8cddf2152f..96a9d3b1a18 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs index 7e84155dc16..60e316ca94d 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs index fd39a61c160..4a496ae12fc 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs index ecd2aca201d..302888595f6 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index 27b14e1c595..61cefa61c11 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs index 9d99901e9b6..fe029c5188b 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs @@ -51,12 +51,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -82,14 +85,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,16 +117,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs index d725566ea9c..70b2c7622e0 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 15b8564d24b..384d6d4bb4d 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 6fed1aa4818..3ca2c522d0a 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/Events/Delta/Delta.cs b/src/generated/Me/CalendarView/Item/Calendar/Events/Delta/Delta.cs index 99c66e30a3e..aa9039efd95 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/Events/Delta/Delta.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.CalendarView.Item.Calendar.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/CalendarView/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs index 0fd7225716c..9ff2b2cf1a2 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/Events/EventsRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/Events/EventsRequestBuilder.cs index 4856e331618..1a3e42164ee 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/Events/EventsRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/Events/EventsRequestBuilder.cs @@ -44,14 +44,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,22 +74,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs index 64d4663ca0d..a0b067a9fce 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs index 572116d9142..5bb9bfecd16 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs index e4ddc614aba..d3390110648 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index 80e21955ca1..79b1126d793 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/EventRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/EventRequestBuilder.cs index e9df3365910..d2bf961d73a 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/EventRequestBuilder.cs @@ -51,12 +51,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -82,14 +85,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,16 +117,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs index d680dc7d625..3f35147ac9d 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 0fcfb6f47fe..43ba4d77d63 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 583cb04423d..cae1e77ee6d 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 5b45fa93c28..abb1bf382c1 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 6305ac8cdf8..0caf95b0a82 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 7e6c52ff7fb..5ada36ed58a 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 708f4339792..1edb1fc77d0 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 96f872ab7a1..620ecfc746a 100644 --- a/src/generated/Me/CalendarView/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Cancel/CancelRequestBuilder.cs index b6695fc2c5b..5bd441b9301 100644 --- a/src/generated/Me/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Decline/DeclineRequestBuilder.cs index e8e140a3775..47cc2aa0814 100644 --- a/src/generated/Me/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index 8df265c4451..f2453bdfb33 100644 --- a/src/generated/Me/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Me/CalendarView/Item/EventRequestBuilder.cs index de5712e2863..b74219b9984 100644 --- a/src/generated/Me/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/EventRequestBuilder.cs @@ -79,10 +79,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -115,16 +117,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, startDateTime, endDateTime, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, startDateTime, endDateTime, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -157,14 +168,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs index 6a7a7db3761..4451156b035 100644 --- a/src/generated/Me/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +66,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs index 6d0b310844e..49941490f0f 100644 --- a/src/generated/Me/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Forward/ForwardRequestBuilder.cs index f00c5f63f87..a5c5e2dffe8 100644 --- a/src/generated/Me/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Instances/Delta/Delta.cs b/src/generated/Me/CalendarView/Item/Instances/Delta/Delta.cs index f7cf9d1ffed..c5ea1a645bb 100644 --- a/src/generated/Me/CalendarView/Item/Instances/Delta/Delta.cs +++ b/src/generated/Me/CalendarView/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.CalendarView.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs index 921331a8596..a26c3c3a2e7 100644 --- a/src/generated/Me/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Instances/InstancesRequestBuilder.cs index d7153d2ddfd..31a79553001 100644 --- a/src/generated/Me/CalendarView/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Instances/InstancesRequestBuilder.cs @@ -44,14 +44,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,22 +74,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index 3cc39d7924f..57ea6ade09f 100644 --- a/src/generated/Me/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index bd085126294..c3bc4b281ec 100644 --- a/src/generated/Me/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index b6a1ec672d6..83f0cba8635 100644 --- a/src/generated/Me/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index f2f003d9034..e2e26779ad2 100644 --- a/src/generated/Me/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Instances/Item/EventRequestBuilder.cs index 8a8e8412932..0f8c1ccd626 100644 --- a/src/generated/Me/CalendarView/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Instances/Item/EventRequestBuilder.cs @@ -51,12 +51,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -82,14 +85,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,16 +117,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index 89ad33190ed..7ffae5f2268 100644 --- a/src/generated/Me/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index ca5c1a2d796..6d5701dcf7e 100644 --- a/src/generated/Me/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 71769242fb2..286802d4041 100644 --- a/src/generated/Me/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 6615dfb0351..64b1053eacb 100644 --- a/src/generated/Me/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 80f0df3649d..76e0e3a64a4 100644 --- a/src/generated/Me/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index db489c3dd48..35991e8809d 100644 --- a/src/generated/Me/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 71ef5f5747d..012d544eb57 100644 --- a/src/generated/Me/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 475eae6f165..cbd4ab49df5 100644 --- a/src/generated/Me/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 809da484cd3..b76cd77a1a7 100644 --- a/src/generated/Me/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/CalendarsRequestBuilder.cs b/src/generated/Me/Calendars/CalendarsRequestBuilder.cs index f256fabe0a8..88e187d0f80 100644 --- a/src/generated/Me/Calendars/CalendarsRequestBuilder.cs +++ b/src/generated/Me/Calendars/CalendarsRequestBuilder.cs @@ -42,12 +42,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The user's calendars. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,20 +69,35 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The user's calendars. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Me/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 6c72f08fdc0..5d37f89d9f5 100644 --- a/src/generated/Me/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (calendarId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs index f2c874a383a..651b104dd72 100644 --- a/src/generated/Me/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +66,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs index 4c7e38b2c29..19b9c974a97 100644 --- a/src/generated/Me/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); command.Handler = CommandHandler.Create(async (calendarId, calendarPermissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +48,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarId, calendarPermissionId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); - requestInfo.QueryParameters.Add("select", select); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarId, calendarPermissionId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,16 +80,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, calendarPermissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarRequestBuilder.cs index 53e272d5884..63f61a61182 100644 --- a/src/generated/Me/Calendars/Item/CalendarRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarRequestBuilder.cs @@ -55,10 +55,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's calendars. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); command.Handler = CommandHandler.Create(async (calendarId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -79,12 +81,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's calendars. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("select", select); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -116,14 +123,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's calendars. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs index a8a5e2450a3..1926d57f0ae 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs @@ -50,14 +50,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,26 +80,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarId, startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarId, startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Delta/Delta.cs b/src/generated/Me/Calendars/Item/CalendarView/Delta/Delta.cs index 77a2bf76595..36f05674aab 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Delta/Delta.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.Calendars.Item.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs index ce0d7474f12..a9d56463f72 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); command.Handler = CommandHandler.Create(async (calendarId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs index dbe32e6348b..f2683957f7e 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs index 07507efb584..dbe819d33eb 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,26 +76,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 76c62591269..7da7950c932 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs index a6d7a0e1b06..0d76958efcf 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index d4170ca5c06..088936b52e8 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs index 83fc626fa41..f293156f694 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,14 +58,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,16 +96,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 1fc39293360..ecf6558b7b4 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs index aedec3a96e8..c34ae05f8cd 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs index aea0c6d2b37..d509a604398 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index a2aad58a57b..15768158557 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs index c06cef55ce1..651e964b3f0 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs @@ -74,12 +74,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -112,18 +115,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, startDateTime, endDateTime, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("select", select); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, startDateTime, endDateTime, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -156,16 +169,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs index 28d6cd68ef3..9b7860ab11b 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +69,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs index da405c32a0b..ea108de6550 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs index 3f9cc0e9dec..74e09a76bd2 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs index 926177c9b3d..41430a8d6d8 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.Calendars.Item.CalendarView.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs index bdfdd19a58c..e692f54cc51 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs index 8101829f7e8..2e68878ea9a 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index df9fade6fef..30db7c24be7 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index cab48f34a50..74c508ab19f 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index 5b17383d9c8..c2ac63657a4 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index b319f08c46a..eee5108cdd8 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs index 9e3fb121e13..3df0579e9b0 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index a5d3be076ec..21234be5230 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 0d15ee903bb..b30903208dd 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 0862c061b15..7f39462ddd5 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index b6b9d073979..562c78fa44f 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index a67898359cc..0006ddf1ece 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 531507c90f4..c8c07fb14b7 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 690ca89ef96..a3996ed63c2 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 7a718c34f0e..fe5334676e9 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 726bb630dfc..73b5a264e24 100644 --- a/src/generated/Me/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Delta/Delta.cs b/src/generated/Me/Calendars/Item/Events/Delta/Delta.cs index d268ab291b0..2371a849db8 100644 --- a/src/generated/Me/Calendars/Item/Events/Delta/Delta.cs +++ b/src/generated/Me/Calendars/Item/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.Calendars.Item.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs index dd849e5cd81..dfb9910b2d3 100644 --- a/src/generated/Me/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); command.Handler = CommandHandler.Create(async (calendarId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/Events/EventsRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/EventsRequestBuilder.cs index c48b3782735..c5c5d5161fe 100644 --- a/src/generated/Me/Calendars/Item/Events/EventsRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/EventsRequestBuilder.cs @@ -50,14 +50,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,22 +80,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs index dfe8696273f..7b8dc79cd9f 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs index f63bf21fb55..65a4a67af81 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,26 +76,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 62773c354c7..13705db1d6f 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs index 06ba10edca9..4077c8ec077 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 43a06da595c..0f34184e332 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs index 28b88e6dd7f..b422139cd9d 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,14 +58,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,16 +96,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 51c2a1e1a9d..74e055e0363 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs index de32a83e99c..4b20e071078 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs index e363ba11368..d3247e4644c 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index a10a5a8b343..e1d3bd0f59b 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/EventRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/EventRequestBuilder.cs index 4fce83cb6ea..e7a4ae5e81f 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/EventRequestBuilder.cs @@ -74,12 +74,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -112,14 +115,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -152,16 +161,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs index c08b94b1a5a..7e018f8d470 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +69,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs index 434f8bd128d..47eeec8955b 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs index 31dc27c988e..2d5735bdcd1 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Instances/Delta/Delta.cs b/src/generated/Me/Calendars/Item/Events/Item/Instances/Delta/Delta.cs index a41d4415fb9..9839b40ea5f 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Instances/Delta/Delta.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.Calendars.Item.Events.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs index b712f601efd..1e2f7991c70 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs index 935882e7d2f..3e2d6dc7531 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index 20734a7ea14..610f61e2c21 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index 336946216ee..753f2268dea 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index 15810cfc946..57c4909db27 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index dbe021472b8..55ee9af0948 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs index be1a814cdbf..ec90e5274e9 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index d65bc9456e4..a78879ec102 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 08f4d4a65ea..9547a33d214 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 6d9380e53e4..00fbc5ed63f 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 4dcd77b6153..c66bc626d6f 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index e5fe93f3421..d067b375179 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index ea749b8af3e..50255c96aa9 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 3e285ba8d5f..5488a68a32a 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index c18a9ef95c7..f80d57c503d 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index b02de6ae457..565a6c73ce9 100644 --- a/src/generated/Me/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Me/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs index 76b650a452f..c757dde0338 100644 --- a/src/generated/Me/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index d209cb70a99..bfb0e56d68c 100644 --- a/src/generated/Me/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (calendarId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index ce780754e69..68ce24a8d51 100644 --- a/src/generated/Me/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 816dbdcaa71..c9f5f904032 100644 --- a/src/generated/Me/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (calendarId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 76ee3e579b0..bfffd73ccf9 100644 --- a/src/generated/Me/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (calendarId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (calendarId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ChangePassword/ChangePasswordRequestBuilder.cs b/src/generated/Me/ChangePassword/ChangePasswordRequestBuilder.cs index 0ca80a07e53..c615f3fafa4 100644 --- a/src/generated/Me/ChangePassword/ChangePasswordRequestBuilder.cs +++ b/src/generated/Me/ChangePassword/ChangePasswordRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action changePassword"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Chats/ChatsRequestBuilder.cs b/src/generated/Me/Chats/ChatsRequestBuilder.cs index a79613566fc..61b77491dd1 100644 --- a/src/generated/Me/Chats/ChatsRequestBuilder.cs +++ b/src/generated/Me/Chats/ChatsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to chats for me"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get chats from me"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Chats/Item/ChatRequestBuilder.cs b/src/generated/Me/Chats/Item/ChatRequestBuilder.cs index 1dafadb83c1..ff26bd5a161 100644 --- a/src/generated/Me/Chats/Item/ChatRequestBuilder.cs +++ b/src/generated/Me/Chats/Item/ChatRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property chats for me"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); command.Handler = CommandHandler.Create(async (chatId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get chats from me"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (chatId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (chatId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property chats in me"; // Create options for all the parameters - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--body")); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (chatId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs b/src/generated/Me/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs index f3a00c8a129..3bbc6d4d0ea 100644 --- a/src/generated/Me/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs +++ b/src/generated/Me/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs b/src/generated/Me/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs index 5146cf3e540..fc5326871f9 100644 --- a/src/generated/Me/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs +++ b/src/generated/Me/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ContactFolders/ContactFoldersRequestBuilder.cs b/src/generated/Me/ContactFolders/ContactFoldersRequestBuilder.cs index 822711c7c17..c3ce4e922df 100644 --- a/src/generated/Me/ContactFolders/ContactFoldersRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/ContactFoldersRequestBuilder.cs @@ -41,12 +41,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The user's contacts folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,20 +68,35 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The user's contacts folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ContactFolders/Delta/DeltaRequestBuilder.cs b/src/generated/Me/ContactFolders/Delta/DeltaRequestBuilder.cs index 4700d2cdb1b..ecd7db97fa4 100644 --- a/src/generated/Me/ContactFolders/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ContactFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs index 7a8f054c2c0..2f38fd37b80 100644 --- a/src/generated/Me/ContactFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of child folders in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,24 +67,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of child folders in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactFolderId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactFolderId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ContactFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs index a74c377ff8b..6be8ef01e00 100644 --- a/src/generated/Me/ContactFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); command.Handler = CommandHandler.Create(async (contactFolderId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ContactFolders/Item/ChildFolders/Item/ContactFolderRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/ChildFolders/Item/ContactFolderRequestBuilder.cs index 2de86990bfa..7a3cbaca44b 100644 --- a/src/generated/Me/ContactFolders/Item/ChildFolders/Item/ContactFolderRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/ChildFolders/Item/ContactFolderRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of child folders in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contactfolder-id1", description: "key: id of contactFolder")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactFolderId1Option = new Option("--contactfolder-id1", description: "key: id of contactFolder"); + contactFolderId1Option.IsRequired = true; + command.AddOption(contactFolderId1Option); command.Handler = CommandHandler.Create(async (contactFolderId, contactFolderId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactFolderId1)) requestInfo.PathParameters.Add("contactFolder_id1", contactFolderId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of child folders in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contactfolder-id1", description: "key: id of contactFolder")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactFolderId, contactFolderId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactFolderId1)) requestInfo.PathParameters.Add("contactFolder_id1", contactFolderId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactFolderId1Option = new Option("--contactfolder-id1", description: "key: id of contactFolder"); + contactFolderId1Option.IsRequired = true; + command.AddOption(contactFolderId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactFolderId, contactFolderId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of child folders in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contactfolder-id1", description: "key: id of contactFolder")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactFolderId1Option = new Option("--contactfolder-id1", description: "key: id of contactFolder"); + contactFolderId1Option.IsRequired = true; + command.AddOption(contactFolderId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactFolderId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactFolderId1)) requestInfo.PathParameters.Add("contactFolder_id1", contactFolderId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ContactFolders/Item/ContactFolderRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/ContactFolderRequestBuilder.cs index 3d596aefb6f..88c62895e89 100644 --- a/src/generated/Me/ContactFolders/Item/ContactFolderRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/ContactFolderRequestBuilder.cs @@ -44,10 +44,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's contacts folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); command.Handler = CommandHandler.Create(async (contactFolderId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,12 +63,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's contacts folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (contactFolderId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - requestInfo.QueryParameters.Add("select", select); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (contactFolderId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,14 +99,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's contacts folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ContactFolders/Item/Contacts/ContactsRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/Contacts/ContactsRequestBuilder.cs index 042ae63142d..14ef9a557d7 100644 --- a/src/generated/Me/ContactFolders/Item/Contacts/ContactsRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/Contacts/ContactsRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The contacts in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,24 +71,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The contacts in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactFolderId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactFolderId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ContactFolders/Item/Contacts/Delta/Delta.cs b/src/generated/Me/ContactFolders/Item/Contacts/Delta/Delta.cs index 6ac502c01a3..bc661841a88 100644 --- a/src/generated/Me/ContactFolders/Item/Contacts/Delta/Delta.cs +++ b/src/generated/Me/ContactFolders/Item/Contacts/Delta/Delta.cs @@ -26,7 +26,7 @@ public class Delta : OutlookItem, IParsable { public string DisplayName { get; set; } /// The contact's email addresses. public List EmailAddresses { get; set; } - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. public List Extensions { get; set; } /// The name the contact is filed under. public string FileAs { get; set; } diff --git a/src/generated/Me/ContactFolders/Item/Contacts/Delta/DeltaRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/Contacts/Delta/DeltaRequestBuilder.cs index 7073776eaee..6e275ac629d 100644 --- a/src/generated/Me/ContactFolders/Item/Contacts/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/Contacts/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); command.Handler = CommandHandler.Create(async (contactFolderId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ContactFolders/Item/Contacts/Item/ContactRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/Contacts/Item/ContactRequestBuilder.cs index f626267ebb0..da2a6bbebc8 100644 --- a/src/generated/Me/ContactFolders/Item/Contacts/Item/ContactRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/Contacts/Item/ContactRequestBuilder.cs @@ -30,12 +30,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The contacts in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,16 +59,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The contacts in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactFolderId, contactId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactFolderId, contactId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,16 +103,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The contacts in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ContactFolders/Item/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs index cd9568e77ef..05a0c925c74 100644 --- a/src/generated/Me/ContactFolders/Item/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs @@ -30,22 +30,27 @@ public List BuildCommand() { return commands; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,32 +63,52 @@ public Command BuildCreateCommand() { return command; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactFolderId, contactId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactFolderId, contactId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,7 +134,7 @@ public ExtensionsRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Request headers /// Request options /// Request query parameters @@ -130,7 +155,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// /// Request headers /// Request options @@ -148,7 +173,7 @@ public RequestInformation CreatePostRequestInformation(Extension body, Action - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -160,7 +185,7 @@ public async Task GetAsync(Action q = de return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -172,7 +197,7 @@ public async Task PostAsync(Extension model, Action(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Me/ContactFolders/Item/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs index 0814bcc1031..22500bb7364 100644 --- a/src/generated/Me/ContactFolders/Item/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -20,20 +20,24 @@ public class ExtensionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,24 +45,34 @@ public Command BuildDeleteCommand() { return command; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactFolderId, contactId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactFolderId, contactId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,24 +85,30 @@ public Command BuildGetCommand() { return command; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -109,7 +129,7 @@ public ExtensionRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Request headers /// Request options /// @@ -124,7 +144,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Request headers /// Request options /// Request query parameters @@ -145,7 +165,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// /// Request headers /// Request options @@ -163,7 +183,7 @@ public RequestInformation CreatePatchRequestInformation(Extension body, Action - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +194,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -186,7 +206,7 @@ public async Task GetAsync(Action q = default, Ac return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -198,7 +218,7 @@ public async Task PatchAsync(Extension model, Action var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Me/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index c630db8861d..cc1ea2ae6d3 100644 --- a/src/generated/Me/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactFolderId, contactId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactFolderId, contactId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 46909d61f81..8cdcecb21bb 100644 --- a/src/generated/Me/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactFolderId, contactId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactFolderId, contactId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ContactFolders/Item/Contacts/Item/Photo/PhotoRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/Contacts/Item/Photo/PhotoRequestBuilder.cs index a1b460b2b4c..7cd5c63eabd 100644 --- a/src/generated/Me/ContactFolders/Item/Contacts/Item/Photo/PhotoRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/Contacts/Item/Photo/PhotoRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Optional contact picture. You can get or set a photo for a contact."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,14 +56,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Optional contact picture. You can get or set a photo for a contact."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (contactFolderId, contactId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("select", select); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (contactFolderId, contactId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,16 +88,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Optional contact picture. You can get or set a photo for a contact."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ContactFolders/Item/Contacts/Item/Photo/Value/ContentRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/Contacts/Item/Photo/Value/ContentRequestBuilder.cs index 0eb81aa94fb..b81ea8fa7a2 100644 --- a/src/generated/Me/ContactFolders/Item/Contacts/Item/Photo/Value/ContentRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/Contacts/Item/Photo/Value/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (contactFolderId, contactId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--file", description: "Binary request body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 3ab8d7d99c7..82fa93384fe 100644 --- a/src/generated/Me/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactFolderId, contactId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactFolderId, contactId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index a0bdaffd628..4e69fd8ea3a 100644 --- a/src/generated/Me/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactFolderId, contactId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactFolderId, contactId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ContactFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 9847732defe..47531b9bf15 100644 --- a/src/generated/Me/ContactFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (contactFolderId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactFolderId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactFolderId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ContactFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 3f14808d935..362720b2f26 100644 --- a/src/generated/Me/ContactFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactFolderId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactFolderId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ContactFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index ecd98b4aceb..cecb4a21a8f 100644 --- a/src/generated/Me/ContactFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (contactFolderId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactFolderId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactFolderId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ContactFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/ContactFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 80cb91a97e9..d782307157b 100644 --- a/src/generated/Me/ContactFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/ContactFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--body")); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactFolderId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactFolderId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Contacts/ContactsRequestBuilder.cs b/src/generated/Me/Contacts/ContactsRequestBuilder.cs index 2275a522296..a2759460721 100644 --- a/src/generated/Me/Contacts/ContactsRequestBuilder.cs +++ b/src/generated/Me/Contacts/ContactsRequestBuilder.cs @@ -41,12 +41,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The user's contacts. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,22 +68,39 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The user's contacts. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Contacts/Delta/Delta.cs b/src/generated/Me/Contacts/Delta/Delta.cs index 8628f2e0438..0f8ba224eaf 100644 --- a/src/generated/Me/Contacts/Delta/Delta.cs +++ b/src/generated/Me/Contacts/Delta/Delta.cs @@ -26,7 +26,7 @@ public class Delta : OutlookItem, IParsable { public string DisplayName { get; set; } /// The contact's email addresses. public List EmailAddresses { get; set; } - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. public List Extensions { get; set; } /// The name the contact is filed under. public string FileAs { get; set; } diff --git a/src/generated/Me/Contacts/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Contacts/Delta/DeltaRequestBuilder.cs index 4b56165c416..4154997c5df 100644 --- a/src/generated/Me/Contacts/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Contacts/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Contacts/Item/ContactRequestBuilder.cs b/src/generated/Me/Contacts/Item/ContactRequestBuilder.cs index c61afc678dd..1d8eca1e708 100644 --- a/src/generated/Me/Contacts/Item/ContactRequestBuilder.cs +++ b/src/generated/Me/Contacts/Item/ContactRequestBuilder.cs @@ -30,10 +30,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's contacts. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); command.Handler = CommandHandler.Create(async (contactId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,12 +56,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's contacts. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (contactId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("select", select); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (contactId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,14 +92,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's contacts. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs index 6119bade9ae..c74f7a80c36 100644 --- a/src/generated/Me/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,30 +60,49 @@ public Command BuildCreateCommand() { return command; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -105,7 +128,7 @@ public ExtensionsRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Request headers /// Request options /// Request query parameters @@ -126,7 +149,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// /// Request headers /// Request options @@ -144,7 +167,7 @@ public RequestInformation CreatePostRequestInformation(Extension body, Action - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -156,7 +179,7 @@ public async Task GetAsync(Action q = de return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -168,7 +191,7 @@ public async Task PostAsync(Extension model, Action(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Me/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs index 1bb7dc94dab..6d03eff071a 100644 --- a/src/generated/Me/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -20,18 +20,21 @@ public class ExtensionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (contactId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public ExtensionRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(Extension body, Action - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = default, Ac return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(Extension model, Action var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Me/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index af443724d1c..56ef3c21813 100644 --- a/src/generated/Me/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (contactId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index a79755632ca..5f830b86264 100644 --- a/src/generated/Me/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Contacts/Item/Photo/PhotoRequestBuilder.cs b/src/generated/Me/Contacts/Item/Photo/PhotoRequestBuilder.cs index 255dc2b2ce3..d5f32b252d5 100644 --- a/src/generated/Me/Contacts/Item/Photo/PhotoRequestBuilder.cs +++ b/src/generated/Me/Contacts/Item/Photo/PhotoRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Optional contact picture. You can get or set a photo for a contact."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); command.Handler = CommandHandler.Create(async (contactId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,12 +53,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Optional contact picture. You can get or set a photo for a contact."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (contactId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("select", select); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (contactId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,14 +82,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Optional contact picture. You can get or set a photo for a contact."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Contacts/Item/Photo/Value/ContentRequestBuilder.cs b/src/generated/Me/Contacts/Item/Photo/Value/ContentRequestBuilder.cs index 7bf9b3a7db1..7e726f843b4 100644 --- a/src/generated/Me/Contacts/Item/Photo/Value/ContentRequestBuilder.cs +++ b/src/generated/Me/Contacts/Item/Photo/Value/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (contactId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--file", description: "Binary request body")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (contactId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 76b24aa4870..6a057a143c3 100644 --- a/src/generated/Me/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (contactId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 66b189a8ded..3256bc1bc3a 100644 --- a/src/generated/Me/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (contactId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (contactId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CreatedObjects/@Ref/RefRequestBuilder.cs b/src/generated/Me/CreatedObjects/@Ref/RefRequestBuilder.cs index 9c58d15daa2..4feb058eaff 100644 --- a/src/generated/Me/CreatedObjects/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/CreatedObjects/@Ref/RefRequestBuilder.cs @@ -25,20 +25,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects that were created by the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,12 +71,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Directory objects that were created by the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/CreatedObjects/CreatedObjectsRequestBuilder.cs b/src/generated/Me/CreatedObjects/CreatedObjectsRequestBuilder.cs index 1d522f40a9c..c4823efb1b1 100644 --- a/src/generated/Me/CreatedObjects/CreatedObjectsRequestBuilder.cs +++ b/src/generated/Me/CreatedObjects/CreatedObjectsRequestBuilder.cs @@ -26,24 +26,44 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects that were created by the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/DeviceManagementTroubleshootingEvents/DeviceManagementTroubleshootingEventsRequestBuilder.cs b/src/generated/Me/DeviceManagementTroubleshootingEvents/DeviceManagementTroubleshootingEventsRequestBuilder.cs index f25a0d86186..eaeae46e3ed 100644 --- a/src/generated/Me/DeviceManagementTroubleshootingEvents/DeviceManagementTroubleshootingEventsRequestBuilder.cs +++ b/src/generated/Me/DeviceManagementTroubleshootingEvents/DeviceManagementTroubleshootingEventsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of troubleshooting events for this user."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of troubleshooting events for this user."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/DeviceManagementTroubleshootingEvents/Item/DeviceManagementTroubleshootingEventRequestBuilder.cs b/src/generated/Me/DeviceManagementTroubleshootingEvents/Item/DeviceManagementTroubleshootingEventRequestBuilder.cs index 4706c90f886..2cc9a4784b9 100644 --- a/src/generated/Me/DeviceManagementTroubleshootingEvents/Item/DeviceManagementTroubleshootingEventRequestBuilder.cs +++ b/src/generated/Me/DeviceManagementTroubleshootingEvents/Item/DeviceManagementTroubleshootingEventRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of troubleshooting events for this user."; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent")); + var deviceManagementTroubleshootingEventIdOption = new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent"); + deviceManagementTroubleshootingEventIdOption.IsRequired = true; + command.AddOption(deviceManagementTroubleshootingEventIdOption); command.Handler = CommandHandler.Create(async (deviceManagementTroubleshootingEventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(deviceManagementTroubleshootingEventId)) requestInfo.PathParameters.Add("deviceManagementTroubleshootingEvent_id", deviceManagementTroubleshootingEventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of troubleshooting events for this user."; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (deviceManagementTroubleshootingEventId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(deviceManagementTroubleshootingEventId)) requestInfo.PathParameters.Add("deviceManagementTroubleshootingEvent_id", deviceManagementTroubleshootingEventId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var deviceManagementTroubleshootingEventIdOption = new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent"); + deviceManagementTroubleshootingEventIdOption.IsRequired = true; + command.AddOption(deviceManagementTroubleshootingEventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (deviceManagementTroubleshootingEventId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of troubleshooting events for this user."; // Create options for all the parameters - command.AddOption(new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent")); - command.AddOption(new Option("--body")); + var deviceManagementTroubleshootingEventIdOption = new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent"); + deviceManagementTroubleshootingEventIdOption.IsRequired = true; + command.AddOption(deviceManagementTroubleshootingEventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (deviceManagementTroubleshootingEventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(deviceManagementTroubleshootingEventId)) requestInfo.PathParameters.Add("deviceManagementTroubleshootingEvent_id", deviceManagementTroubleshootingEventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/DirectReports/@Ref/RefRequestBuilder.cs b/src/generated/Me/DirectReports/@Ref/RefRequestBuilder.cs index e63858ffb12..4eec2d711a8 100644 --- a/src/generated/Me/DirectReports/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/DirectReports/@Ref/RefRequestBuilder.cs @@ -25,20 +25,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The users and contacts that report to the user. (The users and contacts that have their manager property set to this user.) Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,12 +71,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The users and contacts that report to the user. (The users and contacts that have their manager property set to this user.) Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/DirectReports/DirectReportsRequestBuilder.cs b/src/generated/Me/DirectReports/DirectReportsRequestBuilder.cs index 08296f23dc5..22f607d6957 100644 --- a/src/generated/Me/DirectReports/DirectReportsRequestBuilder.cs +++ b/src/generated/Me/DirectReports/DirectReportsRequestBuilder.cs @@ -26,24 +26,44 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The users and contacts that report to the user. (The users and contacts that have their manager property set to this user.) Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Drive/DriveRequestBuilder.cs b/src/generated/Me/Drive/DriveRequestBuilder.cs index 25bec42d21e..c9e58a6275f 100644 --- a/src/generated/Me/Drive/DriveRequestBuilder.cs +++ b/src/generated/Me/Drive/DriveRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildDeleteCommand() { command.Description = "The user's OneDrive. Read-only."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,12 +42,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's OneDrive. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,12 +73,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's OneDrive. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Drives/DrivesRequestBuilder.cs b/src/generated/Me/Drives/DrivesRequestBuilder.cs index 0771789ac89..671aa6e7408 100644 --- a/src/generated/Me/Drives/DrivesRequestBuilder.cs +++ b/src/generated/Me/Drives/DrivesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of drives available for this user. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of drives available for this user. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Drives/Item/DriveRequestBuilder.cs b/src/generated/Me/Drives/Item/DriveRequestBuilder.cs index 87aaa60ba40..5e348cd158b 100644 --- a/src/generated/Me/Drives/Item/DriveRequestBuilder.cs +++ b/src/generated/Me/Drives/Item/DriveRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of drives available for this user. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); command.Handler = CommandHandler.Create(async (driveId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of drives available for this user. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of drives available for this user. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Delta/Delta.cs b/src/generated/Me/Events/Delta/Delta.cs index ce84d659092..47940ca3a35 100644 --- a/src/generated/Me/Events/Delta/Delta.cs +++ b/src/generated/Me/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Events/Delta/DeltaRequestBuilder.cs index e0e471c80e6..cc44364bce6 100644 --- a/src/generated/Me/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Events/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/EventsRequestBuilder.cs b/src/generated/Me/Events/EventsRequestBuilder.cs index d7b0d6dd1d3..32f7daf8151 100644 --- a/src/generated/Me/Events/EventsRequestBuilder.cs +++ b/src/generated/Me/Events/EventsRequestBuilder.cs @@ -44,18 +44,21 @@ public List BuildCommand() { return commands; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable."; + command.Description = "The user's events. Default is to show events under the Default Calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,26 +71,41 @@ public Command BuildCreateCommand() { return command; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable."; + command.Description = "The user's events. Default is to show events under the Default Calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -113,7 +131,7 @@ public EventsRequestBuilder(Dictionary pathParameters, IRequestA RequestAdapter = requestAdapter; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -134,7 +152,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// /// Request headers /// Request options @@ -158,7 +176,7 @@ public DeltaRequestBuilder Delta() { return new DeltaRequestBuilder(PathParameters, RequestAdapter); } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -170,7 +188,7 @@ public async Task GetAsync(Action q = defaul return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -182,7 +200,7 @@ public async Task<@Event> PostAsync(@Event model, Action(requestInfo, responseHandler, cancellationToken); } - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Me/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Events/Item/Accept/AcceptRequestBuilder.cs index e28b34d8508..e6708847bbe 100644 --- a/src/generated/Me/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Me/Events/Item/Attachments/AttachmentsRequestBuilder.cs index 2999e27158d..d23d7f31a30 100644 --- a/src/generated/Me/Events/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,24 +73,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Me/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 7e9fc267fce..c9af0d88590 100644 --- a/src/generated/Me/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Me/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs index 389f67f184c..7efb3e31cad 100644 --- a/src/generated/Me/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index dcbf01369ad..f4a99be60b9 100644 --- a/src/generated/Me/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs index 9736d3a8581..915fda865a4 100644 --- a/src/generated/Me/Events/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +66,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs index e86eb4ee238..35a6f285add 100644 --- a/src/generated/Me/Events/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); command.Handler = CommandHandler.Create(async (eventId, calendarPermissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +48,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, calendarPermissionId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, calendarPermissionId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,16 +80,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, calendarPermissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/CalendarRequestBuilder.cs index 9beb998f6aa..f4a4dd6db42 100644 --- a/src/generated/Me/Events/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/CalendarRequestBuilder.cs @@ -55,10 +55,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -79,12 +81,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -116,14 +123,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs index 38faf27580b..af7f0dd8df7 100644 --- a/src/generated/Me/Events/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs @@ -44,14 +44,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,22 +74,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/Calendar/CalendarView/Delta/Delta.cs b/src/generated/Me/Events/Item/Calendar/CalendarView/Delta/Delta.cs index 171e2fc5cc2..4676e295d11 100644 --- a/src/generated/Me/Events/Item/Calendar/CalendarView/Delta/Delta.cs +++ b/src/generated/Me/Events/Item/Calendar/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.Events.Item.Calendar.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/Events/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs index be73dfde031..f2543151114 100644 --- a/src/generated/Me/Events/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs index 21b702291d8..5ab57ed732e 100644 --- a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs index f3d9fbf2d7a..f4912848f1c 100644 --- a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs index 3429c45ca7b..a4dd2527be3 100644 --- a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index ce6c3713e42..ee74acff549 100644 --- a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs index 8f1d87c0ad4..7625705bc4c 100644 --- a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs @@ -51,12 +51,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -82,14 +85,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,16 +117,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs index 2d2149057d6..7d4d0514340 100644 --- a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index d0f1f0d5087..7c53df094d8 100644 --- a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index b6ca5d68d35..7fbba420e5e 100644 --- a/src/generated/Me/Events/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/Events/Delta/Delta.cs b/src/generated/Me/Events/Item/Calendar/Events/Delta/Delta.cs index d0fccd7ae6e..7a4a66a1a41 100644 --- a/src/generated/Me/Events/Item/Calendar/Events/Delta/Delta.cs +++ b/src/generated/Me/Events/Item/Calendar/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.Events.Item.Calendar.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/Events/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs index 11adad5e338..539befcc795 100644 --- a/src/generated/Me/Events/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/Calendar/Events/EventsRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/Events/EventsRequestBuilder.cs index 05d4863764b..ff3bff21582 100644 --- a/src/generated/Me/Events/Item/Calendar/Events/EventsRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/Events/EventsRequestBuilder.cs @@ -44,14 +44,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,22 +74,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs index d13f3468b14..b9eb3431e20 100644 --- a/src/generated/Me/Events/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs index cd91dcd643e..14db9ea347e 100644 --- a/src/generated/Me/Events/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs index 74858b504d4..31fdf3a28f2 100644 --- a/src/generated/Me/Events/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index 2ba405b1e40..5f6d1f2a42f 100644 --- a/src/generated/Me/Events/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/Events/Item/EventRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/Events/Item/EventRequestBuilder.cs index d288bae8bbd..ecf5e9108cd 100644 --- a/src/generated/Me/Events/Item/Calendar/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/Events/Item/EventRequestBuilder.cs @@ -51,12 +51,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -82,14 +85,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,16 +117,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs index f5f1b43d96e..ee76396af06 100644 --- a/src/generated/Me/Events/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index d339b1338e9..b3676de70e5 100644 --- a/src/generated/Me/Events/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index cb7cd83ad52..759649b1ffe 100644 --- a/src/generated/Me/Events/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 2897959f477..ef85040dfb9 100644 --- a/src/generated/Me/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 5a4ed9473b3..48c078cffcb 100644 --- a/src/generated/Me/Events/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 2d5b63ca1f4..b5313d3969e 100644 --- a/src/generated/Me/Events/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index db817989598..b8e723c10cb 100644 --- a/src/generated/Me/Events/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Events/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index d521d07a4c1..9793e4fb0ef 100644 --- a/src/generated/Me/Events/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Events/Item/Cancel/CancelRequestBuilder.cs index e45604e3010..291f4f3788a 100644 --- a/src/generated/Me/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Events/Item/Decline/DeclineRequestBuilder.cs index b46560cd9c2..7397a2ccf3c 100644 --- a/src/generated/Me/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index 820f9d28ccc..9222543f5a2 100644 --- a/src/generated/Me/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/EventRequestBuilder.cs b/src/generated/Me/Events/Item/EventRequestBuilder.cs index 6762fdeca84..8c325fe3a49 100644 --- a/src/generated/Me/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Me/Events/Item/EventRequestBuilder.cs @@ -73,16 +73,18 @@ public Command BuildDeclineCommand() { return command; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable."; + command.Description = "The user's events. Default is to show events under the Default Calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -109,18 +111,23 @@ public Command BuildForwardCommand() { return command; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable."; + command.Description = "The user's events. Default is to show events under the Default Calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -147,20 +154,24 @@ public Command BuildMultiValueExtendedPropertiesCommand() { return command; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable."; + command.Description = "The user's events. Default is to show events under the Default Calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -200,7 +211,7 @@ public EventRequestBuilder(Dictionary pathParameters, IRequestAd RequestAdapter = requestAdapter; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Request headers /// Request options /// @@ -215,7 +226,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -236,7 +247,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// /// Request headers /// Request options @@ -254,7 +265,7 @@ public RequestInformation CreatePatchRequestInformation(@Event body, Action - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -265,7 +276,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -277,7 +288,7 @@ public async Task<@Event> GetAsync(Action q = default, Actio return await RequestAdapter.SendAsync<@Event>(requestInfo, responseHandler, cancellationToken); } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -289,7 +300,7 @@ public async Task PatchAsync(@Event model, Action> h var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Select properties to be returned public string[] Select { get; set; } diff --git a/src/generated/Me/Events/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/Events/Item/Extensions/ExtensionsRequestBuilder.cs index 9e3d34d41fc..6215c5e6162 100644 --- a/src/generated/Me/Events/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +66,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs index 266bdade8ce..ed004e6a376 100644 --- a/src/generated/Me/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/Events/Item/Forward/ForwardRequestBuilder.cs index 7169a419634..eef253c0b93 100644 --- a/src/generated/Me/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Instances/Delta/Delta.cs b/src/generated/Me/Events/Item/Instances/Delta/Delta.cs index 99ce14cfdb1..4e5d1968115 100644 --- a/src/generated/Me/Events/Item/Instances/Delta/Delta.cs +++ b/src/generated/Me/Events/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Me.Events.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Me/Events/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Events/Item/Instances/Delta/DeltaRequestBuilder.cs index 1f781381362..520cb2525b6 100644 --- a/src/generated/Me/Events/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Me/Events/Item/Instances/InstancesRequestBuilder.cs index 2d1e738dbdd..e83aa397b12 100644 --- a/src/generated/Me/Events/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Instances/InstancesRequestBuilder.cs @@ -44,14 +44,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,22 +74,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index ac5993d9976..668379108c1 100644 --- a/src/generated/Me/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index a7764b17e71..992767f95af 100644 --- a/src/generated/Me/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index ba235468bbd..97bc1c1981f 100644 --- a/src/generated/Me/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Me/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index ae765cba1e8..604283ab821 100644 --- a/src/generated/Me/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Me/Events/Item/Instances/Item/EventRequestBuilder.cs index b53ce876729..0cbb2f2ffce 100644 --- a/src/generated/Me/Events/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Instances/Item/EventRequestBuilder.cs @@ -51,12 +51,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -82,14 +85,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,16 +117,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index e293104779e..50c749f06f1 100644 --- a/src/generated/Me/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 519378afdea..292e1f0fb6d 100644 --- a/src/generated/Me/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index ddf26ec64b6..676b2c832bf 100644 --- a/src/generated/Me/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index fa2370c1560..53abecf3350 100644 --- a/src/generated/Me/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 8f1abafb00a..028e1b1765e 100644 --- a/src/generated/Me/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index dee8dce6746..bd744022c07 100644 --- a/src/generated/Me/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 506ee405f73..8ba72b4334e 100644 --- a/src/generated/Me/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Me/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index b0613f3598f..2e95ff97f75 100644 --- a/src/generated/Me/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Me/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Me/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 76a5279b0b1..81b33390622 100644 --- a/src/generated/Me/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Me/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ExportPersonalData/ExportPersonalDataRequestBuilder.cs b/src/generated/Me/ExportPersonalData/ExportPersonalDataRequestBuilder.cs index 7d434757fb2..8666bd6e42d 100644 --- a/src/generated/Me/ExportPersonalData/ExportPersonalDataRequestBuilder.cs +++ b/src/generated/Me/ExportPersonalData/ExportPersonalDataRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action exportPersonalData"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/Extensions/ExtensionsRequestBuilder.cs index 2a49ed0d5f4..9944562de1a 100644 --- a/src/generated/Me/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/Extensions/ExtensionsRequestBuilder.cs @@ -30,18 +30,21 @@ public List BuildCommand() { return commands; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The collection of open extensions defined for the user. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the user. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -54,30 +57,50 @@ public Command BuildCreateCommand() { return command; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The collection of open extensions defined for the user. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the user. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -103,7 +126,7 @@ public ExtensionsRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Request headers /// Request options /// Request query parameters @@ -124,7 +147,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// /// Request headers /// Request options @@ -142,7 +165,7 @@ public RequestInformation CreatePostRequestInformation(Extension body, Action - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -154,7 +177,7 @@ public async Task GetAsync(Action q = de return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -166,7 +189,7 @@ public async Task PostAsync(Extension model, Action(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Me/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/Extensions/Item/ExtensionRequestBuilder.cs index 3530488d05d..34a74fea0e7 100644 --- a/src/generated/Me/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/Extensions/Item/ExtensionRequestBuilder.cs @@ -20,16 +20,18 @@ public class ExtensionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The collection of open extensions defined for the user. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the user. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -37,20 +39,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The collection of open extensions defined for the user. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the user. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,20 +73,24 @@ public Command BuildGetCommand() { return command; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The collection of open extensions defined for the user. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the user. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -97,7 +111,7 @@ public ExtensionRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Request headers /// Request options /// @@ -112,7 +126,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Request headers /// Request options /// Request query parameters @@ -133,7 +147,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// /// Request headers /// Request options @@ -151,7 +165,7 @@ public RequestInformation CreatePatchRequestInformation(Extension body, Action - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +176,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +188,7 @@ public async Task GetAsync(Action q = default, Ac return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -186,7 +200,7 @@ public async Task PatchAsync(Extension model, Action var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Me/FindMeetingTimes/FindMeetingTimesRequestBuilder.cs b/src/generated/Me/FindMeetingTimes/FindMeetingTimesRequestBuilder.cs index 7e069033950..e4761c204e2 100644 --- a/src/generated/Me/FindMeetingTimes/FindMeetingTimesRequestBuilder.cs +++ b/src/generated/Me/FindMeetingTimes/FindMeetingTimesRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action findMeetingTimes"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/FollowedSites/@Ref/RefRequestBuilder.cs b/src/generated/Me/FollowedSites/@Ref/RefRequestBuilder.cs index ab669df764f..1cdc6f8cab9 100644 --- a/src/generated/Me/FollowedSites/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/FollowedSites/@Ref/RefRequestBuilder.cs @@ -25,20 +25,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of followedSites from me"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,12 +71,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Create new navigation property ref to followedSites for me"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/FollowedSites/FollowedSitesRequestBuilder.cs b/src/generated/Me/FollowedSites/FollowedSitesRequestBuilder.cs index 03942efb35e..a859b732b62 100644 --- a/src/generated/Me/FollowedSites/FollowedSitesRequestBuilder.cs +++ b/src/generated/Me/FollowedSites/FollowedSitesRequestBuilder.cs @@ -26,24 +26,44 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get followedSites from me"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/GetMailTips/GetMailTipsRequestBuilder.cs b/src/generated/Me/GetMailTips/GetMailTipsRequestBuilder.cs index ed4e16e03fb..bb94a2d34d3 100644 --- a/src/generated/Me/GetMailTips/GetMailTipsRequestBuilder.cs +++ b/src/generated/Me/GetMailTips/GetMailTipsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMailTips"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/GetManagedAppDiagnosticStatuses/GetManagedAppDiagnosticStatusesRequestBuilder.cs b/src/generated/Me/GetManagedAppDiagnosticStatuses/GetManagedAppDiagnosticStatusesRequestBuilder.cs index ced4d2fe44e..304d7551338 100644 --- a/src/generated/Me/GetManagedAppDiagnosticStatuses/GetManagedAppDiagnosticStatusesRequestBuilder.cs +++ b/src/generated/Me/GetManagedAppDiagnosticStatuses/GetManagedAppDiagnosticStatusesRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Gets diagnostics validation status for a given user."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/GetManagedAppPolicies/GetManagedAppPoliciesRequestBuilder.cs b/src/generated/Me/GetManagedAppPolicies/GetManagedAppPoliciesRequestBuilder.cs index 6fd93d428ab..bfeaed3b6cc 100644 --- a/src/generated/Me/GetManagedAppPolicies/GetManagedAppPoliciesRequestBuilder.cs +++ b/src/generated/Me/GetManagedAppPolicies/GetManagedAppPoliciesRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Gets app restrictions for a given user."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/GetMemberGroups/GetMemberGroupsRequestBuilder.cs b/src/generated/Me/GetMemberGroups/GetMemberGroupsRequestBuilder.cs index 2b06e4b77c7..3efb7e31287 100644 --- a/src/generated/Me/GetMemberGroups/GetMemberGroupsRequestBuilder.cs +++ b/src/generated/Me/GetMemberGroups/GetMemberGroupsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/GetMemberObjects/GetMemberObjectsRequestBuilder.cs b/src/generated/Me/GetMemberObjects/GetMemberObjectsRequestBuilder.cs index e9fed68fb87..fef1c8a8d82 100644 --- a/src/generated/Me/GetMemberObjects/GetMemberObjectsRequestBuilder.cs +++ b/src/generated/Me/GetMemberObjects/GetMemberObjectsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/InferenceClassification/InferenceClassificationRequestBuilder.cs b/src/generated/Me/InferenceClassification/InferenceClassificationRequestBuilder.cs index c52de747343..114a97fbee3 100644 --- a/src/generated/Me/InferenceClassification/InferenceClassificationRequestBuilder.cs +++ b/src/generated/Me/InferenceClassification/InferenceClassificationRequestBuilder.cs @@ -28,7 +28,8 @@ public Command BuildDeleteCommand() { command.Description = "Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +43,14 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,12 +76,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/InferenceClassification/Overrides/Item/InferenceClassificationOverrideRequestBuilder.cs b/src/generated/Me/InferenceClassification/Overrides/Item/InferenceClassificationOverrideRequestBuilder.cs index da6c345c72e..52cf5518331 100644 --- a/src/generated/Me/InferenceClassification/Overrides/Item/InferenceClassificationOverrideRequestBuilder.cs +++ b/src/generated/Me/InferenceClassification/Overrides/Item/InferenceClassificationOverrideRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--inferenceclassificationoverride-id", description: "key: id of inferenceClassificationOverride")); + var inferenceClassificationOverrideIdOption = new Option("--inferenceclassificationoverride-id", description: "key: id of inferenceClassificationOverride"); + inferenceClassificationOverrideIdOption.IsRequired = true; + command.AddOption(inferenceClassificationOverrideIdOption); command.Handler = CommandHandler.Create(async (inferenceClassificationOverrideId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(inferenceClassificationOverrideId)) requestInfo.PathParameters.Add("inferenceClassificationOverride_id", inferenceClassificationOverrideId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,12 +45,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--inferenceclassificationoverride-id", description: "key: id of inferenceClassificationOverride")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (inferenceClassificationOverrideId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(inferenceClassificationOverrideId)) requestInfo.PathParameters.Add("inferenceClassificationOverride_id", inferenceClassificationOverrideId); - requestInfo.QueryParameters.Add("select", select); + var inferenceClassificationOverrideIdOption = new Option("--inferenceclassificationoverride-id", description: "key: id of inferenceClassificationOverride"); + inferenceClassificationOverrideIdOption.IsRequired = true; + command.AddOption(inferenceClassificationOverrideIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (inferenceClassificationOverrideId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,14 +74,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--inferenceclassificationoverride-id", description: "key: id of inferenceClassificationOverride")); - command.AddOption(new Option("--body")); + var inferenceClassificationOverrideIdOption = new Option("--inferenceclassificationoverride-id", description: "key: id of inferenceClassificationOverride"); + inferenceClassificationOverrideIdOption.IsRequired = true; + command.AddOption(inferenceClassificationOverrideIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (inferenceClassificationOverrideId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(inferenceClassificationOverrideId)) requestInfo.PathParameters.Add("inferenceClassificationOverride_id", inferenceClassificationOverrideId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/InferenceClassification/Overrides/OverridesRequestBuilder.cs b/src/generated/Me/InferenceClassification/Overrides/OverridesRequestBuilder.cs index 25999f9453a..b054c88e1c1 100644 --- a/src/generated/Me/InferenceClassification/Overrides/OverridesRequestBuilder.cs +++ b/src/generated/Me/InferenceClassification/Overrides/OverridesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,20 +63,35 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/InsightsRequestBuilder.cs b/src/generated/Me/Insights/InsightsRequestBuilder.cs index 28a8b652ab3..e2a80041078 100644 --- a/src/generated/Me/Insights/InsightsRequestBuilder.cs +++ b/src/generated/Me/Insights/InsightsRequestBuilder.cs @@ -30,7 +30,8 @@ public Command BuildDeleteCommand() { command.Description = "Read-only. Nullable."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +45,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,12 +76,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/@Ref/RefRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/@Ref/RefRequestBuilder.cs index 1e89a25cded..9f084b47ad2 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete ref of navigation property lastSharedMethod for me"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of lastSharedMethod from me"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update the ref of navigation property lastSharedMethod in me"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs index 939eaf7e086..f214a0976c6 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/LastSharedMethodRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/LastSharedMethodRequestBuilder.cs index 09e17d83ace..9ac1bddabe1 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/LastSharedMethodRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/LastSharedMethodRequestBuilder.cs @@ -46,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get lastSharedMethod from me"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedInsightId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedInsightId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index becea9bf7cc..8109cd4f2b6 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/Commit/CommitRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/Commit/CommitRequestBuilder.cs index ee596a1a59b..9b38e4dd723 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/Commit/CommitRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/Commit/CommitRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Commits a file of a given app."; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs index 0ee63cfd5eb..bd2f626295c 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Renews the SAS URI for an application file upload."; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 69d884e6779..30df1d92731 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Abort/AbortRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Abort/AbortRequestBuilder.cs index 5aece1f385a..64610f4f8b8 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Abort/AbortRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Abort/AbortRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action abort"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Cancel/CancelRequestBuilder.cs index 2f913397351..cf21ff80c57 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Cancel/CancelRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Redirect/RedirectRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Redirect/RedirectRequestBuilder.cs index 2a4895fd489..5cf187d52b5 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Redirect/RedirectRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Redirect/RedirectRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action redirect"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Start/StartRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Start/StartRequestBuilder.cs index 2e971ef1874..516bda1b7ac 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Start/StartRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/PrintJob/Start/StartRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action start"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs index cf29f8333f5..b5416795e17 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action approve"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs index 0e6155f4dd9..90442793a0a 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs index d12d27ee73c..bf28a7957d3 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index f5f595d0749..94b6d2ea13a 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WindowsInformationProtection/Assign/AssignRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WindowsInformationProtection/Assign/AssignRequestBuilder.cs index ecaeb80864b..16eedc1c023 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WindowsInformationProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WindowsInformationProtection/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs index fa4e8c598b3..8d6b91608f8 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function boundingRect"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (sharedInsightId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index ae845cd4d82..66d860f3fbf 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (sharedInsightId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Clear/ClearRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Clear/ClearRequestBuilder.cs index ba16fa8a79b..0e30afe051f 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Clear/ClearRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs index 8def32d557a..ec80d92c318 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function column"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (sharedInsightId, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs index c113283660c..c53645259c8 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs index 6b8ceb353de..ce9fbe74d99 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs index 31ebc059a61..4e01ec5cef8 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs index a70813b0638..8c5311c7811 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Delete/DeleteRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Delete/DeleteRequestBuilder.cs index aabf117127e..7b949dbf88c 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Delete/DeleteRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Delete/DeleteRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action delete"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs index afc8c01feb3..6ffa42c42b3 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireColumn"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs index 40567bec369..56ce9b7d9bc 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireRow"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Insert/InsertRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Insert/InsertRequestBuilder.cs index 4735828df49..f8fde0eb5f7 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Insert/InsertRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Insert/InsertRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action insert"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs index f9ea317dc13..de4493fe826 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function intersection"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (sharedInsightId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastCell/LastCellRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastCell/LastCellRequestBuilder.cs index dda28698f28..ed2ba699939 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastCell/LastCellRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastCell/LastCellRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastCell"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs index 8d91c6c95b8..a5e7f247f1c 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastColumn"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastRow/LastRowRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastRow/LastRowRequestBuilder.cs index 2e2082b510e..717df6ddd74 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastRow/LastRowRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastRow/LastRowRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastRow"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Merge/MergeRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Merge/MergeRequestBuilder.cs index 393a204bb60..dc0b48aaf92 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Merge/MergeRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Merge/MergeRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action merge"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs index 96b1c4f8988..0bbf3d05b33 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function offsetRange"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}")); - command.AddOption(new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var rowOffsetOption = new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}"); + rowOffsetOption.IsRequired = true; + command.AddOption(rowOffsetOption); + var columnOffsetOption = new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}"); + columnOffsetOption.IsRequired = true; + command.AddOption(columnOffsetOption); command.Handler = CommandHandler.Create(async (sharedInsightId, rowOffset, columnOffset) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("rowOffset", rowOffset); - requestInfo.PathParameters.Add("columnOffset", columnOffset); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs index 0e136fc62ce..ecfb16c56c8 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function resizedRange"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--deltarows", description: "Usage: deltaRows={deltaRows}")); - command.AddOption(new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var deltaRowsOption = new Option("--deltarows", description: "Usage: deltaRows={deltaRows}"); + deltaRowsOption.IsRequired = true; + command.AddOption(deltaRowsOption); + var deltaColumnsOption = new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}"); + deltaColumnsOption.IsRequired = true; + command.AddOption(deltaColumnsOption); command.Handler = CommandHandler.Create(async (sharedInsightId, deltaRows, deltaColumns) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("deltaRows", deltaRows); - requestInfo.PathParameters.Add("deltaColumns", deltaColumns); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs index 2e9ba13e188..16b086a22ea 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function row"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); command.Handler = CommandHandler.Create(async (sharedInsightId, row) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("row", row); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs index 7a6338dd391..90dbd623cde 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs index 2cc923d673f..fb21330ac05 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs index 58cc6fcbbcb..4f832546faa 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs index 7cd4cb33f52..da3892abdf5 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs index 1bd51caf7a4..6089157a9cd 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unmerge"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs index be6ee0d0959..4fca85b8f76 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 281aa165dfd..0709c3d9bf8 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs index 6ded8012145..28ad5b7ed0e 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function visibleView"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFill/Clear/ClearRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFill/Clear/ClearRequestBuilder.cs index af75fa09c2e..1121c6713fe 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFill/Clear/ClearRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs index fe5ba9d1a76..8520fc3ce19 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitColumns"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs index 23bccbbabf1..fb1f32ae2f4 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitRows"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs index 7808e7dd11e..c41aac6d91c 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action apply"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeView/Range/RangeRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeView/Range/RangeRequestBuilder.cs index 656111beb3f..4473e6c1454 100644 --- a/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeView/Range/RangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/LastSharedMethod/WorkbookRangeView/Range/RangeRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/@Ref/RefRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/@Ref/RefRequestBuilder.cs index a9367cc99b5..5546845dbf5 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Used for navigating to the item that was shared. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used for navigating to the item that was shared. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Used for navigating to the item that was shared. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs index f03b66c6f78..f80d7c3be5a 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index 211bda235ce..8b12e3d7068 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs index e337d509a16..7570c024d5d 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Commits a file of a given app."; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs index c1334c9bd66..1947dec7d4f 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Renews the SAS URI for an application file upload."; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 1ce0a33de8a..006a0e26d0b 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs index d517f768d29..78d7916ce9f 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action abort"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs index badb7371e85..44d02c181f5 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs index b4e53e97afa..0539427daa0 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action redirect"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Start/StartRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Start/StartRequestBuilder.cs index 51c107f0e19..4dda069c629 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Start/StartRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/PrintJob/Start/StartRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action start"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/ResourceRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/ResourceRequestBuilder.cs index 8d5c3abe6b5..2ce54e1795c 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/ResourceRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/ResourceRequestBuilder.cs @@ -46,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used for navigating to the item that was shared. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedInsightId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedInsightId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs index 2ea3a707535..74cfb79ab50 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action approve"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs index 71e1ca25ed1..283a128068e 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs index 4cd851e038f..f60b7c9431a 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index 01cc32a712c..8eccceb78df 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs index 83821d6d659..3380881fcf3 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs index 2d06985f907..bf5fce4fa0b 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function boundingRect"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (sharedInsightId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index 4740bce63ce..c234fa470b4 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (sharedInsightId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs index fc7630a4bcf..6f0cd719e84 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs index 134084d4bbf..e4dfd189449 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function column"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (sharedInsightId, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs index 4dd3d8f6f2c..d782f705ba4 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs index 3c9867bb16a..fd5cd898424 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs index 0096a08269b..a536128d891 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs index 8dee3b2b3ed..0fcb0eea348 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs index eff85525c44..5e858a0559f 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action delete"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs index 8c1df36161b..69f9a57f82e 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireColumn"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs index 1e8f566e934..84950b18082 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireRow"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs index 6c61222e6bc..90589853060 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action insert"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs index 6ecd7e1d188..806d64b3d94 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function intersection"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (sharedInsightId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs index 43d45b25cba..7969c73b9ca 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastCell"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs index a80dbaeca2c..f71dc3111ea 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastColumn"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs index 3116112a892..c013a2298ce 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastRow"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs index 2332e6d0bef..cbbc31383d8 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action merge"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs index 23ea01f6dae..dfa294dd146 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function offsetRange"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}")); - command.AddOption(new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var rowOffsetOption = new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}"); + rowOffsetOption.IsRequired = true; + command.AddOption(rowOffsetOption); + var columnOffsetOption = new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}"); + columnOffsetOption.IsRequired = true; + command.AddOption(columnOffsetOption); command.Handler = CommandHandler.Create(async (sharedInsightId, rowOffset, columnOffset) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("rowOffset", rowOffset); - requestInfo.PathParameters.Add("columnOffset", columnOffset); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs index 628886accd6..0baa7740f20 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function resizedRange"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--deltarows", description: "Usage: deltaRows={deltaRows}")); - command.AddOption(new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var deltaRowsOption = new Option("--deltarows", description: "Usage: deltaRows={deltaRows}"); + deltaRowsOption.IsRequired = true; + command.AddOption(deltaRowsOption); + var deltaColumnsOption = new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}"); + deltaColumnsOption.IsRequired = true; + command.AddOption(deltaColumnsOption); command.Handler = CommandHandler.Create(async (sharedInsightId, deltaRows, deltaColumns) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("deltaRows", deltaRows); - requestInfo.PathParameters.Add("deltaColumns", deltaColumns); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs index 531e7f2c8a1..a276b720b97 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function row"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); command.Handler = CommandHandler.Create(async (sharedInsightId, row) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("row", row); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs index 9d569bb9a08..4c0db03e8ef 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs index 707069756cf..1c087350798 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs index 16e88a68b79..74aa8ecc85c 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs index 6fdc7c16173..c6b4ff50d06 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs index 9995681bf93..4fe0c17a2c8 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unmerge"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs index c0d95d05da8..cd0bbe0466b 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 377ed0f383e..db3ced89cb3 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs index 8088187aa37..f4d5fe3da67 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function visibleView"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs index f0c4267f19e..134621c1f41 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs index a1a32120756..3b75df64650 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitColumns"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs index 1e6de6130a9..15005b50d10 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitRows"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs index a8582dd23b6..7ca56e6e00d 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action apply"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs index d7a2bb594c4..f3ef55a259e 100644 --- a/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Shared/Item/SharedInsightRequestBuilder.cs b/src/generated/Me/Insights/Shared/Item/SharedInsightRequestBuilder.cs index c1385146155..bd3dcfb9837 100644 --- a/src/generated/Me/Insights/Shared/Item/SharedInsightRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/Item/SharedInsightRequestBuilder.cs @@ -22,16 +22,18 @@ public class SharedInsightRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (sharedInsightId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,20 +41,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedInsightId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedInsightId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,20 +95,24 @@ public Command BuildLastSharedMethodCommand() { return command; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -139,7 +153,7 @@ public SharedInsightRequestBuilder(Dictionary pathParameters, IR RequestAdapter = requestAdapter; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// @@ -154,7 +168,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// Request query parameters @@ -175,7 +189,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// /// Request headers /// Request options @@ -193,7 +207,7 @@ public RequestInformation CreatePatchRequestInformation(SharedInsight body, Acti return requestInfo; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -204,7 +218,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -216,7 +230,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -228,7 +242,7 @@ public async Task PatchAsync(SharedInsight model, ActionCalculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Me/Insights/Shared/SharedRequestBuilder.cs b/src/generated/Me/Insights/Shared/SharedRequestBuilder.cs index 5f237f3aa81..11702abcbaa 100644 --- a/src/generated/Me/Insights/Shared/SharedRequestBuilder.cs +++ b/src/generated/Me/Insights/Shared/SharedRequestBuilder.cs @@ -32,18 +32,21 @@ public List BuildCommand() { return commands; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,30 +59,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -105,7 +128,7 @@ public SharedRequestBuilder(Dictionary pathParameters, IRequestA RequestAdapter = requestAdapter; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// Request query parameters @@ -126,7 +149,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// /// Request headers /// Request options @@ -144,7 +167,7 @@ public RequestInformation CreatePostRequestInformation(SharedInsight body, Actio return requestInfo; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -156,7 +179,7 @@ public async Task GetAsync(Action q = defaul return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -168,7 +191,7 @@ public async Task PostAsync(SharedInsight model, Action(requestInfo, responseHandler, cancellationToken); } - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Me/Insights/Trending/Item/Resource/@Ref/RefRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/@Ref/RefRequestBuilder.cs index 6ab6389a52c..a133bc06588 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Used for navigating to the trending document."; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used for navigating to the trending document."; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Used for navigating to the trending document."; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs index 5ff7d193aed..99d5ad20fb8 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index f0d464c0939..5156120710a 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs index f313365f790..16d35a4107e 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Commits a file of a given app."; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs index 9252c571300..ddeac5b53cb 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Renews the SAS URI for an application file upload."; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 121d9550ffb..e02fda1b574 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs index 15da37ac39c..29311fa562e 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action abort"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs index 27deca1e569..cfe960d1af9 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs index 397c920c86a..317a7c77722 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action redirect"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Start/StartRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Start/StartRequestBuilder.cs index ab8bc093898..3a590affbb7 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Start/StartRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/PrintJob/Start/StartRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action start"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/ResourceRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/ResourceRequestBuilder.cs index 5a4e465f6c0..52406763cde 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/ResourceRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/ResourceRequestBuilder.cs @@ -46,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used for navigating to the trending document."; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (trendingId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (trendingId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs index 0209b3b91a7..cee7f169651 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action approve"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs index 530db7db9f3..ac75140d3f8 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs index aebc16656bb..1e3545b8c94 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index 2d15051760d..296a9d23d6e 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs index 1f011fc02cd..70f957cbdb7 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs index a47ae9b3a8e..789ded1ee68 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function boundingRect"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (trendingId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index 838b20c63bf..31d16ecfc34 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (trendingId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs index 33b262da3f6..d365fc18a96 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs index 2a481969700..ac0951014cb 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function column"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (trendingId, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs index 7cc711c77a8..69b3c753b09 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs index 70127ae1864..158ef8d050f 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (trendingId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs index ad4a481a217..b25d6584f78 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs index 1d861b9ebe1..8e12e50d799 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (trendingId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs index b6291fc995f..9d366f3ecf7 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action delete"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs index 58bd2e623be..0e445378ab9 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireColumn"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs index 30a85b319bf..35a071f24c0 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireRow"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs index 832f7ee862a..b61d9c4ae26 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action insert"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs index 559abebf6f5..c296744ad7c 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function intersection"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (trendingId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs index b1e64481c5b..1b25d5ea313 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastCell"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs index e4c73934968..cd9636a6989 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastColumn"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs index 6602fd4a98e..632531bf969 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastRow"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs index 0546b8bb918..cc6271ec1f3 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action merge"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs index 71f30dbdcd5..10feb5f1cf1 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function offsetRange"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}")); - command.AddOption(new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var rowOffsetOption = new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}"); + rowOffsetOption.IsRequired = true; + command.AddOption(rowOffsetOption); + var columnOffsetOption = new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}"); + columnOffsetOption.IsRequired = true; + command.AddOption(columnOffsetOption); command.Handler = CommandHandler.Create(async (trendingId, rowOffset, columnOffset) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("rowOffset", rowOffset); - requestInfo.PathParameters.Add("columnOffset", columnOffset); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs index 21fd2bb5127..d99ca7749cd 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function resizedRange"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--deltarows", description: "Usage: deltaRows={deltaRows}")); - command.AddOption(new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var deltaRowsOption = new Option("--deltarows", description: "Usage: deltaRows={deltaRows}"); + deltaRowsOption.IsRequired = true; + command.AddOption(deltaRowsOption); + var deltaColumnsOption = new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}"); + deltaColumnsOption.IsRequired = true; + command.AddOption(deltaColumnsOption); command.Handler = CommandHandler.Create(async (trendingId, deltaRows, deltaColumns) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("deltaRows", deltaRows); - requestInfo.PathParameters.Add("deltaColumns", deltaColumns); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs index 2484b8ba53a..a2e957405a8 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function row"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); command.Handler = CommandHandler.Create(async (trendingId, row) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("row", row); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs index 366c7bbeed3..f916431acbc 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs index 2a66f04d9b5..d8643d12493 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (trendingId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs index 25b3d572d3a..8cde2c439fa 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs index 9bb10d65221..c9a20b10556 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (trendingId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs index ab7de7ec7c5..3f2c8fafaff 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unmerge"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs index b0fd613551a..1498e69ecaf 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 0760a39c514..d0a3ba4243e 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (trendingId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs index 9c0afc3af8a..a4b2361d748 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function visibleView"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs index f55911969a9..8fa66820742 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs index 1347916af87..6eb83f94cfb 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitColumns"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs index d2f747d9b8b..d6ad9379b4e 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitRows"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs index f0ef6dd3320..eed31f45d55 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action apply"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs index 37767cedc05..07497628523 100644 --- a/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Trending/Item/TrendingRequestBuilder.cs b/src/generated/Me/Insights/Trending/Item/TrendingRequestBuilder.cs index a4a08a5c694..e89c322ba55 100644 --- a/src/generated/Me/Insights/Trending/Item/TrendingRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/Item/TrendingRequestBuilder.cs @@ -21,16 +21,18 @@ public class TrendingRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (trendingId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -38,20 +40,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (trendingId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (trendingId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,20 +74,24 @@ public Command BuildGetCommand() { return command; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -118,7 +132,7 @@ public TrendingRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// @@ -133,7 +147,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// Request query parameters @@ -154,7 +168,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// /// Request headers /// Request options @@ -172,7 +186,7 @@ public RequestInformation CreatePatchRequestInformation(ApiSdk.Models.Microsoft. return requestInfo; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -183,7 +197,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -195,7 +209,7 @@ public async Task DeleteAsync(Action> h = default, I return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -207,7 +221,7 @@ public async Task PatchAsync(ApiSdk.Models.Microsoft.Graph.Trending model, Actio var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Me/Insights/Trending/TrendingRequestBuilder.cs b/src/generated/Me/Insights/Trending/TrendingRequestBuilder.cs index 70149b58dcc..46918daa46f 100644 --- a/src/generated/Me/Insights/Trending/TrendingRequestBuilder.cs +++ b/src/generated/Me/Insights/Trending/TrendingRequestBuilder.cs @@ -28,18 +28,21 @@ public List BuildCommand() { return commands; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -52,30 +55,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -101,7 +124,7 @@ public TrendingRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// Request query parameters @@ -122,7 +145,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// /// Request headers /// Request options @@ -140,7 +163,7 @@ public RequestInformation CreatePostRequestInformation(ApiSdk.Models.Microsoft.G return requestInfo; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -152,7 +175,7 @@ public async Task GetAsync(Action q = defa return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -164,7 +187,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Me/Insights/Used/Item/Resource/@Ref/RefRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/@Ref/RefRequestBuilder.cs index c95b7859533..04175949260 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Used for navigating to the item that was used. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used for navigating to the item that was used. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Used for navigating to the item that was used. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs index 05d2af169fe..af58b9d21a7 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index e9830e5684f..41ff6303740 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs index eb599620d55..0fc8234c4a7 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Commits a file of a given app."; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs index a0d85a7a19c..e7050237366 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Renews the SAS URI for an application file upload."; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index a080bbfce0c..d4c16df4083 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs index 13f9426597b..642fa9d597b 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action abort"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs index ebdd44759dc..0d7261528e2 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs index eacf3dbcb90..e46523ae0cc 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action redirect"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Start/StartRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Start/StartRequestBuilder.cs index d2d144bf812..011fd3c226e 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Start/StartRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/PrintJob/Start/StartRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action start"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/ResourceRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/ResourceRequestBuilder.cs index d0a2acc36a8..77f4e466eb7 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/ResourceRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/ResourceRequestBuilder.cs @@ -46,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used for navigating to the item that was used. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (usedInsightId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (usedInsightId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs index 55371c4b8b6..1004c3b807a 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action approve"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs index 36af9c5430e..19036435f5e 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs index 0f6e7bda53d..e7eefb15169 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index 06cb04b5430..778f372d9de 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs index a798871edd8..b183f6faa33 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs index 02f86b72e10..39514085f61 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function boundingRect"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (usedInsightId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index 181a8611ba2..824601e4251 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (usedInsightId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs index 739e1fff1c8..1ee7cbe87f5 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs index 6f66fc40894..cb9c74f2451 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function column"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (usedInsightId, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs index 0ca6078a8f0..6c716d4db36 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs index 8d48a8cbc48..65c22adffea 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (usedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs index ab488f64d24..67f51eaf724 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs index 99f0ae1d8e6..c3a285ee673 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (usedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs index 898c3a58b43..d8292579e43 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action delete"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs index 09cfbab6337..872269881fe 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireColumn"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs index f7d95725b93..cd3fb65b95a 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireRow"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs index 3b93e916d90..d9d9d1f2aea 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action insert"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs index 4d40818305f..4327daa1d3e 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function intersection"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (usedInsightId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs index e36150185a5..5d7b0668870 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastCell"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs index 3a657282980..b8933d40a8a 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastColumn"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs index 4b413fa2c77..72093e1fd3b 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastRow"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs index 0844c72a1a2..5cae3953688 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action merge"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs index 9692c812427..5d4ee253d9c 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function offsetRange"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}")); - command.AddOption(new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var rowOffsetOption = new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}"); + rowOffsetOption.IsRequired = true; + command.AddOption(rowOffsetOption); + var columnOffsetOption = new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}"); + columnOffsetOption.IsRequired = true; + command.AddOption(columnOffsetOption); command.Handler = CommandHandler.Create(async (usedInsightId, rowOffset, columnOffset) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("rowOffset", rowOffset); - requestInfo.PathParameters.Add("columnOffset", columnOffset); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs index d1e71fdfb7d..e751f743d50 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function resizedRange"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--deltarows", description: "Usage: deltaRows={deltaRows}")); - command.AddOption(new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var deltaRowsOption = new Option("--deltarows", description: "Usage: deltaRows={deltaRows}"); + deltaRowsOption.IsRequired = true; + command.AddOption(deltaRowsOption); + var deltaColumnsOption = new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}"); + deltaColumnsOption.IsRequired = true; + command.AddOption(deltaColumnsOption); command.Handler = CommandHandler.Create(async (usedInsightId, deltaRows, deltaColumns) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("deltaRows", deltaRows); - requestInfo.PathParameters.Add("deltaColumns", deltaColumns); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs index 9efc78a8112..81da1eadeb4 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function row"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); command.Handler = CommandHandler.Create(async (usedInsightId, row) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("row", row); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs index b5ad70aa203..0d009550fd0 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs index 5a52237e6ec..1a09e8cc536 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (usedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs index 1d1d450155c..3e5ca926598 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs index 28d47c61edc..5d2d0ac14cf 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (usedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs index 9fecdafe8d4..3f6cc1c54f6 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unmerge"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs index 5ae632b9f0c..d4664634bf0 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 96b1a325947..81be73b5394 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (usedInsightId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs index 855f8be17c1..13b6f7f2c39 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function visibleView"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs index 36d15be5fad..c3e327cf00f 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs index 8df7a6ee4d1..4986dec7583 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitColumns"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs index 9db2b6e1623..957ce28c261 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitRows"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs index 59bd6d19034..52507ab8fd0 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action apply"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs index d9dcf7f93af..5ebe9a0679c 100644 --- a/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Insights/Used/Item/UsedInsightRequestBuilder.cs b/src/generated/Me/Insights/Used/Item/UsedInsightRequestBuilder.cs index a399d995ba6..905c330edc6 100644 --- a/src/generated/Me/Insights/Used/Item/UsedInsightRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/Item/UsedInsightRequestBuilder.cs @@ -21,16 +21,18 @@ public class UsedInsightRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (usedInsightId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -38,20 +40,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (usedInsightId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (usedInsightId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,20 +74,24 @@ public Command BuildGetCommand() { return command; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -118,7 +132,7 @@ public UsedInsightRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// @@ -133,7 +147,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// Request query parameters @@ -154,7 +168,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// /// Request headers /// Request options @@ -172,7 +186,7 @@ public RequestInformation CreatePatchRequestInformation(UsedInsight body, Action return requestInfo; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -183,7 +197,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -195,7 +209,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -207,7 +221,7 @@ public async Task PatchAsync(UsedInsight model, ActionCalculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Me/Insights/Used/UsedRequestBuilder.cs b/src/generated/Me/Insights/Used/UsedRequestBuilder.cs index 43be8e67b93..0ddbf3bcb68 100644 --- a/src/generated/Me/Insights/Used/UsedRequestBuilder.cs +++ b/src/generated/Me/Insights/Used/UsedRequestBuilder.cs @@ -31,18 +31,21 @@ public List BuildCommand() { return commands; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -55,30 +58,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -104,7 +127,7 @@ public UsedRequestBuilder(Dictionary pathParameters, IRequestAda RequestAdapter = requestAdapter; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// Request query parameters @@ -125,7 +148,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// /// Request headers /// Request options @@ -143,7 +166,7 @@ public RequestInformation CreatePostRequestInformation(UsedInsight body, Action< return requestInfo; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -155,7 +178,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -167,7 +190,7 @@ public async Task PostAsync(UsedInsight model, Action(requestInfo, responseHandler, cancellationToken); } - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Me/JoinedTeams/Item/TeamRequestBuilder.cs b/src/generated/Me/JoinedTeams/Item/TeamRequestBuilder.cs index 64d01474ae8..cf9f979f829 100644 --- a/src/generated/Me/JoinedTeams/Item/TeamRequestBuilder.cs +++ b/src/generated/Me/JoinedTeams/Item/TeamRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The Microsoft Teams teams that the user is a member of. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The Microsoft Teams teams that the user is a member of. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The Microsoft Teams teams that the user is a member of. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/JoinedTeams/JoinedTeamsRequestBuilder.cs b/src/generated/Me/JoinedTeams/JoinedTeamsRequestBuilder.cs index 3455dffd65f..a320621c634 100644 --- a/src/generated/Me/JoinedTeams/JoinedTeamsRequestBuilder.cs +++ b/src/generated/Me/JoinedTeams/JoinedTeamsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The Microsoft Teams teams that the user is a member of. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The Microsoft Teams teams that the user is a member of. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/LicenseDetails/Item/LicenseDetailsRequestBuilder.cs b/src/generated/Me/LicenseDetails/Item/LicenseDetailsRequestBuilder.cs index de813969429..aa8bdc7c2e9 100644 --- a/src/generated/Me/LicenseDetails/Item/LicenseDetailsRequestBuilder.cs +++ b/src/generated/Me/LicenseDetails/Item/LicenseDetailsRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of this user's license details. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--licensedetails-id", description: "key: id of licenseDetails")); + var licenseDetailsIdOption = new Option("--licensedetails-id", description: "key: id of licenseDetails"); + licenseDetailsIdOption.IsRequired = true; + command.AddOption(licenseDetailsIdOption); command.Handler = CommandHandler.Create(async (licenseDetailsId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(licenseDetailsId)) requestInfo.PathParameters.Add("licenseDetails_id", licenseDetailsId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of this user's license details. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--licensedetails-id", description: "key: id of licenseDetails")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (licenseDetailsId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(licenseDetailsId)) requestInfo.PathParameters.Add("licenseDetails_id", licenseDetailsId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var licenseDetailsIdOption = new Option("--licensedetails-id", description: "key: id of licenseDetails"); + licenseDetailsIdOption.IsRequired = true; + command.AddOption(licenseDetailsIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (licenseDetailsId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of this user's license details. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--licensedetails-id", description: "key: id of licenseDetails")); - command.AddOption(new Option("--body")); + var licenseDetailsIdOption = new Option("--licensedetails-id", description: "key: id of licenseDetails"); + licenseDetailsIdOption.IsRequired = true; + command.AddOption(licenseDetailsIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (licenseDetailsId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(licenseDetailsId)) requestInfo.PathParameters.Add("licenseDetails_id", licenseDetailsId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/LicenseDetails/LicenseDetailsRequestBuilder.cs b/src/generated/Me/LicenseDetails/LicenseDetailsRequestBuilder.cs index 5bcdfad49d2..5ed2e2c887e 100644 --- a/src/generated/Me/LicenseDetails/LicenseDetailsRequestBuilder.cs +++ b/src/generated/Me/LicenseDetails/LicenseDetailsRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of this user's license details. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,24 +61,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of this user's license details. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Delta/DeltaRequestBuilder.cs b/src/generated/Me/MailFolders/Delta/DeltaRequestBuilder.cs index fa3102dbc5c..78da77876b2 100644 --- a/src/generated/Me/MailFolders/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs b/src/generated/Me/MailFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs index d25ac93a1ff..4d968f6b75e 100644 --- a/src/generated/Me/MailFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs @@ -39,14 +39,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of child folders in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,24 +69,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of child folders in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs b/src/generated/Me/MailFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs index 9bf268e9d83..5aa8e5def44 100644 --- a/src/generated/Me/MailFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); command.Handler = CommandHandler.Create(async (mailFolderId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/ChildFolders/Item/Copy/CopyRequestBuilder.cs b/src/generated/Me/MailFolders/Item/ChildFolders/Item/Copy/CopyRequestBuilder.cs index 1d9cee961d7..7a9fdfd7503 100644 --- a/src/generated/Me/MailFolders/Item/ChildFolders/Item/Copy/CopyRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/ChildFolders/Item/Copy/CopyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copy"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--mailfolder-id1", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var mailFolderId1Option = new Option("--mailfolder-id1", description: "key: id of mailFolder"); + mailFolderId1Option.IsRequired = true; + command.AddOption(mailFolderId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, mailFolderId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(mailFolderId1)) requestInfo.PathParameters.Add("mailFolder_id1", mailFolderId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/ChildFolders/Item/MailFolderRequestBuilder.cs b/src/generated/Me/MailFolders/Item/ChildFolders/Item/MailFolderRequestBuilder.cs index 1fcc78a611a..a5edb8f10cb 100644 --- a/src/generated/Me/MailFolders/Item/ChildFolders/Item/MailFolderRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/ChildFolders/Item/MailFolderRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of child folders in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--mailfolder-id1", description: "key: id of mailFolder")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var mailFolderId1Option = new Option("--mailfolder-id1", description: "key: id of mailFolder"); + mailFolderId1Option.IsRequired = true; + command.AddOption(mailFolderId1Option); command.Handler = CommandHandler.Create(async (mailFolderId, mailFolderId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(mailFolderId1)) requestInfo.PathParameters.Add("mailFolder_id1", mailFolderId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of child folders in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--mailfolder-id1", description: "key: id of mailFolder")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, mailFolderId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(mailFolderId1)) requestInfo.PathParameters.Add("mailFolder_id1", mailFolderId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var mailFolderId1Option = new Option("--mailfolder-id1", description: "key: id of mailFolder"); + mailFolderId1Option.IsRequired = true; + command.AddOption(mailFolderId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, mailFolderId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,16 +99,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of child folders in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--mailfolder-id1", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var mailFolderId1Option = new Option("--mailfolder-id1", description: "key: id of mailFolder"); + mailFolderId1Option.IsRequired = true; + command.AddOption(mailFolderId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, mailFolderId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(mailFolderId1)) requestInfo.PathParameters.Add("mailFolder_id1", mailFolderId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/ChildFolders/Item/Move/MoveRequestBuilder.cs b/src/generated/Me/MailFolders/Item/ChildFolders/Item/Move/MoveRequestBuilder.cs index 1c84b8eeef6..9482f9db57d 100644 --- a/src/generated/Me/MailFolders/Item/ChildFolders/Item/Move/MoveRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/ChildFolders/Item/Move/MoveRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action move"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--mailfolder-id1", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var mailFolderId1Option = new Option("--mailfolder-id1", description: "key: id of mailFolder"); + mailFolderId1Option.IsRequired = true; + command.AddOption(mailFolderId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, mailFolderId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(mailFolderId1)) requestInfo.PathParameters.Add("mailFolder_id1", mailFolderId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Copy/CopyRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Copy/CopyRequestBuilder.cs index a5a5f3eead9..dd8a140fd34 100644 --- a/src/generated/Me/MailFolders/Item/Copy/CopyRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Copy/CopyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copy"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/MailFolderRequestBuilder.cs b/src/generated/Me/MailFolders/Item/MailFolderRequestBuilder.cs index ef8d72083a6..74600647f91 100644 --- a/src/generated/Me/MailFolders/Item/MailFolderRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/MailFolderRequestBuilder.cs @@ -46,10 +46,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's mail folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); command.Handler = CommandHandler.Create(async (mailFolderId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,12 +65,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's mail folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (mailFolderId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - requestInfo.QueryParameters.Add("select", select); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (mailFolderId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -114,14 +121,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's mail folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/MessageRules/Item/MessageRuleRequestBuilder.cs b/src/generated/Me/MailFolders/Item/MessageRules/Item/MessageRuleRequestBuilder.cs index 774d1d791c4..b97d274c8a5 100644 --- a/src/generated/Me/MailFolders/Item/MessageRules/Item/MessageRuleRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/MessageRules/Item/MessageRuleRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of rules that apply to the user's Inbox folder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--messagerule-id", description: "key: id of messageRule")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageRuleIdOption = new Option("--messagerule-id", description: "key: id of messageRule"); + messageRuleIdOption.IsRequired = true; + command.AddOption(messageRuleIdOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageRuleId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageRuleId)) requestInfo.PathParameters.Add("messageRule_id", messageRuleId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +48,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of rules that apply to the user's Inbox folder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--messagerule-id", description: "key: id of messageRule")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (mailFolderId, messageRuleId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageRuleId)) requestInfo.PathParameters.Add("messageRule_id", messageRuleId); - requestInfo.QueryParameters.Add("select", select); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageRuleIdOption = new Option("--messagerule-id", description: "key: id of messageRule"); + messageRuleIdOption.IsRequired = true; + command.AddOption(messageRuleIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (mailFolderId, messageRuleId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,16 +80,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of rules that apply to the user's Inbox folder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--messagerule-id", description: "key: id of messageRule")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageRuleIdOption = new Option("--messagerule-id", description: "key: id of messageRule"); + messageRuleIdOption.IsRequired = true; + command.AddOption(messageRuleIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageRuleId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageRuleId)) requestInfo.PathParameters.Add("messageRule_id", messageRuleId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/MessageRules/MessageRulesRequestBuilder.cs b/src/generated/Me/MailFolders/Item/MessageRules/MessageRulesRequestBuilder.cs index 1f5cf8b1773..3025a81fa8c 100644 --- a/src/generated/Me/MailFolders/Item/MessageRules/MessageRulesRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/MessageRules/MessageRulesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of rules that apply to the user's Inbox folder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +66,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of rules that apply to the user's Inbox folder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (mailFolderId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (mailFolderId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Delta/Delta.cs b/src/generated/Me/MailFolders/Item/Messages/Delta/Delta.cs index 1f157a5160c..76e9aacf707 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Delta/Delta.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Delta/Delta.cs @@ -12,7 +12,7 @@ public class Delta : OutlookItem, IParsable { public List BccRecipients { get; set; } /// The body of the message. It can be in HTML or text format. Find out about safe HTML in a message body. public ItemBody Body { get; set; } - /// The first 255 characters of the message body. It is in text format. + /// The first 255 characters of the message body. It is in text format. If the message contains instances of mention, this property would contain a concatenation of these mentions as well. public string BodyPreview { get; set; } /// The Cc: recipients for the message. public List CcRecipients { get; set; } diff --git a/src/generated/Me/MailFolders/Item/Messages/Delta/DeltaRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Delta/DeltaRequestBuilder.cs index fa9034a2511..71235fe265d 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); command.Handler = CommandHandler.Create(async (mailFolderId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs index 206498a519f..ac063a543c6 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,26 +76,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, messageId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, messageId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 1229d9160d3..fbaf3ca45a5 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs index 2839678e14c..2c6fc2b5bc6 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, messageId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, messageId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs index 60840e9d244..1c4a59def51 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/Copy/CopyRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/Copy/CopyRequestBuilder.cs index 60adeb40a23..1ea3ee66466 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/Copy/CopyRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/Copy/CopyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copy"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs index 0e405566287..2724e14033c 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createForward"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs index 844689e71bc..34c5328e4e2 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createReply"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs index a76d9b980de..fca06fe982f 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createReplyAll"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs index 5a8c94f0e10..c17e75d2768 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +69,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, messageId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, messageId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs index 1a237d917a2..fd039d14dc5 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, messageId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, messageId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/Forward/ForwardRequestBuilder.cs index 20f18657dc5..296813b6b82 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/MessageRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/MessageRequestBuilder.cs index 519a222bbe4..a07aad99a27 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/MessageRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/MessageRequestBuilder.cs @@ -86,12 +86,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of messages in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -118,16 +121,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of messages in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, messageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, messageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -159,16 +171,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of messages in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/Move/MoveRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/Move/MoveRequestBuilder.cs index bea2ba98d4f..4de0c6ea21b 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/Move/MoveRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/Move/MoveRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action move"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index b1eabb3d511..bc8f8db5c99 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, messageId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, messageId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 693cd1046e8..26348bd297e 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, messageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, messageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/Reply/ReplyRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/Reply/ReplyRequestBuilder.cs index 3bae2ed9e82..89e4d7cd597 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/Reply/ReplyRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/Reply/ReplyRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reply"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs index 7a02539ee1d..6bdcfa37e49 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action replyAll"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/Send/SendRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/Send/SendRequestBuilder.cs index 006af239d38..57540c7f70e 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/Send/SendRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/Send/SendRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action send"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 1adc2de54b2..995491bd9e0 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, messageId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, messageId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 92318e5fe6c..34d447f8d51 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, messageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, messageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Messages/Item/Value/ContentRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/Item/Value/ContentRequestBuilder.cs index 877390dde13..79bf7e1b112 100644 --- a/src/generated/Me/MailFolders/Item/Messages/Item/Value/ContentRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/Item/Value/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property messages from me"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property messages in me"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--file", description: "Binary request body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (mailFolderId, messageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/Messages/MessagesRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Messages/MessagesRequestBuilder.cs index 21b8ce6d694..49d28d396ed 100644 --- a/src/generated/Me/MailFolders/Item/Messages/MessagesRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Messages/MessagesRequestBuilder.cs @@ -52,14 +52,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of messages in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,26 +82,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of messages in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/Move/MoveRequestBuilder.cs b/src/generated/Me/MailFolders/Item/Move/MoveRequestBuilder.cs index 04fb38e2967..fa08bf67486 100644 --- a/src/generated/Me/MailFolders/Item/Move/MoveRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/Move/MoveRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action move"; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/MailFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index bbc845865d0..9224102e507 100644 --- a/src/generated/Me/MailFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (mailFolderId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 51fa2fdf54a..9ec052e6846 100644 --- a/src/generated/Me/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/MailFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 051b0a825f9..85dacd3b572 100644 --- a/src/generated/Me/MailFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (mailFolderId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index c9dcd676b46..d42c4f5e1c4 100644 --- a/src/generated/Me/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (mailFolderId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (mailFolderId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MailFolders/MailFoldersRequestBuilder.cs b/src/generated/Me/MailFolders/MailFoldersRequestBuilder.cs index 3b4278deacc..416fac42e42 100644 --- a/src/generated/Me/MailFolders/MailFoldersRequestBuilder.cs +++ b/src/generated/Me/MailFolders/MailFoldersRequestBuilder.cs @@ -44,12 +44,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The user's mail folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,20 +71,35 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The user's mail folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ManagedAppRegistrations/@Ref/RefRequestBuilder.cs b/src/generated/Me/ManagedAppRegistrations/@Ref/RefRequestBuilder.cs index 02bffed623c..8b6c87d7a29 100644 --- a/src/generated/Me/ManagedAppRegistrations/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/ManagedAppRegistrations/@Ref/RefRequestBuilder.cs @@ -25,20 +25,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Zero or more managed app registrations that belong to the user."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,12 +71,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Zero or more managed app registrations that belong to the user."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ManagedAppRegistrations/GetUserIdsWithFlaggedAppRegistration/GetUserIdsWithFlaggedAppRegistrationRequestBuilder.cs b/src/generated/Me/ManagedAppRegistrations/GetUserIdsWithFlaggedAppRegistration/GetUserIdsWithFlaggedAppRegistrationRequestBuilder.cs index 97737467f7e..24c9d27b83e 100644 --- a/src/generated/Me/ManagedAppRegistrations/GetUserIdsWithFlaggedAppRegistration/GetUserIdsWithFlaggedAppRegistrationRequestBuilder.cs +++ b/src/generated/Me/ManagedAppRegistrations/GetUserIdsWithFlaggedAppRegistration/GetUserIdsWithFlaggedAppRegistrationRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function getUserIdsWithFlaggedAppRegistration"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ManagedAppRegistrations/ManagedAppRegistrationsRequestBuilder.cs b/src/generated/Me/ManagedAppRegistrations/ManagedAppRegistrationsRequestBuilder.cs index f8186c0bf5c..3d0010ec7cd 100644 --- a/src/generated/Me/ManagedAppRegistrations/ManagedAppRegistrationsRequestBuilder.cs +++ b/src/generated/Me/ManagedAppRegistrations/ManagedAppRegistrationsRequestBuilder.cs @@ -27,24 +27,44 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Zero or more managed app registrations that belong to the user."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ManagedDevices/Item/BypassActivationLock/BypassActivationLockRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/BypassActivationLock/BypassActivationLockRequestBuilder.cs index e2c6fd16136..f3b6f03a1ae 100644 --- a/src/generated/Me/ManagedDevices/Item/BypassActivationLock/BypassActivationLockRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/BypassActivationLock/BypassActivationLockRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Bypass activation lock"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/CleanWindowsDevice/CleanWindowsDeviceRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/CleanWindowsDevice/CleanWindowsDeviceRequestBuilder.cs index 3d8e56693d3..a61b0f19954 100644 --- a/src/generated/Me/ManagedDevices/Item/CleanWindowsDevice/CleanWindowsDeviceRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/CleanWindowsDevice/CleanWindowsDeviceRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Clean Windows device"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/DeleteUserFromSharedAppleDevice/DeleteUserFromSharedAppleDeviceRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/DeleteUserFromSharedAppleDevice/DeleteUserFromSharedAppleDeviceRequestBuilder.cs index 175a19b9d85..0a4cc611964 100644 --- a/src/generated/Me/ManagedDevices/Item/DeleteUserFromSharedAppleDevice/DeleteUserFromSharedAppleDeviceRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/DeleteUserFromSharedAppleDevice/DeleteUserFromSharedAppleDeviceRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Delete user from shared Apple device"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/DeviceCategory/DeviceCategoryRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/DeviceCategory/DeviceCategoryRequestBuilder.cs index dc0897994d6..113d7f04163 100644 --- a/src/generated/Me/ManagedDevices/Item/DeviceCategory/DeviceCategoryRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/DeviceCategory/DeviceCategoryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device category"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device category"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device category"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/DeviceCompliancePolicyStates/DeviceCompliancePolicyStatesRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/DeviceCompliancePolicyStates/DeviceCompliancePolicyStatesRequestBuilder.cs index cc6106b493b..66ba4689088 100644 --- a/src/generated/Me/ManagedDevices/Item/DeviceCompliancePolicyStates/DeviceCompliancePolicyStatesRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/DeviceCompliancePolicyStates/DeviceCompliancePolicyStatesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ManagedDevices/Item/DeviceCompliancePolicyStates/Item/DeviceCompliancePolicyStateRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/DeviceCompliancePolicyStates/Item/DeviceCompliancePolicyStateRequestBuilder.cs index eee6a6f7cf4..dba88d4406d 100644 --- a/src/generated/Me/ManagedDevices/Item/DeviceCompliancePolicyStates/Item/DeviceCompliancePolicyStateRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/DeviceCompliancePolicyStates/Item/DeviceCompliancePolicyStateRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceCompliancePolicyStateIdOption = new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState"); + deviceCompliancePolicyStateIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyStateIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId, deviceCompliancePolicyStateId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceCompliancePolicyStateId)) requestInfo.PathParameters.Add("deviceCompliancePolicyState_id", deviceCompliancePolicyStateId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceId, deviceCompliancePolicyStateId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceCompliancePolicyStateId)) requestInfo.PathParameters.Add("deviceCompliancePolicyState_id", deviceCompliancePolicyStateId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceCompliancePolicyStateIdOption = new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState"); + deviceCompliancePolicyStateIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyStateIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceId, deviceCompliancePolicyStateId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceCompliancePolicyStateIdOption = new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState"); + deviceCompliancePolicyStateIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyStateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, deviceCompliancePolicyStateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceCompliancePolicyStateId)) requestInfo.PathParameters.Add("deviceCompliancePolicyState_id", deviceCompliancePolicyStateId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/DeviceConfigurationStates/DeviceConfigurationStatesRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/DeviceConfigurationStates/DeviceConfigurationStatesRequestBuilder.cs index 472884aba54..675bea44927 100644 --- a/src/generated/Me/ManagedDevices/Item/DeviceConfigurationStates/DeviceConfigurationStatesRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/DeviceConfigurationStates/DeviceConfigurationStatesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ManagedDevices/Item/DeviceConfigurationStates/Item/DeviceConfigurationStateRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/DeviceConfigurationStates/Item/DeviceConfigurationStateRequestBuilder.cs index cb05eec72bc..f8adea23688 100644 --- a/src/generated/Me/ManagedDevices/Item/DeviceConfigurationStates/Item/DeviceConfigurationStateRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/DeviceConfigurationStates/Item/DeviceConfigurationStateRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceConfigurationStateIdOption = new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState"); + deviceConfigurationStateIdOption.IsRequired = true; + command.AddOption(deviceConfigurationStateIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId, deviceConfigurationStateId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceConfigurationStateId)) requestInfo.PathParameters.Add("deviceConfigurationState_id", deviceConfigurationStateId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceId, deviceConfigurationStateId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceConfigurationStateId)) requestInfo.PathParameters.Add("deviceConfigurationState_id", deviceConfigurationStateId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceConfigurationStateIdOption = new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState"); + deviceConfigurationStateIdOption.IsRequired = true; + command.AddOption(deviceConfigurationStateIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceId, deviceConfigurationStateId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceConfigurationStateIdOption = new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState"); + deviceConfigurationStateIdOption.IsRequired = true; + command.AddOption(deviceConfigurationStateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, deviceConfigurationStateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceConfigurationStateId)) requestInfo.PathParameters.Add("deviceConfigurationState_id", deviceConfigurationStateId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/DisableLostMode/DisableLostModeRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/DisableLostMode/DisableLostModeRequestBuilder.cs index defd86882ad..79802800d04 100644 --- a/src/generated/Me/ManagedDevices/Item/DisableLostMode/DisableLostModeRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/DisableLostMode/DisableLostModeRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Disable lost mode"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/LocateDevice/LocateDeviceRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/LocateDevice/LocateDeviceRequestBuilder.cs index 31b45073d5f..eb0754d8fc4 100644 --- a/src/generated/Me/ManagedDevices/Item/LocateDevice/LocateDeviceRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/LocateDevice/LocateDeviceRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Locate a device"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/LogoutSharedAppleDeviceActiveUser/LogoutSharedAppleDeviceActiveUserRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/LogoutSharedAppleDeviceActiveUser/LogoutSharedAppleDeviceActiveUserRequestBuilder.cs index dd548fc2abf..f0d17829c30 100644 --- a/src/generated/Me/ManagedDevices/Item/LogoutSharedAppleDeviceActiveUser/LogoutSharedAppleDeviceActiveUserRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/LogoutSharedAppleDeviceActiveUser/LogoutSharedAppleDeviceActiveUserRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Logout shared Apple device active user"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/ManagedDeviceRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/ManagedDeviceRequestBuilder.cs index 2f2ee5c7ce9..882104268f0 100644 --- a/src/generated/Me/ManagedDevices/Item/ManagedDeviceRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/ManagedDeviceRequestBuilder.cs @@ -59,10 +59,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The managed devices associated with the user."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -110,14 +112,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The managed devices associated with the user."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (managedDeviceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (managedDeviceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -148,14 +158,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The managed devices associated with the user."; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/RebootNow/RebootNowRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/RebootNow/RebootNowRequestBuilder.cs index 6232ea957e8..f46dd6f36ff 100644 --- a/src/generated/Me/ManagedDevices/Item/RebootNow/RebootNowRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/RebootNow/RebootNowRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Reboot device"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/RecoverPasscode/RecoverPasscodeRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/RecoverPasscode/RecoverPasscodeRequestBuilder.cs index e18c93476f8..9fa0ff3f7cc 100644 --- a/src/generated/Me/ManagedDevices/Item/RecoverPasscode/RecoverPasscodeRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/RecoverPasscode/RecoverPasscodeRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Recover passcode"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/RemoteLock/RemoteLockRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/RemoteLock/RemoteLockRequestBuilder.cs index 8fec6c85539..672ee3d4511 100644 --- a/src/generated/Me/ManagedDevices/Item/RemoteLock/RemoteLockRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/RemoteLock/RemoteLockRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Remote lock"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/RequestRemoteAssistance/RequestRemoteAssistanceRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/RequestRemoteAssistance/RequestRemoteAssistanceRequestBuilder.cs index 83e2a8e2516..665de14473a 100644 --- a/src/generated/Me/ManagedDevices/Item/RequestRemoteAssistance/RequestRemoteAssistanceRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/RequestRemoteAssistance/RequestRemoteAssistanceRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Request remote assistance"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/ResetPasscode/ResetPasscodeRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/ResetPasscode/ResetPasscodeRequestBuilder.cs index 43ab0c68c0e..8483a6d1159 100644 --- a/src/generated/Me/ManagedDevices/Item/ResetPasscode/ResetPasscodeRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/ResetPasscode/ResetPasscodeRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Reset passcode"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/Retire/RetireRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/Retire/RetireRequestBuilder.cs index 97256769d1e..943005b5343 100644 --- a/src/generated/Me/ManagedDevices/Item/Retire/RetireRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/Retire/RetireRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Retire a device"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/ShutDown/ShutDownRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/ShutDown/ShutDownRequestBuilder.cs index 85b6ad8f1c3..cfe57413a97 100644 --- a/src/generated/Me/ManagedDevices/Item/ShutDown/ShutDownRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/ShutDown/ShutDownRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Shut down device"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/SyncDevice/SyncDeviceRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/SyncDevice/SyncDeviceRequestBuilder.cs index 68ea65a0b46..4e7feb0e0f0 100644 --- a/src/generated/Me/ManagedDevices/Item/SyncDevice/SyncDeviceRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/SyncDevice/SyncDeviceRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action syncDevice"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/UpdateWindowsDeviceAccount/UpdateWindowsDeviceAccountRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/UpdateWindowsDeviceAccount/UpdateWindowsDeviceAccountRequestBuilder.cs index b73b0798d7e..4cc32930ec9 100644 --- a/src/generated/Me/ManagedDevices/Item/UpdateWindowsDeviceAccount/UpdateWindowsDeviceAccountRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/UpdateWindowsDeviceAccount/UpdateWindowsDeviceAccountRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action updateWindowsDeviceAccount"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/WindowsDefenderScan/WindowsDefenderScanRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/WindowsDefenderScan/WindowsDefenderScanRequestBuilder.cs index c419fb52452..745499c7f2b 100644 --- a/src/generated/Me/ManagedDevices/Item/WindowsDefenderScan/WindowsDefenderScanRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/WindowsDefenderScan/WindowsDefenderScanRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action windowsDefenderScan"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/WindowsDefenderUpdateSignatures/WindowsDefenderUpdateSignaturesRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/WindowsDefenderUpdateSignatures/WindowsDefenderUpdateSignaturesRequestBuilder.cs index 1dc9ea873c5..6f636780fa1 100644 --- a/src/generated/Me/ManagedDevices/Item/WindowsDefenderUpdateSignatures/WindowsDefenderUpdateSignaturesRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/WindowsDefenderUpdateSignatures/WindowsDefenderUpdateSignaturesRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action windowsDefenderUpdateSignatures"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/Item/Wipe/WipeRequestBuilder.cs b/src/generated/Me/ManagedDevices/Item/Wipe/WipeRequestBuilder.cs index 03ee546a15b..6119ff53427 100644 --- a/src/generated/Me/ManagedDevices/Item/Wipe/WipeRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/Item/Wipe/WipeRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Wipe a device"; // Create options for all the parameters - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ManagedDevices/ManagedDevicesRequestBuilder.cs b/src/generated/Me/ManagedDevices/ManagedDevicesRequestBuilder.cs index d58def8b275..7a2f083e5d5 100644 --- a/src/generated/Me/ManagedDevices/ManagedDevicesRequestBuilder.cs +++ b/src/generated/Me/ManagedDevices/ManagedDevicesRequestBuilder.cs @@ -57,12 +57,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The managed devices associated with the user."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,24 +84,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The managed devices associated with the user."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Manager/@Ref/RefRequestBuilder.cs b/src/generated/Me/Manager/@Ref/RefRequestBuilder.cs index 55d2f527da2..09ebcf6ea35 100644 --- a/src/generated/Me/Manager/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/Manager/@Ref/RefRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildDeleteCommand() { command.Description = "The user or contact that is this user's manager. Read-only. (HTTP Methods: GET, PUT, DELETE.). Supports $expand."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,7 +42,8 @@ public Command BuildGetCommand() { command.Description = "The user or contact that is this user's manager. Read-only. (HTTP Methods: GET, PUT, DELETE.). Supports $expand."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,12 +62,15 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The user or contact that is this user's manager. Read-only. (HTTP Methods: GET, PUT, DELETE.). Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Manager/ManagerRequestBuilder.cs b/src/generated/Me/Manager/ManagerRequestBuilder.cs index d7888a26bb7..a030cfda238 100644 --- a/src/generated/Me/Manager/ManagerRequestBuilder.cs +++ b/src/generated/Me/Manager/ManagerRequestBuilder.cs @@ -27,12 +27,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user or contact that is this user's manager. Read-only. (HTTP Methods: GET, PUT, DELETE.). Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/MeRequestBuilder.cs b/src/generated/Me/MeRequestBuilder.cs index 10cbe481398..7b9a2ad166e 100644 --- a/src/generated/Me/MeRequestBuilder.cs +++ b/src/generated/Me/MeRequestBuilder.cs @@ -273,12 +273,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get me"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -443,12 +450,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update me"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/MemberOf/@Ref/RefRequestBuilder.cs b/src/generated/Me/MemberOf/@Ref/RefRequestBuilder.cs index 217920e5eb7..c0ced6ddb7a 100644 --- a/src/generated/Me/MemberOf/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/MemberOf/@Ref/RefRequestBuilder.cs @@ -19,26 +19,40 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand."; + command.Description = "The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -51,18 +65,21 @@ public Command BuildGetCommand() { return command; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// public Command BuildPostCommand() { var command = new Command("post"); - command.Description = "The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand."; + command.Description = "The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,7 +105,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -109,7 +126,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// /// Request headers /// Request options @@ -127,7 +144,7 @@ public RequestInformation CreatePostRequestInformation(ApiSdk.Me.MemberOf.@Ref.@ return requestInfo; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -139,7 +156,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -151,7 +168,7 @@ public async Task GetAsync(Action q = default, var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Me/MemberOf/MemberOfRequestBuilder.cs b/src/generated/Me/MemberOf/MemberOfRequestBuilder.cs index f5a5639d998..13414696e91 100644 --- a/src/generated/Me/MemberOf/MemberOfRequestBuilder.cs +++ b/src/generated/Me/MemberOf/MemberOfRequestBuilder.cs @@ -20,30 +20,50 @@ public class MemberOfRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand."; + command.Description = "The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,7 +96,7 @@ public MemberOfRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -97,7 +117,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -108,7 +128,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Me/Messages/Delta/Delta.cs b/src/generated/Me/Messages/Delta/Delta.cs index 5424106cdb8..c770129fead 100644 --- a/src/generated/Me/Messages/Delta/Delta.cs +++ b/src/generated/Me/Messages/Delta/Delta.cs @@ -12,7 +12,7 @@ public class Delta : OutlookItem, IParsable { public List BccRecipients { get; set; } /// The body of the message. It can be in HTML or text format. Find out about safe HTML in a message body. public ItemBody Body { get; set; } - /// The first 255 characters of the message body. It is in text format. + /// The first 255 characters of the message body. It is in text format. If the message contains instances of mention, this property would contain a concatenation of these mentions as well. public string BodyPreview { get; set; } /// The Cc: recipients for the message. public List CcRecipients { get; set; } diff --git a/src/generated/Me/Messages/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Messages/Delta/DeltaRequestBuilder.cs index c4bf594fa2b..da149278e24 100644 --- a/src/generated/Me/Messages/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Messages/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Messages/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Me/Messages/Item/Attachments/AttachmentsRequestBuilder.cs index 8f74a0853b6..1f7129ee43d 100644 --- a/src/generated/Me/Messages/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,24 +73,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (messageId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (messageId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Me/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 22d1543dd90..483fc65d3b6 100644 --- a/src/generated/Me/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Me/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs index 310f9f21921..71a740b22dc 100644 --- a/src/generated/Me/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (messageId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (messageId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (messageId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs b/src/generated/Me/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs index 46ffa3e563b..990af6a1ddc 100644 --- a/src/generated/Me/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.Handler = CommandHandler.Create(async (messageId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Messages/Item/Copy/CopyRequestBuilder.cs b/src/generated/Me/Messages/Item/Copy/CopyRequestBuilder.cs index 91424fb202a..9376fc02177 100644 --- a/src/generated/Me/Messages/Item/Copy/CopyRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/Copy/CopyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copy"; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs b/src/generated/Me/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs index 9325b343e0f..5ff6d20f7ef 100644 --- a/src/generated/Me/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createForward"; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs b/src/generated/Me/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs index b1c64b12887..a49a3292215 100644 --- a/src/generated/Me/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createReply"; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs b/src/generated/Me/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs index 4e01b66e5b7..0872091cd75 100644 --- a/src/generated/Me/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createReplyAll"; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Messages/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/Messages/Item/Extensions/ExtensionsRequestBuilder.cs index a3cfd9d0377..67e82461875 100644 --- a/src/generated/Me/Messages/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +66,43 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (messageId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (messageId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs index 2ed8696ce33..c1c2ea24fdb 100644 --- a/src/generated/Me/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (messageId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (messageId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (messageId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Messages/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Me/Messages/Item/Forward/ForwardRequestBuilder.cs index 7ade45fcae4..67882a5af22 100644 --- a/src/generated/Me/Messages/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/Forward/ForwardRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Messages/Item/MessageRequestBuilder.cs b/src/generated/Me/Messages/Item/MessageRequestBuilder.cs index a042db73bd7..9c85becd29e 100644 --- a/src/generated/Me/Messages/Item/MessageRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/MessageRequestBuilder.cs @@ -86,10 +86,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The messages in a mailbox or folder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.Handler = CommandHandler.Create(async (messageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -116,12 +118,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The messages in a mailbox or folder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (messageId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("select", select); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (messageId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -153,14 +160,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The messages in a mailbox or folder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Messages/Item/Move/MoveRequestBuilder.cs b/src/generated/Me/Messages/Item/Move/MoveRequestBuilder.cs index 0aa540be06b..d43350dac59 100644 --- a/src/generated/Me/Messages/Item/Move/MoveRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/Move/MoveRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action move"; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 819805668f9..8523f435cf0 100644 --- a/src/generated/Me/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (messageId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (messageId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (messageId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 6ac289579e1..8a6182ac756 100644 --- a/src/generated/Me/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (messageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (messageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Messages/Item/Reply/ReplyRequestBuilder.cs b/src/generated/Me/Messages/Item/Reply/ReplyRequestBuilder.cs index fb402dcc3c4..0a14610117f 100644 --- a/src/generated/Me/Messages/Item/Reply/ReplyRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/Reply/ReplyRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reply"; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs b/src/generated/Me/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs index ae77d212321..6e2930ad6f9 100644 --- a/src/generated/Me/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action replyAll"; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Messages/Item/Send/SendRequestBuilder.cs b/src/generated/Me/Messages/Item/Send/SendRequestBuilder.cs index eb4907b9c12..6c41c0f3217 100644 --- a/src/generated/Me/Messages/Item/Send/SendRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/Send/SendRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action send"; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.Handler = CommandHandler.Create(async (messageId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Me/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 10d1de8a15a..9702b9e6880 100644 --- a/src/generated/Me/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (messageId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (messageId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (messageId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Me/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 535b9678d63..e459d983f95 100644 --- a/src/generated/Me/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (messageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (messageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Messages/Item/Value/ContentRequestBuilder.cs b/src/generated/Me/Messages/Item/Value/ContentRequestBuilder.cs index ebdc216aa8b..99785b2a27f 100644 --- a/src/generated/Me/Messages/Item/Value/ContentRequestBuilder.cs +++ b/src/generated/Me/Messages/Item/Value/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property messages from me"; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (messageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property messages in me"; // Create options for all the parameters - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--file", description: "Binary request body")); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (messageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Messages/MessagesRequestBuilder.cs b/src/generated/Me/Messages/MessagesRequestBuilder.cs index 13dee6230cd..aeb916deca9 100644 --- a/src/generated/Me/Messages/MessagesRequestBuilder.cs +++ b/src/generated/Me/Messages/MessagesRequestBuilder.cs @@ -52,12 +52,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The messages in a mailbox or folder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,22 +79,39 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The messages in a mailbox or folder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Oauth2PermissionGrants/@Ref/RefRequestBuilder.cs b/src/generated/Me/Oauth2PermissionGrants/@Ref/RefRequestBuilder.cs index 481d1f08bfb..e989c664262 100644 --- a/src/generated/Me/Oauth2PermissionGrants/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/Oauth2PermissionGrants/@Ref/RefRequestBuilder.cs @@ -25,20 +25,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of oauth2PermissionGrants from me"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,12 +71,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Create new navigation property ref to oauth2PermissionGrants for me"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs b/src/generated/Me/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs index bad02fd1480..030c11cbb84 100644 --- a/src/generated/Me/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs +++ b/src/generated/Me/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs @@ -26,24 +26,44 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get oauth2PermissionGrants from me"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs index e77ad5df25c..7dd0a276a22 100644 --- a/src/generated/Me/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getNotebookFromWebUrl"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs index fcb81062359..a00e7138e61 100644 --- a/src/generated/Me/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getRecentNotebooks"; // Create options for all the parameters - command.AddOption(new Option("--includepersonalnotebooks", description: "Usage: includePersonalNotebooks={includePersonalNotebooks}")); + var includePersonalNotebooksOption = new Option("--includepersonalnotebooks", description: "Usage: includePersonalNotebooks={includePersonalNotebooks}"); + includePersonalNotebooksOption.IsRequired = true; + command.AddOption(includePersonalNotebooksOption); command.Handler = CommandHandler.Create(async (includePersonalNotebooks) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.PathParameters.Add("includePersonalNotebooks", includePersonalNotebooks); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs index 66137741e09..7d9a680a2f3 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/NotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/NotebookRequestBuilder.cs index 8913f6eda1c..83618980215 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/NotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/NotebookRequestBuilder.cs @@ -35,10 +35,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); command.Handler = CommandHandler.Create(async (notebookId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,14 +54,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,14 +88,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 2949764f961..24e009a327e 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 34d32f9c760..53fca1f88d6 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,12 +33,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,16 +55,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,16 +92,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 242bf1f14e3..674e767656b 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index d8c46d363f5..1a8adcbef36 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,12 +30,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,16 +52,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -94,16 +106,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 4bd84d0c49e..5537a75b226 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index e393c90a215..445a423ff01 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 30da3b55063..9505fec7669 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index b1aeecd8c24..8f4fcd76c67 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index b61021a14cf..0699f2392c5 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -118,18 +132,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 585cefebeae..d06e9003697 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,17 +25,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from me"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -58,18 +63,25 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in me"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 6a4363bd7e8..c08a042e48f 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 37615b10b5b..f1779e2ff25 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,16 +45,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -68,20 +73,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -125,20 +141,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index b1bbc88bd36..3dd2f622943 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 353e37720ab..824701aa115 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 9e0c122512a..762e901bf77 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 911641a3392..af672dd65ba 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 9e215703c9d..05ffa62415d 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index 01130f77251..109797e73c0 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 8ed40a7e6cb..1259abd1a80 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs index 0dfbd5fbef6..152c7d8fd9e 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 1444e983b53..aa538e7f041 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 34fa47b830d..92cf5f65a3f 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 3591d719f45..4c91007ce05 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index e9ef90b904e..97679283522 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 074ad14f2bf..43020b680f0 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +70,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 0b585224952..e78be7d7d45 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 33500853ae7..42e6fbc37b6 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 2a64887e78a..6676d81f145 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,16 +65,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -118,16 +130,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 5405e38898e..598adae9a4f 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from me"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in me"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 4a105e4a534..cb9afa1360f 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 8ba96c65c7a..f1aa54c66bc 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,14 +45,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,18 +70,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -121,18 +135,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 24d29c3bec1..587c4e0bcf3 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 0d660db5cf4..e3372bbc703 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index d8e587eedc1..5f754b7c631 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 0c4983b9122..cb82558fb51 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 2e12582b6d2..fc4787a707f 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index f0ea5787c1e..e3f915e512a 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 1ac7ebc3c89..3cfbfaf442d 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs index 9cbec953a9b..7e0dcf466ed 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index e238f5b8f58..a254db307fe 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 667974f474b..92669777666 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,12 +33,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,16 +55,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,16 +92,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 0563290fd61..4ea58b5d7b8 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index 1b6e861d6f4..29542d5e523 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,12 +33,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,16 +55,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,16 +92,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 0c58752373e..470e8a883a1 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index b08cede44e6..d98102b1fe8 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,12 +29,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +51,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,16 +109,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index 27be73cd2ce..580fc94f683 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index 06548f0d59d..de521517b2f 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 2d5a3c9c477..9fc1e4d39e5 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 6cd20b80c87..9bf3fa942c3 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index d02becfc336..baf1f0dcd46 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index 63093a541b6..25dbaaf50c5 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs index 0faf4cc817e..42bfb840760 100644 --- a/src/generated/Me/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,26 +71,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (notebookId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (notebookId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Notebooks/NotebooksRequestBuilder.cs b/src/generated/Me/Onenote/Notebooks/NotebooksRequestBuilder.cs index 37b4d6a843a..b29cf311591 100644 --- a/src/generated/Me/Onenote/Notebooks/NotebooksRequestBuilder.cs +++ b/src/generated/Me/Onenote/Notebooks/NotebooksRequestBuilder.cs @@ -41,12 +41,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,24 +74,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/OnenoteRequestBuilder.cs b/src/generated/Me/Onenote/OnenoteRequestBuilder.cs index f02906b7b9b..999167b2ad2 100644 --- a/src/generated/Me/Onenote/OnenoteRequestBuilder.cs +++ b/src/generated/Me/Onenote/OnenoteRequestBuilder.cs @@ -33,7 +33,8 @@ public Command BuildDeleteCommand() { command.Description = "Read-only."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,12 +48,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -93,12 +101,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs b/src/generated/Me/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs index 64fbd302f77..7b3e86ecbe0 100644 --- a/src/generated/Me/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs +++ b/src/generated/Me/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenoteoperation-id", description: "key: id of onenoteOperation")); + var onenoteOperationIdOption = new Option("--onenoteoperation-id", description: "key: id of onenoteOperation"); + onenoteOperationIdOption.IsRequired = true; + command.AddOption(onenoteOperationIdOption); command.Handler = CommandHandler.Create(async (onenoteOperationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteOperationId)) requestInfo.PathParameters.Add("onenoteOperation_id", onenoteOperationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenoteoperation-id", description: "key: id of onenoteOperation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteOperationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteOperationId)) requestInfo.PathParameters.Add("onenoteOperation_id", onenoteOperationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteOperationIdOption = new Option("--onenoteoperation-id", description: "key: id of onenoteOperation"); + onenoteOperationIdOption.IsRequired = true; + command.AddOption(onenoteOperationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteOperationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenoteoperation-id", description: "key: id of onenoteOperation")); - command.AddOption(new Option("--body")); + var onenoteOperationIdOption = new Option("--onenoteoperation-id", description: "key: id of onenoteOperation"); + onenoteOperationIdOption.IsRequired = true; + command.AddOption(onenoteOperationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteOperationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteOperationId)) requestInfo.PathParameters.Add("onenoteOperation_id", onenoteOperationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Operations/OperationsRequestBuilder.cs b/src/generated/Me/Onenote/Operations/OperationsRequestBuilder.cs index 61e614d3af9..126764e95ed 100644 --- a/src/generated/Me/Onenote/Operations/OperationsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Operations/OperationsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/Content/ContentRequestBuilder.cs index ca384133e4e..0f81e1f2e82 100644 --- a/src/generated/Me/Onenote/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from me"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in me"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 1cff3469acf..ea87a453a1b 100644 --- a/src/generated/Me/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/OnenotePageRequestBuilder.cs index 662a3966447..ff3d7365ee3 100644 --- a/src/generated/Me/Onenote/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,10 +45,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,14 +64,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -118,14 +128,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index ae2821f7bf3..7f3c2f3a0f5 100644 --- a/src/generated/Me/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index c8f34102a84..16983db7666 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index c8ea96f2264..2508787f5f3 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,10 +35,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,14 +54,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,14 +88,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index e0d8c13a9e1..e86b4f7f817 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 2d6332e7158..b519b981848 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,12 +33,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,16 +55,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,16 +92,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index a314330f27f..4748bb08222 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index e5354fdd9e0..7529d3e8a8e 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,12 +30,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,16 +52,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -94,16 +106,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 02f17e02953..475919b2a76 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index d1629e3e32e..0d8b51d87eb 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 2475c656454..c3b839c18ba 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index f2daeeed21d..af7e16c014e 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index a4808c4eee8..3116e5203c1 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -118,18 +132,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index dd2f7bd86d7..2d12fee46c7 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,17 +25,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from me"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -58,18 +63,25 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in me"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 17b842ce465..2bb3e28ff67 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 80f110a3c1c..57575b6838f 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -43,16 +43,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,20 +71,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -104,20 +120,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 9e8ec16d510..b700c866814 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 4b98575b970..9ef4d1e3b73 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs index 9af66bf64b3..afb6c3afcfb 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -39,18 +39,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,30 +75,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index d200fa14cb5..34116c9089f 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 8bcb54ed015..65b6ade7b0a 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 2e697f04d44..c5ba729e56f 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index 7b22c5a33d4..ec6e5b9ce4a 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index a48065cf8c1..c72d3df5a62 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +70,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index cb7a661f80a..c13bad261c7 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index dd71ccee116..8cb07aa2470 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index b1d70bea3d8..bc993e2d7e4 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,16 +65,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -118,16 +130,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 5af16744fab..a0c0b2c7a40 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from me"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenotePageId1, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in me"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenotePageId1, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 45d93383687..ca2fc409620 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 934979ffef7..9594f80ed94 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenotePageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenotePageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -100,18 +114,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 745243cf4b3..a8cb866c76a 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index fe45fad0658..a0897eec1ed 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs index 523eecc8c51..4122c4a06aa 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs @@ -39,16 +39,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,28 +72,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 8c27f870afb..ab92e2f485c 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index fa29b6bc946..0ceae809bdb 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,12 +33,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,16 +55,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,16 +92,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index ca8cfde8001..62ce67d8233 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index ae8f80d6980..05ca3b0a1a4 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,12 +33,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,16 +55,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,16 +92,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index fb2a0647246..809eb0c9ba5 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 3abfb0e2936..e2613f24f17 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,12 +29,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +51,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,16 +109,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index 07285ffa40d..967e89d4790 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index 0dce4cde4b5..66ed5e4142d 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 4224600050f..e64f1abb31f 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index fa6ba495e53..9fd4b3fa4ea 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index 98ec014d5c2..046a2e897cd 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index a4b54b161f8..ff8b61eaa33 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index edd4e6a8dea..49a926a8dec 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,26 +71,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 7d4f290d8f9..da191c6708f 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 2635ad3ae24..52264e4fa1b 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs index 1c225fb16bb..e616b48e4a9 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from me"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (onenotePageId, onenotePageId1, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in me"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenotePageId1, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index d84e35c2c92..826f3b23c4a 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs index f3e1e20b674..fa10cc76927 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (onenotePageId, onenotePageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,16 +65,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenotePageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenotePageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,16 +108,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 31a21fc30fa..cc49d16d378 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs index 1b6c534ae64..53e352a3e43 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (onenotePageId, onenotePageId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs index 445ad7ade5b..13765206c70 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs @@ -39,14 +39,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,26 +69,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index c6d5333dab2..a11f677ac6c 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs index 89f2a11a12a..a33621300d6 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,10 +35,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,14 +54,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,14 +88,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 53473dd0d05..06c44627408 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index bcf4db6c55e..8d7c4e9b6f8 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,12 +33,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,16 +55,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,16 +92,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 83664df79a3..07b6f51d334 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index a57c84a512d..aa3a658bbbe 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,12 +30,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,16 +52,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -94,16 +106,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index d9d8182e779..133417785ec 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index e75c0d0ab95..779f57e55bb 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index c5dce5e302e..a759072560c 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index ba4ad7564ff..f1c4082a22e 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 97b425e1d6e..2c9177cf50c 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index 7c7b3202b0d..19b19ea2cad 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 3219ef079da..7b8975d2ef1 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +70,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 93255d9d9b6..aabae229273 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 5048c3410a4..03a3163b165 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 6f6a37d5f52..3298c95a937 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,16 +62,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,16 +99,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs index 7c8e0d2e72e..fff7b487593 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +68,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index b760a4e0104..c1a64f3ef77 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index ba06288c399..986b810582e 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,10 +35,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,14 +54,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,14 +88,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 7ebe80551b2..b3592b8c3d5 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 6de9237cd1f..cc396b92a47 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 99c7bd6fb20..da371b56668 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 9b814beeccf..f92266d8755 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 7ec67d2e588..2886b7b8f98 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,16 +62,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,16 +99,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs index d89d2004cae..d89e935074e 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +68,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index a6dfdf452d4..a61615e4a5b 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index ee659ae6bf2..40060ab9c9c 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,10 +29,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,14 +48,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,14 +105,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index 1886a923ea7..97c2ddd3f1b 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index 41f4cde21f5..26ecda32ca1 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 5a6fc623fbb..7b96a1c55f4 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index bd5fd3d06de..e30b02546d3 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index 1b5f24da7c0..601c18c0d65 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,16 +62,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,16 +99,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index c9e41b910b1..226e818cb09 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +68,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index c3ca82e3ef4..34976451344 100644 --- a/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -43,10 +43,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -60,14 +62,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -116,14 +126,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Me/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs index 000d5147c00..e47ba8178bb 100644 --- a/src/generated/Me/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Pages/PagesRequestBuilder.cs b/src/generated/Me/Onenote/Pages/PagesRequestBuilder.cs index 006526bed61..acd476a6333 100644 --- a/src/generated/Me/Onenote/Pages/PagesRequestBuilder.cs +++ b/src/generated/Me/Onenote/Pages/PagesRequestBuilder.cs @@ -41,12 +41,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,24 +68,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Resources/Item/Content/ContentRequestBuilder.cs b/src/generated/Me/Onenote/Resources/Item/Content/ContentRequestBuilder.cs index 694e953b411..f84586095cc 100644 --- a/src/generated/Me/Onenote/Resources/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Resources/Item/Content/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property resources from me"; // Create options for all the parameters - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (onenoteResourceId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property resources in me"; // Create options for all the parameters - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); - command.AddOption(new Option("--file", description: "Binary request body")); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (onenoteResourceId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs b/src/generated/Me/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs index 51f5d1aa091..6b83e807df2 100644 --- a/src/generated/Me/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs +++ b/src/generated/Me/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); command.Handler = CommandHandler.Create(async (onenoteResourceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteResourceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); - command.AddOption(new Option("--body")); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteResourceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Resources/ResourcesRequestBuilder.cs b/src/generated/Me/Onenote/Resources/ResourcesRequestBuilder.cs index 15838342b28..948b4fde01a 100644 --- a/src/generated/Me/Onenote/Resources/ResourcesRequestBuilder.cs +++ b/src/generated/Me/Onenote/Resources/ResourcesRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 52c48de2e5d..a5ad4008584 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 34428eb228f..0e3e1e41461 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,10 +35,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,14 +54,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,14 +88,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index bf7198aa95d..3d515c72357 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index a5cb8281eb6..2b3d4e4a33f 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 652d7373ad2..fdd6c1e09c1 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 17bee8b347e..f8d9b6a90f9 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 02d3bc23e68..074a412559a 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,16 +65,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -114,16 +126,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 58ce9a15d57..d26fa0179bc 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from me"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in me"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 361bd498004..017d23bf51d 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 347644e72a6..381431c1e57 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,14 +45,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,18 +70,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -121,18 +135,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 2c0230ea609..383de8465b5 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 157dee1f1c7..790df7e8e07 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index c25be341169..8631239c9a1 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 53f7ef92a95..bf255249520 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 9cd79064520..0ef740a1bbb 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index cce79bc4203..107424a3b84 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 1af1794681e..aff682e93e7 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs index 5546fe97809..c2c15783051 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 39f0abdf60b..650cdb45731 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 33c47d59fc9..edd43452cfd 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,12 +33,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,16 +55,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,16 +92,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index a56a7bbbedd..ab4ef3036ea 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 6115992517e..a665898f9a7 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,26 +71,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index ed1ee77c593..228001759fd 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs index 244746e88e8..20bbc931218 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,10 +30,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,14 +49,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,14 +102,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 19b6d60da8a..62da3b3d7e7 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index b0969aeb52d..92016e6d18c 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 1cf94b09cc5..0f83c501ce9 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 2ac8fb77f7b..277e2ca711f 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 3e873cd6838..03a1c608615 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,16 +65,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -116,16 +128,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 1f3d3de6b64..4c240c0b86d 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from me"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in me"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 561a9b396ea..ef6961b0c9e 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 88b6a7340fa..974c1c28b5a 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,14 +45,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,18 +70,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -123,18 +137,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index f098f837421..aac23b35cb7 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 45f5f993f33..87e7dbbb90a 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 173941cc22a..39733a4fa8d 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,14 +35,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index f6d37654fb8..6fea8424b0e 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 4d048f8318c..28e1181ba9d 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index fabad20cfc8..1a810cfa4f8 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index a7e7a99bdbc..108cd1522dd 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index d4c204411c7..30eca38453b 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 1b37822125c..c0ab73cdaea 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 334e1d6a38f..1bf8f4e9214 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 56b93a35fa3..49dc170fb68 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index 6db89dc0007..9bf101ebc68 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index a22543cd48a..af9d39bf4df 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs index a0d14c378fe..cd029be681d 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 4c8d72f04bd..3542c9859c9 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index a1aaff51a8e..1a430e91ee9 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index d66f9bdc9ea..8c380a31c7d 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index b9f758ee105..8a1b290dd23 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 5e46e79e40c..0826964562a 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 5909c033c48..8394bfe33e8 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 2fe77e8bd68..a867d6b2a8a 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 6d1e09ed2ec..7dde8439ddf 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 9cdfd3e88d6..97c3a121546 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index 987d7e1eec1..8f6dfe27ead 100644 --- a/src/generated/Me/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,26 +71,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs index 4c99e1322da..5e335cdee38 100644 --- a/src/generated/Me/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +67,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index d41e8b3ae0d..d1d4a0cd5f7 100644 --- a/src/generated/Me/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 1ac75fb90f7..626333e86d8 100644 --- a/src/generated/Me/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs index 3871b556dab..21703d1b81b 100644 --- a/src/generated/Me/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,10 +43,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -60,14 +62,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -116,14 +126,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 7996d32402c..1730197585a 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from me"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in me"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 3cf716096be..b2ff2b2acea 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index f53ca38ec9e..9c418a3d720 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,12 +45,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,16 +67,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -119,16 +131,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 1897109aa7d..231e588c4a7 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 33f2c590b66..154801f2be8 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 72fb1afc157..9e08074e073 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 64c0f52c822..37948f0ee07 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index ce31cf573b9..d4d4ccbe257 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 01eed11593e..0404ffa6f18 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 1de2f2e9367..833a5d3138f 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,18 +55,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,18 +112,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 8275641cffd..2be5a52bc6c 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index b505511a12a..6dd6e1ac9a1 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 33a92adefb3..05e4eb3953a 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 609d5abc714..a7a29fb0169 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 6d567ef6772..bbc0df276a6 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index 016ae45d9e2..0b235b1fb5e 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 563033a87a4..78833652cb0 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 3e5f7510326..835ef0252f1 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 3537c6ea73e..a803eb4ac38 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index cdf7ab209ea..79275a70d04 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 407d633fd9f..40052c582cb 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index cb6d8efadec..7d4778cc257 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index ed6073eacf1..52108d01ca4 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index eb13db41c61..7d482893913 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,16 +62,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,16 +99,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 7fa214f0348..94a4ce87b78 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs index 5af4be87d2a..752f7919806 100644 --- a/src/generated/Me/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,26 +71,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index d1d399826e6..bbf0e03353c 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index d0767d95e77..b41b23d3ba5 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,10 +35,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,14 +54,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,14 +88,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 42f7adfc927..23c39072eba 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 4d33c2acfc6..ebc6eac850f 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,12 +33,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,16 +55,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,16 +92,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index aa1241d87c0..7cdb0ebd1af 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 03eeab9dc5b..518060dc87a 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,12 +30,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,16 +52,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -94,16 +106,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 12fcc45e942..d8178279fc8 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 5e84d31b18c..2537433a895 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 2a97371720b..d3c742203bc 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 82b067a8251..d74775ce059 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 97cd54089b1..c27a85cb283 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index e5838b1b272..5c3264a1daf 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 30873fbc62c..3e3a73a95a0 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +70,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index fb51a4d91e3..ef79c3499ad 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 873a6b9ee19..da8c57a4aee 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index b5842c11631..c66fb900552 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,16 +62,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,16 +99,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index c093b1617a8..177e18ebd48 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +68,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index d8d433f5ff0..5a145c6fc56 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index d218b2b76c6..c2091893929 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,10 +35,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,14 +54,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,14 +88,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 576d11079a6..00afb729420 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 7f003b2d6ad..2404b6de1e1 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 544d2ca8f4e..6a17e8380ff 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 0686cf1546c..fed7abc640f 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 0609dcfee24..120022b9a0b 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,16 +62,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,16 +99,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs index 2a1af723c8b..10a24685cc6 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +68,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index fc210f5e7fe..6fbbf960f9e 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 5999100321c..09732bab38a 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,10 +29,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,14 +48,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,14 +105,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index 252d58a7c3e..0d1967a8486 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index 414cfa90f72..ec54bef218c 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 9f2612df877..2c13da97750 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 9fc23f11e6f..7e8ac0d16fc 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index 54a52c89ef0..19cef09579f 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,16 +62,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,16 +99,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index d15370c4078..88174850d87 100644 --- a/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +68,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Onenote/Sections/SectionsRequestBuilder.cs b/src/generated/Me/Onenote/Sections/SectionsRequestBuilder.cs index f78a4a0c91a..40c146bc56b 100644 --- a/src/generated/Me/Onenote/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Me/Onenote/Sections/SectionsRequestBuilder.cs @@ -41,12 +41,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,24 +68,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/OnlineMeetings/CreateOrGet/CreateOrGetRequestBuilder.cs b/src/generated/Me/OnlineMeetings/CreateOrGet/CreateOrGetRequestBuilder.cs index ffa19e6243a..b8e52329eaf 100644 --- a/src/generated/Me/OnlineMeetings/CreateOrGet/CreateOrGetRequestBuilder.cs +++ b/src/generated/Me/OnlineMeetings/CreateOrGet/CreateOrGetRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createOrGet"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/OnlineMeetings/Item/AttendanceReports/AttendanceReportsRequestBuilder.cs b/src/generated/Me/OnlineMeetings/Item/AttendanceReports/AttendanceReportsRequestBuilder.cs new file mode 100644 index 00000000000..4f25b1eb15f --- /dev/null +++ b/src/generated/Me/OnlineMeetings/Item/AttendanceReports/AttendanceReportsRequestBuilder.cs @@ -0,0 +1,219 @@ +using ApiSdk.Me.OnlineMeetings.Item.AttendanceReports.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Me.OnlineMeetings.Item.AttendanceReports { + /// Builds and executes requests for operations under \me\onlineMeetings\{onlineMeeting-id}\attendanceReports + public class AttendanceReportsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new MeetingAttendanceReportRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildAttendanceRecordsCommand(), + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new AttendanceReportsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AttendanceReportsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/me/onlineMeetings/{onlineMeeting_id}/attendanceReports{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(MeetingAttendanceReport body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(MeetingAttendanceReport model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// The attendance reports of an online meeting. Read-only. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Me/OnlineMeetings/Item/AttendanceReports/AttendanceReportsResponse.cs b/src/generated/Me/OnlineMeetings/Item/AttendanceReports/AttendanceReportsResponse.cs new file mode 100644 index 00000000000..790272642fc --- /dev/null +++ b/src/generated/Me/OnlineMeetings/Item/AttendanceReports/AttendanceReportsResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Me.OnlineMeetings.Item.AttendanceReports { + public class AttendanceReportsResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new attendanceReportsResponse and sets the default values. + /// + public AttendanceReportsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as AttendanceReportsResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as AttendanceReportsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Me/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsRequestBuilder.cs b/src/generated/Me/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsRequestBuilder.cs new file mode 100644 index 00000000000..540dfccf103 --- /dev/null +++ b/src/generated/Me/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsRequestBuilder.cs @@ -0,0 +1,224 @@ +using ApiSdk.Me.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords.Item; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Me.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords { + /// Builds and executes requests for operations under \me\onlineMeetings\{onlineMeeting-id}\attendanceReports\{meetingAttendanceReport-id}\attendanceRecords + public class AttendanceRecordsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new AttendanceRecordRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new AttendanceRecordsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AttendanceRecordsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/me/onlineMeetings/{onlineMeeting_id}/attendanceReports/{meetingAttendanceReport_id}/attendanceRecords{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(AttendanceRecord body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(AttendanceRecord model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// List of attendance records of an attendance report. Read-only. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Me/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsResponse.cs b/src/generated/Me/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsResponse.cs new file mode 100644 index 00000000000..b42755a4d49 --- /dev/null +++ b/src/generated/Me/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Me.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords { + public class AttendanceRecordsResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new attendanceRecordsResponse and sets the default values. + /// + public AttendanceRecordsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as AttendanceRecordsResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as AttendanceRecordsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Me/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/Item/AttendanceRecordRequestBuilder.cs b/src/generated/Me/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/Item/AttendanceRecordRequestBuilder.cs new file mode 100644 index 00000000000..13e6a9bb070 --- /dev/null +++ b/src/generated/Me/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/Item/AttendanceRecordRequestBuilder.cs @@ -0,0 +1,229 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Me.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords.Item { + /// Builds and executes requests for operations under \me\onlineMeetings\{onlineMeeting-id}\attendanceReports\{meetingAttendanceReport-id}\attendanceRecords\{attendanceRecord-id} + public class AttendanceRecordRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var attendanceRecordIdOption = new Option("--attendancerecord-id", description: "key: id of attendanceRecord"); + attendanceRecordIdOption.IsRequired = true; + command.AddOption(attendanceRecordIdOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId, attendanceRecordId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var attendanceRecordIdOption = new Option("--attendancerecord-id", description: "key: id of attendanceRecord"); + attendanceRecordIdOption.IsRequired = true; + command.AddOption(attendanceRecordIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId, attendanceRecordId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var attendanceRecordIdOption = new Option("--attendancerecord-id", description: "key: id of attendanceRecord"); + attendanceRecordIdOption.IsRequired = true; + command.AddOption(attendanceRecordIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId, attendanceRecordId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new AttendanceRecordRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AttendanceRecordRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/me/onlineMeetings/{onlineMeeting_id}/attendanceReports/{meetingAttendanceReport_id}/attendanceRecords/{attendanceRecord_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(AttendanceRecord body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(AttendanceRecord model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// List of attendance records of an attendance report. Read-only. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Me/OnlineMeetings/Item/AttendanceReports/Item/MeetingAttendanceReportRequestBuilder.cs b/src/generated/Me/OnlineMeetings/Item/AttendanceReports/Item/MeetingAttendanceReportRequestBuilder.cs new file mode 100644 index 00000000000..819ffde38da --- /dev/null +++ b/src/generated/Me/OnlineMeetings/Item/AttendanceReports/Item/MeetingAttendanceReportRequestBuilder.cs @@ -0,0 +1,228 @@ +using ApiSdk.Me.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords; +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Me.OnlineMeetings.Item.AttendanceReports.Item { + /// Builds and executes requests for operations under \me\onlineMeetings\{onlineMeeting-id}\attendanceReports\{meetingAttendanceReport-id} + public class MeetingAttendanceReportRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public Command BuildAttendanceRecordsCommand() { + var command = new Command("attendance-records"); + var builder = new ApiSdk.Me.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords.AttendanceRecordsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, meetingAttendanceReportId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new MeetingAttendanceReportRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public MeetingAttendanceReportRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/me/onlineMeetings/{onlineMeeting_id}/attendanceReports/{meetingAttendanceReport_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(MeetingAttendanceReport body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(MeetingAttendanceReport model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// The attendance reports of an online meeting. Read-only. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Me/OnlineMeetings/Item/AttendeeReport/AttendeeReportRequestBuilder.cs b/src/generated/Me/OnlineMeetings/Item/AttendeeReport/AttendeeReportRequestBuilder.cs index bb32e0bb28e..6905b069fe0 100644 --- a/src/generated/Me/OnlineMeetings/Item/AttendeeReport/AttendeeReportRequestBuilder.cs +++ b/src/generated/Me/OnlineMeetings/Item/AttendeeReport/AttendeeReportRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property onlineMeetings from me"; // Create options for all the parameters - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (onlineMeetingId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property onlineMeetings in me"; // Create options for all the parameters - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); - command.AddOption(new Option("--file", description: "Binary request body")); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (onlineMeetingId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/OnlineMeetings/Item/OnlineMeetingRequestBuilder.cs b/src/generated/Me/OnlineMeetings/Item/OnlineMeetingRequestBuilder.cs index f5074917847..8ea4cbfd22a 100644 --- a/src/generated/Me/OnlineMeetings/Item/OnlineMeetingRequestBuilder.cs +++ b/src/generated/Me/OnlineMeetings/Item/OnlineMeetingRequestBuilder.cs @@ -1,3 +1,4 @@ +using ApiSdk.Me.OnlineMeetings.Item.AttendanceReports; using ApiSdk.Me.OnlineMeetings.Item.AttendeeReport; using ApiSdk.Models.Microsoft.Graph; using Microsoft.Kiota.Abstractions; @@ -20,6 +21,13 @@ public class OnlineMeetingRequestBuilder { private IRequestAdapter RequestAdapter { get; set; } /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } + public Command BuildAttendanceReportsCommand() { + var command = new Command("attendance-reports"); + var builder = new ApiSdk.Me.OnlineMeetings.Item.AttendanceReports.AttendanceReportsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } public Command BuildAttendeeReportCommand() { var command = new Command("attendee-report"); var builder = new ApiSdk.Me.OnlineMeetings.Item.AttendeeReport.AttendeeReportRequestBuilder(PathParameters, RequestAdapter); @@ -34,10 +42,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property onlineMeetings for me"; // Create options for all the parameters - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); command.Handler = CommandHandler.Create(async (onlineMeetingId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +61,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get onlineMeetings from me"; // Create options for all the parameters - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (onlineMeetingId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (onlineMeetingId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +95,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property onlineMeetings in me"; // Create options for all the parameters - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); - command.AddOption(new Option("--body")); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (onlineMeetingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/OnlineMeetings/OnlineMeetingsRequestBuilder.cs b/src/generated/Me/OnlineMeetings/OnlineMeetingsRequestBuilder.cs index 9a60264d8cb..7ba32123240 100644 --- a/src/generated/Me/OnlineMeetings/OnlineMeetingsRequestBuilder.cs +++ b/src/generated/Me/OnlineMeetings/OnlineMeetingsRequestBuilder.cs @@ -24,6 +24,7 @@ public class OnlineMeetingsRequestBuilder { public List BuildCommand() { var builder = new OnlineMeetingRequestBuilder(PathParameters, RequestAdapter); var commands = new List { + builder.BuildAttendanceReportsCommand(), builder.BuildAttendeeReportCommand(), builder.BuildDeleteCommand(), builder.BuildGetCommand(), @@ -38,12 +39,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to onlineMeetings for me"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,24 +72,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get onlineMeetings from me"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Outlook/MasterCategories/Item/OutlookCategoryRequestBuilder.cs b/src/generated/Me/Outlook/MasterCategories/Item/OutlookCategoryRequestBuilder.cs index ec88cc58973..5d6e60ab17a 100644 --- a/src/generated/Me/Outlook/MasterCategories/Item/OutlookCategoryRequestBuilder.cs +++ b/src/generated/Me/Outlook/MasterCategories/Item/OutlookCategoryRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A list of categories defined for the user."; // Create options for all the parameters - command.AddOption(new Option("--outlookcategory-id", description: "key: id of outlookCategory")); + var outlookCategoryIdOption = new Option("--outlookcategory-id", description: "key: id of outlookCategory"); + outlookCategoryIdOption.IsRequired = true; + command.AddOption(outlookCategoryIdOption); command.Handler = CommandHandler.Create(async (outlookCategoryId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(outlookCategoryId)) requestInfo.PathParameters.Add("outlookCategory_id", outlookCategoryId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,12 +45,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A list of categories defined for the user."; // Create options for all the parameters - command.AddOption(new Option("--outlookcategory-id", description: "key: id of outlookCategory")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (outlookCategoryId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(outlookCategoryId)) requestInfo.PathParameters.Add("outlookCategory_id", outlookCategoryId); - requestInfo.QueryParameters.Add("select", select); + var outlookCategoryIdOption = new Option("--outlookcategory-id", description: "key: id of outlookCategory"); + outlookCategoryIdOption.IsRequired = true; + command.AddOption(outlookCategoryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (outlookCategoryId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,14 +74,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A list of categories defined for the user."; // Create options for all the parameters - command.AddOption(new Option("--outlookcategory-id", description: "key: id of outlookCategory")); - command.AddOption(new Option("--body")); + var outlookCategoryIdOption = new Option("--outlookcategory-id", description: "key: id of outlookCategory"); + outlookCategoryIdOption.IsRequired = true; + command.AddOption(outlookCategoryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (outlookCategoryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(outlookCategoryId)) requestInfo.PathParameters.Add("outlookCategory_id", outlookCategoryId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Outlook/MasterCategories/MasterCategoriesRequestBuilder.cs b/src/generated/Me/Outlook/MasterCategories/MasterCategoriesRequestBuilder.cs index ef7efdf9377..8b3bf057369 100644 --- a/src/generated/Me/Outlook/MasterCategories/MasterCategoriesRequestBuilder.cs +++ b/src/generated/Me/Outlook/MasterCategories/MasterCategoriesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A list of categories defined for the user."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,20 +63,35 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A list of categories defined for the user."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Outlook/OutlookRequestBuilder.cs b/src/generated/Me/Outlook/OutlookRequestBuilder.cs index 933c6c08f18..c678dddc9f7 100644 --- a/src/generated/Me/Outlook/OutlookRequestBuilder.cs +++ b/src/generated/Me/Outlook/OutlookRequestBuilder.cs @@ -24,14 +24,15 @@ public class OutlookRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only."; + command.Description = "Selective Outlook services available to the user. Read-only. Nullable."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,16 +40,20 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only."; + command.Description = "Selective Outlook services available to the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,18 +73,21 @@ public Command BuildMasterCategoriesCommand() { return command; } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only."; + command.Description = "Selective Outlook services available to the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -100,7 +108,7 @@ public OutlookRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// Request headers /// Request options /// @@ -115,7 +123,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -136,7 +144,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// /// Request headers /// Request options @@ -154,7 +162,7 @@ public RequestInformation CreatePatchRequestInformation(OutlookUser body, Action return requestInfo; } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -165,7 +173,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -177,7 +185,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -209,7 +217,7 @@ public SupportedTimeZonesWithTimeZoneStandardRequestBuilder SupportedTimeZonesWi if(string.IsNullOrEmpty(timeZoneStandard)) throw new ArgumentNullException(nameof(timeZoneStandard)); return new SupportedTimeZonesWithTimeZoneStandardRequestBuilder(PathParameters, RequestAdapter, timeZoneStandard); } - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Select properties to be returned public string[] Select { get; set; } diff --git a/src/generated/Me/Outlook/SupportedLanguages/SupportedLanguagesRequestBuilder.cs b/src/generated/Me/Outlook/SupportedLanguages/SupportedLanguagesRequestBuilder.cs index 2dd55bf5a1d..d436b983afc 100644 --- a/src/generated/Me/Outlook/SupportedLanguages/SupportedLanguagesRequestBuilder.cs +++ b/src/generated/Me/Outlook/SupportedLanguages/SupportedLanguagesRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function supportedLanguages"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Outlook/SupportedTimeZones/SupportedTimeZonesRequestBuilder.cs b/src/generated/Me/Outlook/SupportedTimeZones/SupportedTimeZonesRequestBuilder.cs index a6805747d13..8f8e7dda5c3 100644 --- a/src/generated/Me/Outlook/SupportedTimeZones/SupportedTimeZonesRequestBuilder.cs +++ b/src/generated/Me/Outlook/SupportedTimeZones/SupportedTimeZonesRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function supportedTimeZones"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Outlook/SupportedTimeZonesWithTimeZoneStandard/SupportedTimeZonesWithTimeZoneStandardRequestBuilder.cs b/src/generated/Me/Outlook/SupportedTimeZonesWithTimeZoneStandard/SupportedTimeZonesWithTimeZoneStandardRequestBuilder.cs index 0909854c644..a3a114b6c91 100644 --- a/src/generated/Me/Outlook/SupportedTimeZonesWithTimeZoneStandard/SupportedTimeZonesWithTimeZoneStandardRequestBuilder.cs +++ b/src/generated/Me/Outlook/SupportedTimeZonesWithTimeZoneStandard/SupportedTimeZonesWithTimeZoneStandardRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function supportedTimeZones"; // Create options for all the parameters - command.AddOption(new Option("--timezonestandard", description: "Usage: TimeZoneStandard={TimeZoneStandard}")); - command.Handler = CommandHandler.Create(async (TimeZoneStandard) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(TimeZoneStandard)) requestInfo.PathParameters.Add("TimeZoneStandard", TimeZoneStandard); + var TimeZoneStandardOption = new Option("--timezonestandard", description: "Usage: TimeZoneStandard={TimeZoneStandard}"); + TimeZoneStandardOption.IsRequired = true; + command.AddOption(TimeZoneStandardOption); + command.Handler = CommandHandler.Create(async (TimeZoneStandard) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/OwnedDevices/@Ref/RefRequestBuilder.cs b/src/generated/Me/OwnedDevices/@Ref/RefRequestBuilder.cs index 70c9d35cef4..0609769166b 100644 --- a/src/generated/Me/OwnedDevices/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/OwnedDevices/@Ref/RefRequestBuilder.cs @@ -25,20 +25,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Devices that are owned by the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,12 +71,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Devices that are owned by the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/OwnedDevices/OwnedDevicesRequestBuilder.cs b/src/generated/Me/OwnedDevices/OwnedDevicesRequestBuilder.cs index c3dc272a084..1f28fd39f43 100644 --- a/src/generated/Me/OwnedDevices/OwnedDevicesRequestBuilder.cs +++ b/src/generated/Me/OwnedDevices/OwnedDevicesRequestBuilder.cs @@ -26,24 +26,44 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Devices that are owned by the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/OwnedObjects/@Ref/RefRequestBuilder.cs b/src/generated/Me/OwnedObjects/@Ref/RefRequestBuilder.cs index 5651e688019..44189bc7ff4 100644 --- a/src/generated/Me/OwnedObjects/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/OwnedObjects/@Ref/RefRequestBuilder.cs @@ -25,20 +25,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects that are owned by the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,12 +71,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Directory objects that are owned by the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/OwnedObjects/OwnedObjectsRequestBuilder.cs b/src/generated/Me/OwnedObjects/OwnedObjectsRequestBuilder.cs index acbca1b5a71..eb754ab0c96 100644 --- a/src/generated/Me/OwnedObjects/OwnedObjectsRequestBuilder.cs +++ b/src/generated/Me/OwnedObjects/OwnedObjectsRequestBuilder.cs @@ -26,24 +26,44 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects that are owned by the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/People/Item/PersonRequestBuilder.cs b/src/generated/Me/People/Item/PersonRequestBuilder.cs index cfdc4179504..9ad8c689570 100644 --- a/src/generated/Me/People/Item/PersonRequestBuilder.cs +++ b/src/generated/Me/People/Item/PersonRequestBuilder.cs @@ -20,16 +20,18 @@ public class PersonRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "People that are relevant to the user. Read-only. Nullable."; + command.Description = "Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks."; // Create options for all the parameters - command.AddOption(new Option("--person-id", description: "key: id of person")); + var personIdOption = new Option("--person-id", description: "key: id of person"); + personIdOption.IsRequired = true; + command.AddOption(personIdOption); command.Handler = CommandHandler.Create(async (personId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(personId)) requestInfo.PathParameters.Add("person_id", personId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -37,18 +39,23 @@ public Command BuildDeleteCommand() { return command; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "People that are relevant to the user. Read-only. Nullable."; + command.Description = "Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks."; // Create options for all the parameters - command.AddOption(new Option("--person-id", description: "key: id of person")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (personId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(personId)) requestInfo.PathParameters.Add("person_id", personId); - requestInfo.QueryParameters.Add("select", select); + var personIdOption = new Option("--person-id", description: "key: id of person"); + personIdOption.IsRequired = true; + command.AddOption(personIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (personId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,20 +68,24 @@ public Command BuildGetCommand() { return command; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "People that are relevant to the user. Read-only. Nullable."; + command.Description = "Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks."; // Create options for all the parameters - command.AddOption(new Option("--person-id", description: "key: id of person")); - command.AddOption(new Option("--body")); + var personIdOption = new Option("--person-id", description: "key: id of person"); + personIdOption.IsRequired = true; + command.AddOption(personIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (personId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(personId)) requestInfo.PathParameters.Add("person_id", personId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -95,7 +106,7 @@ public PersonRequestBuilder(Dictionary pathParameters, IRequestA RequestAdapter = requestAdapter; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Request headers /// Request options /// @@ -110,7 +121,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Request headers /// Request options /// Request query parameters @@ -131,7 +142,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// /// Request headers /// Request options @@ -149,7 +160,7 @@ public RequestInformation CreatePatchRequestInformation(Person body, Action - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -160,7 +171,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -172,7 +183,7 @@ public async Task GetAsync(Action q = default, Actio return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -184,7 +195,7 @@ public async Task PatchAsync(Person model, Action> h var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. public class GetQueryParameters : QueryParametersBase { /// Select properties to be returned public string[] Select { get; set; } diff --git a/src/generated/Me/People/PeopleRequestBuilder.cs b/src/generated/Me/People/PeopleRequestBuilder.cs index 56ef227c575..4acbfdbcb63 100644 --- a/src/generated/Me/People/PeopleRequestBuilder.cs +++ b/src/generated/Me/People/PeopleRequestBuilder.cs @@ -30,18 +30,21 @@ public List BuildCommand() { return commands; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "People that are relevant to the user. Read-only. Nullable."; + command.Description = "Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -54,28 +57,45 @@ public Command BuildCreateCommand() { return command; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "People that are relevant to the user. Read-only. Nullable."; + command.Description = "Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -101,7 +121,7 @@ public PeopleRequestBuilder(Dictionary pathParameters, IRequestA RequestAdapter = requestAdapter; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Request headers /// Request options /// Request query parameters @@ -122,7 +142,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// /// Request headers /// Request options @@ -140,7 +160,7 @@ public RequestInformation CreatePostRequestInformation(Person body, Action - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -152,7 +172,7 @@ public async Task GetAsync(Action q = defaul return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -164,7 +184,7 @@ public async Task PostAsync(Person model, Action(requestInfo, responseHandler, cancellationToken); } - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Me/Photo/PhotoRequestBuilder.cs b/src/generated/Me/Photo/PhotoRequestBuilder.cs index 9cca0c8bbba..f9818092f6f 100644 --- a/src/generated/Me/Photo/PhotoRequestBuilder.cs +++ b/src/generated/Me/Photo/PhotoRequestBuilder.cs @@ -35,7 +35,8 @@ public Command BuildDeleteCommand() { command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,10 +50,14 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,12 +76,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Photo/Value/ContentRequestBuilder.cs b/src/generated/Me/Photo/Value/ContentRequestBuilder.cs index 7e73868448e..90b9997fa38 100644 --- a/src/generated/Me/Photo/Value/ContentRequestBuilder.cs +++ b/src/generated/Me/Photo/Value/ContentRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildGetCommand() { // Create options for all the parameters command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (output) => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -50,10 +51,13 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--file", description: "Binary request body")); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Photos/Item/ProfilePhotoRequestBuilder.cs b/src/generated/Me/Photos/Item/ProfilePhotoRequestBuilder.cs index 4ca8ccf2dfe..4b5ed98be14 100644 --- a/src/generated/Me/Photos/Item/ProfilePhotoRequestBuilder.cs +++ b/src/generated/Me/Photos/Item/ProfilePhotoRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); command.Handler = CommandHandler.Create(async (profilePhotoId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,12 +53,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (profilePhotoId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); - requestInfo.QueryParameters.Add("select", select); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (profilePhotoId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,14 +82,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); - command.AddOption(new Option("--body")); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (profilePhotoId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Photos/Item/Value/ContentRequestBuilder.cs b/src/generated/Me/Photos/Item/Value/ContentRequestBuilder.cs index 08393666ac6..fe5ce303453 100644 --- a/src/generated/Me/Photos/Item/Value/ContentRequestBuilder.cs +++ b/src/generated/Me/Photos/Item/Value/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property photos from me"; // Create options for all the parameters - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (profilePhotoId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property photos in me"; // Create options for all the parameters - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); - command.AddOption(new Option("--file", description: "Binary request body")); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (profilePhotoId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Photos/PhotosRequestBuilder.cs b/src/generated/Me/Photos/PhotosRequestBuilder.cs index 2536c436d73..598aaae57bf 100644 --- a/src/generated/Me/Photos/PhotosRequestBuilder.cs +++ b/src/generated/Me/Photos/PhotosRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,20 +64,35 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Planner/PlannerRequestBuilder.cs b/src/generated/Me/Planner/PlannerRequestBuilder.cs index d361d4fa024..c78a9246997 100644 --- a/src/generated/Me/Planner/PlannerRequestBuilder.cs +++ b/src/generated/Me/Planner/PlannerRequestBuilder.cs @@ -22,14 +22,15 @@ public class PlannerRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Entry-point to the Planner resource that might exist for a user. Read-only."; + command.Description = "Selective Planner services available to the user. Read-only. Nullable."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -37,18 +38,25 @@ public Command BuildDeleteCommand() { return command; } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Entry-point to the Planner resource that might exist for a user. Read-only."; + command.Description = "Selective Planner services available to the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,18 +69,21 @@ public Command BuildGetCommand() { return command; } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Entry-point to the Planner resource that might exist for a user. Read-only."; + command.Description = "Selective Planner services available to the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -107,7 +118,7 @@ public PlannerRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// Request headers /// Request options /// @@ -122,7 +133,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -143,7 +154,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// /// Request headers /// Request options @@ -161,7 +172,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerUser body, Action return requestInfo; } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -172,7 +183,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -184,7 +195,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -196,7 +207,7 @@ public async Task PatchAsync(PlannerUser model, ActionEntry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Me/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs index 247d0a071ef..76bdd65d0ff 100644 --- a/src/generated/Me/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs @@ -31,20 +31,24 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,32 +61,53 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,7 +133,7 @@ public BucketsRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -129,7 +154,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -147,7 +172,7 @@ public RequestInformation CreatePostRequestInformation(PlannerBucket body, Actio return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -159,7 +184,7 @@ public async Task GetAsync(Action q = defau return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -171,7 +196,7 @@ public async Task PostAsync(PlannerBucket model, Action(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Me/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs index 01334f10b7d..5e399b2e8b1 100644 --- a/src/generated/Me/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs @@ -21,18 +21,21 @@ public class PlannerBucketRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -40,22 +43,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,22 +80,27 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -111,7 +128,7 @@ public PlannerBucketRequestBuilder(Dictionary pathParameters, IR RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Request headers /// Request options /// @@ -126,7 +143,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -147,7 +164,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -165,7 +182,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerBucket body, Acti return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -176,7 +193,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -188,7 +205,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -200,7 +217,7 @@ public async Task PatchAsync(PlannerBucket model, ActionRead-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs index 3862eede78c..cf8dad74067 100644 --- a/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs index dd5517463a5..ec09501b7a2 100644 --- a/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs index 1435fa2da86..f02eeb2e6d8 100644 --- a/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs index aa49988e730..49551e689bf 100644 --- a/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs @@ -46,14 +46,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -75,18 +79,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -105,18 +119,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs index a392721ad78..6e92825fbf7 100644 --- a/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs index eacb04917ed..884bf8430a3 100644 --- a/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Planner/Plans/Item/Details/DetailsRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Details/DetailsRequestBuilder.cs index 5847d44155b..d0e6fe7392d 100644 --- a/src/generated/Me/Planner/Plans/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Details/DetailsRequestBuilder.cs @@ -20,16 +20,18 @@ public class DetailsRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Additional details about the plan."; + command.Description = "Additional details about the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -37,20 +39,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Additional details about the plan."; + command.Description = "Additional details about the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,20 +73,24 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Additional details about the plan."; + command.Description = "Additional details about the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -97,7 +111,7 @@ public DetailsRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Request headers /// Request options /// @@ -112,7 +126,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -133,7 +147,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -151,7 +165,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerPlanDetails body, return requestInfo; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +176,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +188,7 @@ public async Task GetAsync(Action q = de return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -186,7 +200,7 @@ public async Task PatchAsync(PlannerPlanDetails model, ActionRead-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Me/Planner/Plans/Item/PlannerPlanRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/PlannerPlanRequestBuilder.cs index f073c715cbb..b3c8147b145 100644 --- a/src/generated/Me/Planner/Plans/Item/PlannerPlanRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/PlannerPlanRequestBuilder.cs @@ -36,10 +36,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,14 +63,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,14 +97,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs index 634f9600480..e9aea0fdecd 100644 --- a/src/generated/Me/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs index e3f45dc5a8e..4e7d12fdb7b 100644 --- a/src/generated/Me/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs index fb2d3dfa4e6..9147a08a8bc 100644 --- a/src/generated/Me/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs index 14902d42da4..cb5da241aad 100644 --- a/src/generated/Me/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs @@ -40,18 +40,21 @@ public Command BuildBucketTaskBoardFormatCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,22 +70,31 @@ public Command BuildDetailsCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,22 +107,27 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -139,7 +156,7 @@ public PlannerTaskRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Request headers /// Request options /// @@ -154,7 +171,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -175,7 +192,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -193,7 +210,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerTask body, Action return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -204,7 +221,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -216,7 +233,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -228,7 +245,7 @@ public async Task PatchAsync(PlannerTask model, ActionRead-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Me/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs index 55d9c24393c..18a65104a4c 100644 --- a/src/generated/Me/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs b/src/generated/Me/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs index a344bec983c..3087c75f8b0 100644 --- a/src/generated/Me/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs @@ -34,20 +34,24 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,32 +64,53 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -111,7 +136,7 @@ public TasksRequestBuilder(Dictionary pathParameters, IRequestAd RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -132,7 +157,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -150,7 +175,7 @@ public RequestInformation CreatePostRequestInformation(PlannerTask body, Action< return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +187,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -174,7 +199,7 @@ public async Task PostAsync(PlannerTask model, Action(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Me/Planner/Plans/PlansRequestBuilder.cs b/src/generated/Me/Planner/Plans/PlansRequestBuilder.cs index b93d6487f46..496ba544f1a 100644 --- a/src/generated/Me/Planner/Plans/PlansRequestBuilder.cs +++ b/src/generated/Me/Planner/Plans/PlansRequestBuilder.cs @@ -39,12 +39,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,24 +66,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Planner/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs b/src/generated/Me/Planner/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs index 0815c82297c..9176c68ce99 100644 --- a/src/generated/Me/Planner/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Me/Planner/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Planner/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs b/src/generated/Me/Planner/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs index aba7ccdfed4..04e8cdf7ef5 100644 --- a/src/generated/Me/Planner/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Me/Planner/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Planner/Tasks/Item/Details/DetailsRequestBuilder.cs b/src/generated/Me/Planner/Tasks/Item/Details/DetailsRequestBuilder.cs index 9338dc88ac7..58371dbe7fb 100644 --- a/src/generated/Me/Planner/Tasks/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Me/Planner/Tasks/Item/Details/DetailsRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Planner/Tasks/Item/PlannerTaskRequestBuilder.cs b/src/generated/Me/Planner/Tasks/Item/PlannerTaskRequestBuilder.cs index e11253f6fbb..eac74fc7847 100644 --- a/src/generated/Me/Planner/Tasks/Item/PlannerTaskRequestBuilder.cs +++ b/src/generated/Me/Planner/Tasks/Item/PlannerTaskRequestBuilder.cs @@ -40,16 +40,18 @@ public Command BuildBucketTaskBoardFormatCommand() { return command; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Returns the plannerPlans shared with the user."; + command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -65,20 +67,28 @@ public Command BuildDetailsCommand() { return command; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Returns the plannerPlans shared with the user."; + command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,20 +101,24 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Returns the plannerPlans shared with the user."; + command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -133,7 +147,7 @@ public PlannerTaskRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Request headers /// Request options /// @@ -148,7 +162,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Request headers /// Request options /// Request query parameters @@ -169,7 +183,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// /// Request headers /// Request options @@ -187,7 +201,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerTask body, Action return requestInfo; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -198,7 +212,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -210,7 +224,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -222,7 +236,7 @@ public async Task PatchAsync(PlannerTask model, ActionRead-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Me/Planner/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs b/src/generated/Me/Planner/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs index c2e1449321c..85fbaa1c458 100644 --- a/src/generated/Me/Planner/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Me/Planner/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Planner/Tasks/TasksRequestBuilder.cs b/src/generated/Me/Planner/Tasks/TasksRequestBuilder.cs index d6ca90785f5..f1c0c761982 100644 --- a/src/generated/Me/Planner/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Me/Planner/Tasks/TasksRequestBuilder.cs @@ -34,18 +34,21 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable. Returns the plannerPlans shared with the user."; + command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,30 +61,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable. Returns the plannerPlans shared with the user."; + command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,7 +130,7 @@ public TasksRequestBuilder(Dictionary pathParameters, IRequestAd RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Request headers /// Request options /// Request query parameters @@ -128,7 +151,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// /// Request headers /// Request options @@ -146,7 +169,7 @@ public RequestInformation CreatePostRequestInformation(PlannerTask body, Action< return requestInfo; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -158,7 +181,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -170,7 +193,7 @@ public async Task PostAsync(PlannerTask model, Action(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Me/Presence/ClearPresence/ClearPresenceRequestBuilder.cs b/src/generated/Me/Presence/ClearPresence/ClearPresenceRequestBuilder.cs index b703cf17ed4..3298e1367e6 100644 --- a/src/generated/Me/Presence/ClearPresence/ClearPresenceRequestBuilder.cs +++ b/src/generated/Me/Presence/ClearPresence/ClearPresenceRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clearPresence"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Presence/PresenceRequestBuilder.cs b/src/generated/Me/Presence/PresenceRequestBuilder.cs index 63e9b458372..1cc96948294 100644 --- a/src/generated/Me/Presence/PresenceRequestBuilder.cs +++ b/src/generated/Me/Presence/PresenceRequestBuilder.cs @@ -35,7 +35,8 @@ public Command BuildDeleteCommand() { command.Description = "Delete navigation property presence for me"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,12 +50,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get presence from me"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,12 +81,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property presence in me"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Presence/SetPresence/SetPresenceRequestBuilder.cs b/src/generated/Me/Presence/SetPresence/SetPresenceRequestBuilder.cs index ff253174793..08e8bae696c 100644 --- a/src/generated/Me/Presence/SetPresence/SetPresenceRequestBuilder.cs +++ b/src/generated/Me/Presence/SetPresence/SetPresenceRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setPresence"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/RegisteredDevices/@Ref/RefRequestBuilder.cs b/src/generated/Me/RegisteredDevices/@Ref/RefRequestBuilder.cs index 2675231392b..8a0b333707c 100644 --- a/src/generated/Me/RegisteredDevices/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/RegisteredDevices/@Ref/RefRequestBuilder.cs @@ -25,20 +25,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Devices that are registered for the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,12 +71,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Devices that are registered for the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/RegisteredDevices/RegisteredDevicesRequestBuilder.cs b/src/generated/Me/RegisteredDevices/RegisteredDevicesRequestBuilder.cs index 1624ba2544e..6e1b33e0be0 100644 --- a/src/generated/Me/RegisteredDevices/RegisteredDevicesRequestBuilder.cs +++ b/src/generated/Me/RegisteredDevices/RegisteredDevicesRequestBuilder.cs @@ -26,24 +26,44 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Devices that are registered for the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ReminderViewWithStartDateTimeWithEndDateTime/ReminderViewWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/Me/ReminderViewWithStartDateTimeWithEndDateTime/ReminderViewWithStartDateTimeWithEndDateTimeRequestBuilder.cs index dd053dece75..2d27770d89a 100644 --- a/src/generated/Me/ReminderViewWithStartDateTimeWithEndDateTime/ReminderViewWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/Me/ReminderViewWithStartDateTimeWithEndDateTime/ReminderViewWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function reminderView"; // Create options for all the parameters - command.AddOption(new Option("--startdatetime", description: "Usage: StartDateTime={StartDateTime}")); - command.AddOption(new Option("--enddatetime", description: "Usage: EndDateTime={EndDateTime}")); + var StartDateTimeOption = new Option("--startdatetime", description: "Usage: StartDateTime={StartDateTime}"); + StartDateTimeOption.IsRequired = true; + command.AddOption(StartDateTimeOption); + var EndDateTimeOption = new Option("--enddatetime", description: "Usage: EndDateTime={EndDateTime}"); + EndDateTimeOption.IsRequired = true; + command.AddOption(EndDateTimeOption); command.Handler = CommandHandler.Create(async (StartDateTime, EndDateTime) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(StartDateTime)) requestInfo.PathParameters.Add("StartDateTime", StartDateTime); - if (!String.IsNullOrEmpty(EndDateTime)) requestInfo.PathParameters.Add("EndDateTime", EndDateTime); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/RemoveAllDevicesFromManagement/RemoveAllDevicesFromManagementRequestBuilder.cs b/src/generated/Me/RemoveAllDevicesFromManagement/RemoveAllDevicesFromManagementRequestBuilder.cs index f1e5d39783e..e2bb91a7efc 100644 --- a/src/generated/Me/RemoveAllDevicesFromManagement/RemoveAllDevicesFromManagementRequestBuilder.cs +++ b/src/generated/Me/RemoveAllDevicesFromManagement/RemoveAllDevicesFromManagementRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildPostCommand() { command.Description = "Retire all devices from management for this user"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreatePostRequestInformation(); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ReprocessLicenseAssignment/ReprocessLicenseAssignmentRequestBuilder.cs b/src/generated/Me/ReprocessLicenseAssignment/ReprocessLicenseAssignmentRequestBuilder.cs index ce3fa9df42c..4ba48afee87 100644 --- a/src/generated/Me/ReprocessLicenseAssignment/ReprocessLicenseAssignmentRequestBuilder.cs +++ b/src/generated/Me/ReprocessLicenseAssignment/ReprocessLicenseAssignmentRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildPostCommand() { command.Description = "Invoke action reprocessLicenseAssignment"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreatePostRequestInformation(); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Restore/RestoreRequestBuilder.cs b/src/generated/Me/Restore/RestoreRequestBuilder.cs index d8cab40118b..a5227b7e75f 100644 --- a/src/generated/Me/Restore/RestoreRequestBuilder.cs +++ b/src/generated/Me/Restore/RestoreRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildPostCommand() { command.Description = "Invoke action restore"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreatePostRequestInformation(); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/RevokeSignInSessions/RevokeSignInSessionsRequestBuilder.cs b/src/generated/Me/RevokeSignInSessions/RevokeSignInSessionsRequestBuilder.cs index a0aa5fcdde1..e48f5228547 100644 --- a/src/generated/Me/RevokeSignInSessions/RevokeSignInSessionsRequestBuilder.cs +++ b/src/generated/Me/RevokeSignInSessions/RevokeSignInSessionsRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildPostCommand() { command.Description = "Invoke action revokeSignInSessions"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreatePostRequestInformation(); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/ScopedRoleMemberOf/Item/ScopedRoleMembershipRequestBuilder.cs b/src/generated/Me/ScopedRoleMemberOf/Item/ScopedRoleMembershipRequestBuilder.cs index 9d5e2b44e4b..238a04b5154 100644 --- a/src/generated/Me/ScopedRoleMemberOf/Item/ScopedRoleMembershipRequestBuilder.cs +++ b/src/generated/Me/ScopedRoleMemberOf/Item/ScopedRoleMembershipRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The scoped-role administrative unit memberships for this user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); command.Handler = CommandHandler.Create(async (scopedRoleMembershipId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The scoped-role administrative unit memberships for this user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (scopedRoleMembershipId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (scopedRoleMembershipId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The scoped-role administrative unit memberships for this user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); - command.AddOption(new Option("--body")); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (scopedRoleMembershipId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/ScopedRoleMemberOf/ScopedRoleMemberOfRequestBuilder.cs b/src/generated/Me/ScopedRoleMemberOf/ScopedRoleMemberOfRequestBuilder.cs index b6f75aa33f9..a5e5281da91 100644 --- a/src/generated/Me/ScopedRoleMemberOf/ScopedRoleMemberOfRequestBuilder.cs +++ b/src/generated/Me/ScopedRoleMemberOf/ScopedRoleMemberOfRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The scoped-role administrative unit memberships for this user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The scoped-role administrative unit memberships for this user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/SendMail/SendMailRequestBuilder.cs b/src/generated/Me/SendMail/SendMailRequestBuilder.cs index 4ff73cbe776..efa81bc525c 100644 --- a/src/generated/Me/SendMail/SendMailRequestBuilder.cs +++ b/src/generated/Me/SendMail/SendMailRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sendMail"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Settings/SettingsRequestBuilder.cs b/src/generated/Me/Settings/SettingsRequestBuilder.cs index 79db71528d0..f4edaab6c11 100644 --- a/src/generated/Me/Settings/SettingsRequestBuilder.cs +++ b/src/generated/Me/Settings/SettingsRequestBuilder.cs @@ -28,7 +28,8 @@ public Command BuildDeleteCommand() { command.Description = "Read-only. Nullable."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,12 +43,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,12 +74,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Settings/ShiftPreferences/ShiftPreferencesRequestBuilder.cs b/src/generated/Me/Settings/ShiftPreferences/ShiftPreferencesRequestBuilder.cs index 1047d5db115..b56a7300ece 100644 --- a/src/generated/Me/Settings/ShiftPreferences/ShiftPreferencesRequestBuilder.cs +++ b/src/generated/Me/Settings/ShiftPreferences/ShiftPreferencesRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildDeleteCommand() { command.Description = "The shift preferences for the user."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,12 +42,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The shift preferences for the user."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,12 +73,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The shift preferences for the user."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Teamwork/InstalledApps/InstalledAppsRequestBuilder.cs b/src/generated/Me/Teamwork/InstalledApps/InstalledAppsRequestBuilder.cs index 7de8c36f33a..143d9ba766a 100644 --- a/src/generated/Me/Teamwork/InstalledApps/InstalledAppsRequestBuilder.cs +++ b/src/generated/Me/Teamwork/InstalledApps/InstalledAppsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The apps installed in the personal scope of this user."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The apps installed in the personal scope of this user."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Teamwork/InstalledApps/Item/Chat/@Ref/RefRequestBuilder.cs b/src/generated/Me/Teamwork/InstalledApps/Item/Chat/@Ref/RefRequestBuilder.cs index 3bf82a9a787..d0725d47f9f 100644 --- a/src/generated/Me/Teamwork/InstalledApps/Item/Chat/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/Teamwork/InstalledApps/Item/Chat/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The chat between the user and Teams app."; // Create options for all the parameters - command.AddOption(new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation")); + var userScopeTeamsAppInstallationIdOption = new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation"); + userScopeTeamsAppInstallationIdOption.IsRequired = true; + command.AddOption(userScopeTeamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (userScopeTeamsAppInstallationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userScopeTeamsAppInstallationId)) requestInfo.PathParameters.Add("userScopeTeamsAppInstallation_id", userScopeTeamsAppInstallationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The chat between the user and Teams app."; // Create options for all the parameters - command.AddOption(new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation")); + var userScopeTeamsAppInstallationIdOption = new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation"); + userScopeTeamsAppInstallationIdOption.IsRequired = true; + command.AddOption(userScopeTeamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (userScopeTeamsAppInstallationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userScopeTeamsAppInstallationId)) requestInfo.PathParameters.Add("userScopeTeamsAppInstallation_id", userScopeTeamsAppInstallationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The chat between the user and Teams app."; // Create options for all the parameters - command.AddOption(new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation")); - command.AddOption(new Option("--body")); + var userScopeTeamsAppInstallationIdOption = new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation"); + userScopeTeamsAppInstallationIdOption.IsRequired = true; + command.AddOption(userScopeTeamsAppInstallationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userScopeTeamsAppInstallationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(userScopeTeamsAppInstallationId)) requestInfo.PathParameters.Add("userScopeTeamsAppInstallation_id", userScopeTeamsAppInstallationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Teamwork/InstalledApps/Item/Chat/ChatRequestBuilder.cs b/src/generated/Me/Teamwork/InstalledApps/Item/Chat/ChatRequestBuilder.cs index af905ad5040..2357c25cfc6 100644 --- a/src/generated/Me/Teamwork/InstalledApps/Item/Chat/ChatRequestBuilder.cs +++ b/src/generated/Me/Teamwork/InstalledApps/Item/Chat/ChatRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The chat between the user and Teams app."; // Create options for all the parameters - command.AddOption(new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userScopeTeamsAppInstallationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userScopeTeamsAppInstallationId)) requestInfo.PathParameters.Add("userScopeTeamsAppInstallation_id", userScopeTeamsAppInstallationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userScopeTeamsAppInstallationIdOption = new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation"); + userScopeTeamsAppInstallationIdOption.IsRequired = true; + command.AddOption(userScopeTeamsAppInstallationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userScopeTeamsAppInstallationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Teamwork/InstalledApps/Item/UserScopeTeamsAppInstallationRequestBuilder.cs b/src/generated/Me/Teamwork/InstalledApps/Item/UserScopeTeamsAppInstallationRequestBuilder.cs index 9874fcc475b..564fadaefa7 100644 --- a/src/generated/Me/Teamwork/InstalledApps/Item/UserScopeTeamsAppInstallationRequestBuilder.cs +++ b/src/generated/Me/Teamwork/InstalledApps/Item/UserScopeTeamsAppInstallationRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The apps installed in the personal scope of this user."; // Create options for all the parameters - command.AddOption(new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation")); + var userScopeTeamsAppInstallationIdOption = new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation"); + userScopeTeamsAppInstallationIdOption.IsRequired = true; + command.AddOption(userScopeTeamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (userScopeTeamsAppInstallationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userScopeTeamsAppInstallationId)) requestInfo.PathParameters.Add("userScopeTeamsAppInstallation_id", userScopeTeamsAppInstallationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The apps installed in the personal scope of this user."; // Create options for all the parameters - command.AddOption(new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userScopeTeamsAppInstallationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userScopeTeamsAppInstallationId)) requestInfo.PathParameters.Add("userScopeTeamsAppInstallation_id", userScopeTeamsAppInstallationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userScopeTeamsAppInstallationIdOption = new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation"); + userScopeTeamsAppInstallationIdOption.IsRequired = true; + command.AddOption(userScopeTeamsAppInstallationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userScopeTeamsAppInstallationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The apps installed in the personal scope of this user."; // Create options for all the parameters - command.AddOption(new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation")); - command.AddOption(new Option("--body")); + var userScopeTeamsAppInstallationIdOption = new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation"); + userScopeTeamsAppInstallationIdOption.IsRequired = true; + command.AddOption(userScopeTeamsAppInstallationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userScopeTeamsAppInstallationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userScopeTeamsAppInstallationId)) requestInfo.PathParameters.Add("userScopeTeamsAppInstallation_id", userScopeTeamsAppInstallationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Teamwork/SendActivityNotification/SendActivityNotificationRequestBuilder.cs b/src/generated/Me/Teamwork/SendActivityNotification/SendActivityNotificationRequestBuilder.cs index 7e3c9837f88..f975bf1b8ee 100644 --- a/src/generated/Me/Teamwork/SendActivityNotification/SendActivityNotificationRequestBuilder.cs +++ b/src/generated/Me/Teamwork/SendActivityNotification/SendActivityNotificationRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sendActivityNotification"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Teamwork/TeamworkRequestBuilder.cs b/src/generated/Me/Teamwork/TeamworkRequestBuilder.cs index 6f0567f431b..3841761050a 100644 --- a/src/generated/Me/Teamwork/TeamworkRequestBuilder.cs +++ b/src/generated/Me/Teamwork/TeamworkRequestBuilder.cs @@ -29,7 +29,8 @@ public Command BuildDeleteCommand() { command.Description = "A container for Microsoft Teams features available for the user. Read-only. Nullable."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,12 +44,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A container for Microsoft Teams features available for the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,12 +82,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A container for Microsoft Teams features available for the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Todo/Lists/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Todo/Lists/Delta/DeltaRequestBuilder.cs index d405d01161e..3ee912a1d93 100644 --- a/src/generated/Me/Todo/Lists/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Todo/Lists/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Todo/Lists/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/Todo/Lists/Item/Extensions/ExtensionsRequestBuilder.cs index af3a910d958..0152b88580b 100644 --- a/src/generated/Me/Todo/Lists/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/Todo/Lists/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the task list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--body")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (todoTaskListId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the task list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (todoTaskListId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (todoTaskListId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Todo/Lists/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/Todo/Lists/Item/Extensions/Item/ExtensionRequestBuilder.cs index 9f2dadbdd19..cfe134e5cb0 100644 --- a/src/generated/Me/Todo/Lists/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/Todo/Lists/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the task list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (todoTaskListId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the task list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (todoTaskListId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (todoTaskListId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the task list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (todoTaskListId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Todo/Lists/Item/Tasks/Delta/DeltaRequestBuilder.cs b/src/generated/Me/Todo/Lists/Item/Tasks/Delta/DeltaRequestBuilder.cs index 6e76f186240..88cc250add8 100644 --- a/src/generated/Me/Todo/Lists/Item/Tasks/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Me/Todo/Lists/Item/Tasks/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); command.Handler = CommandHandler.Create(async (todoTaskListId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Todo/Lists/Item/Tasks/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Me/Todo/Lists/Item/Tasks/Item/Extensions/ExtensionsRequestBuilder.cs index 3937a6a77fd..7dea4d282e7 100644 --- a/src/generated/Me/Todo/Lists/Item/Tasks/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Me/Todo/Lists/Item/Tasks/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the task. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--body")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the task. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Todo/Lists/Item/Tasks/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Me/Todo/Lists/Item/Tasks/Item/Extensions/Item/ExtensionRequestBuilder.cs index bb928009a71..d1b02a204e2 100644 --- a/src/generated/Me/Todo/Lists/Item/Tasks/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Me/Todo/Lists/Item/Tasks/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the task. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the task. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the task. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Todo/Lists/Item/Tasks/Item/LinkedResources/Item/LinkedResourceRequestBuilder.cs b/src/generated/Me/Todo/Lists/Item/Tasks/Item/LinkedResources/Item/LinkedResourceRequestBuilder.cs index 7709bdc63df..68b65220d13 100644 --- a/src/generated/Me/Todo/Lists/Item/Tasks/Item/LinkedResources/Item/LinkedResourceRequestBuilder.cs +++ b/src/generated/Me/Todo/Lists/Item/Tasks/Item/LinkedResources/Item/LinkedResourceRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of resources linked to the task."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--linkedresource-id", description: "key: id of linkedResource")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var linkedResourceIdOption = new Option("--linkedresource-id", description: "key: id of linkedResource"); + linkedResourceIdOption.IsRequired = true; + command.AddOption(linkedResourceIdOption); command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, linkedResourceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - if (!String.IsNullOrEmpty(linkedResourceId)) requestInfo.PathParameters.Add("linkedResource_id", linkedResourceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of resources linked to the task."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--linkedresource-id", description: "key: id of linkedResource")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, linkedResourceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - if (!String.IsNullOrEmpty(linkedResourceId)) requestInfo.PathParameters.Add("linkedResource_id", linkedResourceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var linkedResourceIdOption = new Option("--linkedresource-id", description: "key: id of linkedResource"); + linkedResourceIdOption.IsRequired = true; + command.AddOption(linkedResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, linkedResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of resources linked to the task."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--linkedresource-id", description: "key: id of linkedResource")); - command.AddOption(new Option("--body")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var linkedResourceIdOption = new Option("--linkedresource-id", description: "key: id of linkedResource"); + linkedResourceIdOption.IsRequired = true; + command.AddOption(linkedResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, linkedResourceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - if (!String.IsNullOrEmpty(linkedResourceId)) requestInfo.PathParameters.Add("linkedResource_id", linkedResourceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Todo/Lists/Item/Tasks/Item/LinkedResources/LinkedResourcesRequestBuilder.cs b/src/generated/Me/Todo/Lists/Item/Tasks/Item/LinkedResources/LinkedResourcesRequestBuilder.cs index d118d0a3c30..28b14ae41bb 100644 --- a/src/generated/Me/Todo/Lists/Item/Tasks/Item/LinkedResources/LinkedResourcesRequestBuilder.cs +++ b/src/generated/Me/Todo/Lists/Item/Tasks/Item/LinkedResources/LinkedResourcesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of resources linked to the task."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--body")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of resources linked to the task."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Todo/Lists/Item/Tasks/Item/TodoTaskRequestBuilder.cs b/src/generated/Me/Todo/Lists/Item/Tasks/Item/TodoTaskRequestBuilder.cs index 1c18fdd737a..b2f5b9fb35a 100644 --- a/src/generated/Me/Todo/Lists/Item/Tasks/Item/TodoTaskRequestBuilder.cs +++ b/src/generated/Me/Todo/Lists/Item/Tasks/Item/TodoTaskRequestBuilder.cs @@ -28,12 +28,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The tasks in this task list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The tasks in this task list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -89,16 +101,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The tasks in this task list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--body")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (todoTaskListId, todoTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Todo/Lists/Item/Tasks/TasksRequestBuilder.cs b/src/generated/Me/Todo/Lists/Item/Tasks/TasksRequestBuilder.cs index 5b3d6ac5ab2..9831e95b318 100644 --- a/src/generated/Me/Todo/Lists/Item/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Me/Todo/Lists/Item/Tasks/TasksRequestBuilder.cs @@ -39,14 +39,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The tasks in this task list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--body")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (todoTaskListId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,26 +69,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The tasks in this task list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (todoTaskListId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (todoTaskListId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Todo/Lists/Item/TodoTaskListRequestBuilder.cs b/src/generated/Me/Todo/Lists/Item/TodoTaskListRequestBuilder.cs index 958894e39e4..e808d321fbf 100644 --- a/src/generated/Me/Todo/Lists/Item/TodoTaskListRequestBuilder.cs +++ b/src/generated/Me/Todo/Lists/Item/TodoTaskListRequestBuilder.cs @@ -28,10 +28,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The task lists in the users mailbox."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); command.Handler = CommandHandler.Create(async (todoTaskListId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,14 +54,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The task lists in the users mailbox."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (todoTaskListId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (todoTaskListId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,14 +88,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The task lists in the users mailbox."; // Create options for all the parameters - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--body")); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (todoTaskListId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/Todo/Lists/ListsRequestBuilder.cs b/src/generated/Me/Todo/Lists/ListsRequestBuilder.cs index c66d5927613..08a8872a6a8 100644 --- a/src/generated/Me/Todo/Lists/ListsRequestBuilder.cs +++ b/src/generated/Me/Todo/Lists/ListsRequestBuilder.cs @@ -39,12 +39,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The task lists in the users mailbox."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,24 +66,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The task lists in the users mailbox."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/Todo/TodoRequestBuilder.cs b/src/generated/Me/Todo/TodoRequestBuilder.cs index 4c4c6b20802..54c5e7347c5 100644 --- a/src/generated/Me/Todo/TodoRequestBuilder.cs +++ b/src/generated/Me/Todo/TodoRequestBuilder.cs @@ -28,7 +28,8 @@ public Command BuildDeleteCommand() { command.Description = "Represents the To Do services available to a user."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,12 +43,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the To Do services available to a user."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,12 +81,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the To Do services available to a user."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Me/TransitiveMemberOf/@Ref/RefRequestBuilder.cs b/src/generated/Me/TransitiveMemberOf/@Ref/RefRequestBuilder.cs index 5a97bb88f28..78bf7dce580 100644 --- a/src/generated/Me/TransitiveMemberOf/@Ref/RefRequestBuilder.cs +++ b/src/generated/Me/TransitiveMemberOf/@Ref/RefRequestBuilder.cs @@ -25,20 +25,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of transitiveMemberOf from me"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,12 +71,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Create new navigation property ref to transitiveMemberOf for me"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs b/src/generated/Me/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs index defec5bb892..f4c5ae02049 100644 --- a/src/generated/Me/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs +++ b/src/generated/Me/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs @@ -26,24 +26,44 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get transitiveMemberOf from me"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/TranslateExchangeIds/TranslateExchangeIdsRequestBuilder.cs b/src/generated/Me/TranslateExchangeIds/TranslateExchangeIdsRequestBuilder.cs index 23ab8ece9c7..d816270e5f3 100644 --- a/src/generated/Me/TranslateExchangeIds/TranslateExchangeIdsRequestBuilder.cs +++ b/src/generated/Me/TranslateExchangeIds/TranslateExchangeIdsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action translateExchangeIds"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Me/WipeManagedAppRegistrationsByDeviceTag/WipeManagedAppRegistrationsByDeviceTagRequestBuilder.cs b/src/generated/Me/WipeManagedAppRegistrationsByDeviceTag/WipeManagedAppRegistrationsByDeviceTagRequestBuilder.cs index 87a2cb0f2c2..c8b594851ea 100644 --- a/src/generated/Me/WipeManagedAppRegistrationsByDeviceTag/WipeManagedAppRegistrationsByDeviceTagRequestBuilder.cs +++ b/src/generated/Me/WipeManagedAppRegistrationsByDeviceTag/WipeManagedAppRegistrationsByDeviceTagRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Issues a wipe operation on an app registration with specified device tag."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Models/Microsoft/Graph/@Event.cs b/src/generated/Models/Microsoft/Graph/@Event.cs index 5a74fc4fc62..bf52dfbe4d1 100644 --- a/src/generated/Models/Microsoft/Graph/@Event.cs +++ b/src/generated/Models/Microsoft/Graph/@Event.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class @Event : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AccessPackage.cs b/src/generated/Models/Microsoft/Graph/AccessPackage.cs index da7b7613045..89df81529a3 100644 --- a/src/generated/Models/Microsoft/Graph/AccessPackage.cs +++ b/src/generated/Models/Microsoft/Graph/AccessPackage.cs @@ -5,12 +5,13 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AccessPackage : Entity, IParsable { + /// Read-only. Nullable. public AccessPackageCatalog Catalog { get; set; } /// The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. public DateTimeOffset? CreatedDateTime { get; set; } /// The description of the access package. public string Description { get; set; } - /// The display name of the access package. + /// The display name of the access package. Supports $filter (eq, contains). public string DisplayName { get; set; } /// Whether the access package is hidden from the requestor. public bool? IsHidden { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AccessPackageAssignment.cs b/src/generated/Models/Microsoft/Graph/AccessPackageAssignment.cs index 6840010b955..1e5bc6b5404 100644 --- a/src/generated/Models/Microsoft/Graph/AccessPackageAssignment.cs +++ b/src/generated/Models/Microsoft/Graph/AccessPackageAssignment.cs @@ -5,15 +5,17 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AccessPackageAssignment : Entity, IParsable { - /// Read-only. Nullable. + /// Read-only. Nullable. Supports $filter (eq) on the id property and $expand query parameters. public ApiSdk.Models.Microsoft.Graph.AccessPackage AccessPackage { get; set; } /// The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z public DateTimeOffset? ExpiredDateTime { get; set; } /// When the access assignment is to be in place. Read-only. public EntitlementManagementSchedule Schedule { get; set; } + /// The state of the access package assignment. The possible values are: delivering, partiallyDelivered, delivered, expired, deliveryFailed, unknownFutureValue. Read-only. Supports $filter (eq). public AccessPackageAssignmentState? State { get; set; } + /// More information about the assignment lifecycle. Possible values include Delivering, Delivered, NearExpiry1DayNotificationTriggered, or ExpiredNotificationTriggered. Read-only. public string Status { get; set; } - /// The subject of the access package assignment. Read-only. Nullable. + /// The subject of the access package assignment. Read-only. Nullable. Supports $expand. Supports $filter (eq) on objectId. public AccessPackageSubject Target { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/AccessPackageAssignmentRequest.cs b/src/generated/Models/Microsoft/Graph/AccessPackageAssignmentRequest.cs index fa19ff22d33..8d9e4bab907 100644 --- a/src/generated/Models/Microsoft/Graph/AccessPackageAssignmentRequest.cs +++ b/src/generated/Models/Microsoft/Graph/AccessPackageAssignmentRequest.cs @@ -5,8 +5,9 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AccessPackageAssignmentRequest : Entity, IParsable { - /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. + /// The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand. public ApiSdk.Models.Microsoft.Graph.AccessPackage AccessPackage { get; set; } + /// For a requestType of UserAdd or AdminAdd, this is an access package assignment requested to be created. For a requestType of UserRemove, AdminRemove or SystemRemove, this has the id property of an existing assignment to be removed. Supports $expand. public AccessPackageAssignment Assignment { get; set; } public DateTimeOffset? CompletedDateTime { get; set; } /// The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. @@ -17,7 +18,9 @@ public class AccessPackageAssignmentRequest : Entity, IParsable { public AccessPackageRequestType? RequestType { get; set; } /// The range of dates that access is to be assigned to the requestor. Read-only. public EntitlementManagementSchedule Schedule { get; set; } + /// The state of the request. The possible values are: submitted, pendingApproval, delivering, delivered, deliveryFailed, denied, scheduled, canceled, partiallyDelivered, unknownFutureValue. Read-only. public AccessPackageRequestState? State { get; set; } + /// More information on the request processing status. Read-only. public string Status { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/AccessPackageCatalog.cs b/src/generated/Models/Microsoft/Graph/AccessPackageCatalog.cs index 659c9fb7ffd..9ea5a64139e 100644 --- a/src/generated/Models/Microsoft/Graph/AccessPackageCatalog.cs +++ b/src/generated/Models/Microsoft/Graph/AccessPackageCatalog.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AccessPackageCatalog : Entity, IParsable { - /// The access packages in this catalog. Read-only. Nullable. + /// The access packages in this catalog. Read-only. Nullable. Supports $expand. public List AccessPackages { get; set; } /// One of UserManaged or ServiceDefault. public AccessPackageCatalogType? CatalogType { get; set; } @@ -13,12 +13,13 @@ public class AccessPackageCatalog : Entity, IParsable { public DateTimeOffset? CreatedDateTime { get; set; } /// The description of the access package catalog. public string Description { get; set; } - /// The display name of the access package catalog. + /// The display name of the access package catalog. Supports $filter (eq, contains). public string DisplayName { get; set; } /// Whether the access packages in this catalog can be requested by users outside of the tenant. public bool? IsExternallyVisible { get; set; } /// The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. public DateTimeOffset? ModifiedDateTime { get; set; } + /// Has the value published if the access packages are available for management. The possible values are: unpublished, published, unknownFutureValue. public AccessPackageCatalogState? State { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/AccessPackageSubject.cs b/src/generated/Models/Microsoft/Graph/AccessPackageSubject.cs index 8b965fb87ef..8cdd3422cb9 100644 --- a/src/generated/Models/Microsoft/Graph/AccessPackageSubject.cs +++ b/src/generated/Models/Microsoft/Graph/AccessPackageSubject.cs @@ -13,9 +13,11 @@ public class AccessPackageSubject : Entity, IParsable { public string Email { get; set; } /// The object identifier of the subject. null if the subject is not yet a user in the tenant. public string ObjectId { get; set; } + /// A string representation of the principal's security identifier, if known, or null if the subject does not have a security identifier. public string OnPremisesSecurityIdentifier { get; set; } /// The principal name, if known, of the subject. public string PrincipalName { get; set; } + /// The resource type of the subject. The possible values are: notSpecified, user, servicePrincipal, unknownFutureValue. public AccessPackageSubjectType? SubjectType { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/AccessReviewInstance.cs b/src/generated/Models/Microsoft/Graph/AccessReviewInstance.cs index db94d758f27..4448c99fa02 100644 --- a/src/generated/Models/Microsoft/Graph/AccessReviewInstance.cs +++ b/src/generated/Models/Microsoft/Graph/AccessReviewInstance.cs @@ -5,7 +5,9 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AccessReviewInstance : Entity, IParsable { - /// Each principal reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. + /// Returns the collection of reviewers who were contacted to complete this review. While the reviewers and fallbackReviewers properties of the accessReviewScheduleDefinition might specify group owners or managers as reviewers, contactedReviewers returns their individual identities. Supports $select. Read-only. + public List ContactedReviewers { get; set; } + /// Each user reviewed in an accessReviewInstance has a decision item representing if they were approved, denied, or not yet reviewed. public List Decisions { get; set; } /// DateTime when review instance is scheduled to end.The DatetimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Supports $select. Read-only. public DateTimeOffset? EndDateTime { get; set; } @@ -24,6 +26,7 @@ public class AccessReviewInstance : Entity, IParsable { /// public new IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { + {"contactedReviewers", (o,n) => { (o as AccessReviewInstance).ContactedReviewers = n.GetCollectionOfObjectValues().ToList(); } }, {"decisions", (o,n) => { (o as AccessReviewInstance).Decisions = n.GetCollectionOfObjectValues().ToList(); } }, {"endDateTime", (o,n) => { (o as AccessReviewInstance).EndDateTime = n.GetDateTimeOffsetValue(); } }, {"fallbackReviewers", (o,n) => { (o as AccessReviewInstance).FallbackReviewers = n.GetCollectionOfObjectValues().ToList(); } }, @@ -40,6 +43,7 @@ public class AccessReviewInstance : Entity, IParsable { public new void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); + writer.WriteCollectionOfObjectValues("contactedReviewers", ContactedReviewers); writer.WriteCollectionOfObjectValues("decisions", Decisions); writer.WriteDateTimeOffsetValue("endDateTime", EndDateTime); writer.WriteCollectionOfObjectValues("fallbackReviewers", FallbackReviewers); diff --git a/src/generated/Models/Microsoft/Graph/AccessReviewInstanceDecisionItem.cs b/src/generated/Models/Microsoft/Graph/AccessReviewInstanceDecisionItem.cs index 7fd5eb9ffee..de4ae0a41a8 100644 --- a/src/generated/Models/Microsoft/Graph/AccessReviewInstanceDecisionItem.cs +++ b/src/generated/Models/Microsoft/Graph/AccessReviewInstanceDecisionItem.cs @@ -19,7 +19,7 @@ public class AccessReviewInstanceDecisionItem : Entity, IParsable { public string Justification { get; set; } /// Every decision item in an access review represents a principal's access to a resource. This property represents details of the principal. For example, if a decision item represents access of User 'Bob' to Group 'Sales' - The principal is 'Bob' and the resource is 'Sales'. Principals can be of two types - userIdentity and servicePrincipalIdentity. Supports $select. Read-only. public ApiSdk.Models.Microsoft.Graph.Identity Principal { get; set; } - /// A link to the principal object. For example, https://graph.microsoft.com/v1.0/users/a6c7aecb-cbfd-4763-87ef-e91b4bd509d9. Read-only. + /// Link to the principal object. For example: https://graph.microsoft.com/v1.0/users/a6c7aecb-cbfd-4763-87ef-e91b4bd509d9. Read-only. public string PrincipalLink { get; set; } /// A system-generated recommendation for the approval decision based off last interactive sign-in to tenant. Recommend approve if sign-in is within thirty days of start of review. Recommend deny if sign-in is greater than thirty days of start of review. Recommendation not available otherwise. Possible values: Approve, Deny, or NoInfoAvailable. Supports $select, $orderby, and $filter (eq only). Read-only. public string Recommendation { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AccessReviewInstanceDecisionItemResource.cs b/src/generated/Models/Microsoft/Graph/AccessReviewInstanceDecisionItemResource.cs index 4ec03a057e4..87f42a35463 100644 --- a/src/generated/Models/Microsoft/Graph/AccessReviewInstanceDecisionItemResource.cs +++ b/src/generated/Models/Microsoft/Graph/AccessReviewInstanceDecisionItemResource.cs @@ -9,7 +9,7 @@ public class AccessReviewInstanceDecisionItemResource : IParsable { public IDictionary AdditionalData { get; set; } /// Display name of the resource public string DisplayName { get; set; } - /// Identifier of the resource + /// Resource ID public string Id { get; set; } /// Type of resource. Types include: Group, ServicePrincipal, DirectoryRole, AzureRole, AccessPackageAssignmentPolicy. public string Type { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AccessReviewNotificationRecipientItem.cs b/src/generated/Models/Microsoft/Graph/AccessReviewNotificationRecipientItem.cs index 5e538c20fae..3b134a09080 100644 --- a/src/generated/Models/Microsoft/Graph/AccessReviewNotificationRecipientItem.cs +++ b/src/generated/Models/Microsoft/Graph/AccessReviewNotificationRecipientItem.cs @@ -9,7 +9,7 @@ public class AccessReviewNotificationRecipientItem : IParsable { public IDictionary AdditionalData { get; set; } /// Determines the recipient of the notification email. public AccessReviewNotificationRecipientScope NotificationRecipientScope { get; set; } - /// Indicates the type of access review email to be sent. Supported template type is CompletedAdditionalRecipients, which sends review completion notifications to the recipients. + /// Indicates the type of access review email to be sent. Supported template type is CompletedAdditionalRecipients which sends review completion notifications to the recipients. public string NotificationTemplateType { get; set; } /// /// Instantiates a new accessReviewNotificationRecipientItem and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/AccessReviewReviewer.cs b/src/generated/Models/Microsoft/Graph/AccessReviewReviewer.cs new file mode 100644 index 00000000000..d7e5bd4b0ed --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/AccessReviewReviewer.cs @@ -0,0 +1,36 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class AccessReviewReviewer : Entity, IParsable { + /// The date when the reviewer was added for the access review. + public DateTimeOffset? CreatedDateTime { get; set; } + /// Name of reviewer. + public string DisplayName { get; set; } + /// User principal name of the user. + public string UserPrincipalName { get; set; } + /// + /// The deserialization information for the current model + /// + public new IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + {"createdDateTime", (o,n) => { (o as AccessReviewReviewer).CreatedDateTime = n.GetDateTimeOffsetValue(); } }, + {"displayName", (o,n) => { (o as AccessReviewReviewer).DisplayName = n.GetStringValue(); } }, + {"userPrincipalName", (o,n) => { (o as AccessReviewReviewer).UserPrincipalName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public new void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteDateTimeOffsetValue("createdDateTime", CreatedDateTime); + writer.WriteStringValue("displayName", DisplayName); + writer.WriteStringValue("userPrincipalName", UserPrincipalName); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/AccessReviewScheduleDefinition.cs b/src/generated/Models/Microsoft/Graph/AccessReviewScheduleDefinition.cs index a44975c65f4..44e80503b16 100644 --- a/src/generated/Models/Microsoft/Graph/AccessReviewScheduleDefinition.cs +++ b/src/generated/Models/Microsoft/Graph/AccessReviewScheduleDefinition.cs @@ -9,7 +9,7 @@ public class AccessReviewScheduleDefinition : Entity, IParsable { public List AdditionalNotificationRecipients { get; set; } /// User who created this review. Read-only. public UserIdentity CreatedBy { get; set; } - /// Timestamp when the access review series was created. Supports $select and $orderBy. Read-only. + /// Timestamp when the access review series was created. Supports $select. Read-only. public DateTimeOffset? CreatedDateTime { get; set; } /// Description provided by review creators to provide more context of the review to admins. Supports $select. public string DescriptionForAdmins { get; set; } @@ -21,13 +21,13 @@ public class AccessReviewScheduleDefinition : Entity, IParsable { public List FallbackReviewers { get; set; } /// This property is required when scoping a review to guest users' access across all Microsoft 365 groups and determines which Microsoft 365 groups are reviewed. Each group will become a unique accessReviewInstance of the access review series. For supported scopes, see accessReviewScope. Supports $select. For examples of options for configuring instanceEnumerationScope, see Configure the scope of your access review definition using the Microsoft Graph API. public AccessReviewScope InstanceEnumerationScope { get; set; } - /// If the accessReviewScheduleDefinition is a recurring access review, instances represent each recurrence. A review that does not recur will have exactly one instance. Instances also represent each unique resource under review in the accessReviewScheduleDefinition. If a review has multiple resources and multiple instances, each resource will have a unique instance for each recurrence. + /// Set of access reviews instances for this access review series. Access reviews that do not recur will only have one instance; otherwise, there is an instance for each recurrence. public List Instances { get; set; } /// Timestamp when the access review series was last modified. Supports $select. Read-only. public DateTimeOffset? LastModifiedDateTime { get; set; } /// This collection of access review scopes is used to define who are the reviewers. The reviewers property is only updatable if individual users are assigned as reviewers. Required on create. Supports $select. For examples of options for assigning reviewers, see Assign reviewers to your access review definition using the Microsoft Graph API. public List Reviewers { get; set; } - /// Defines the entities whose access is reviewed. For supported scopes, see accessReviewScope. Required on create. Supports $select and $filter (contains only). For examples of options for configuring scope, see Configure the scope of your access review definition using the Microsoft Graph API. + /// Defines the entities whose access is reviewed. For supported scopes, see accessReviewScope. Required on create. Supports $select and $filter (contains only). For examples of options for configuring scope, see Configure the scope of your access review definition using the Microsoft Graph API. public AccessReviewScope Scope { get; set; } /// The settings for an access review series, see type definition below. Supports $select. Required on create. public AccessReviewScheduleSettings Settings { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AccessReviewScheduleSettings.cs b/src/generated/Models/Microsoft/Graph/AccessReviewScheduleSettings.cs index 13a8808154e..fd6f07df643 100644 --- a/src/generated/Models/Microsoft/Graph/AccessReviewScheduleSettings.cs +++ b/src/generated/Models/Microsoft/Graph/AccessReviewScheduleSettings.cs @@ -11,7 +11,7 @@ public class AccessReviewScheduleSettings : IParsable { public List ApplyActions { get; set; } /// Indicates whether decisions are automatically applied. When set to false, an admin must apply the decisions manually once the reviewer completes the access review. When set to true, decisions are applied automatically after the access review instance duration ends, whether or not the reviewers have responded. Default value is false. public bool? AutoApplyDecisionsEnabled { get; set; } - /// Decision chosen if defaultDecisionEnabled is true. Can be one of Approve, Deny, or Recommendation. + /// Decision chosen if defaultDecisionEnabled is enabled. Can be one of Approve, Deny, or Recommendation. public string DefaultDecision { get; set; } /// Indicates whether the default decision is enabled or disabled when reviewers do not respond. Default value is false. public bool? DefaultDecisionEnabled { get; set; } @@ -23,7 +23,7 @@ public class AccessReviewScheduleSettings : IParsable { public bool? MailNotificationsEnabled { get; set; } /// Indicates whether decision recommendations are enabled or disabled. public bool? RecommendationsEnabled { get; set; } - /// Detailed settings for recurrence using the standard Outlook recurrence object. Only weekly and absoluteMonthly on recurrencePattern are supported. Use the property startDate on recurrenceRange to determine the day the review starts. + /// Detailed settings for recurrence using the standard Outlook recurrence object. Note: Only dayOfMonth, interval, and type (weekly, absoluteMonthly) properties are supported. Use the property startDate on recurrenceRange to determine the day the review starts. public PatternedRecurrence Recurrence { get; set; } /// Indicates whether reminders are enabled or disabled. Default value is false. public bool? ReminderNotificationsEnabled { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AccessReviewSet.cs b/src/generated/Models/Microsoft/Graph/AccessReviewSet.cs index a6c10e819fc..3e23e78a802 100644 --- a/src/generated/Models/Microsoft/Graph/AccessReviewSet.cs +++ b/src/generated/Models/Microsoft/Graph/AccessReviewSet.cs @@ -5,6 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AccessReviewSet : Entity, IParsable { + /// Represents the template and scheduling for an access review. public List Definitions { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/ActivityType.cs b/src/generated/Models/Microsoft/Graph/ActivityType.cs new file mode 100644 index 00000000000..b80eaaed0ae --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/ActivityType.cs @@ -0,0 +1,7 @@ +namespace ApiSdk.Models.Microsoft.Graph { + public enum ActivityType { + Signin, + User, + UnknownFutureValue, + } +} diff --git a/src/generated/Models/Microsoft/Graph/AdminConsentRequestPolicy.cs b/src/generated/Models/Microsoft/Graph/AdminConsentRequestPolicy.cs index c856fe193d3..e93064620d2 100644 --- a/src/generated/Models/Microsoft/Graph/AdminConsentRequestPolicy.cs +++ b/src/generated/Models/Microsoft/Graph/AdminConsentRequestPolicy.cs @@ -13,7 +13,7 @@ public class AdminConsentRequestPolicy : Entity, IParsable { public bool? RemindersEnabled { get; set; } /// Specifies the duration the request is active before it automatically expires if no decision is applied. public int? RequestDurationInDays { get; set; } - /// The list of reviewers for the admin consent. Required. + /// Required. public List Reviewers { get; set; } /// Specifies the version of this policy. When the policy is updated, this version is updated. Read-only. public int? Version { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AdministrativeUnit.cs b/src/generated/Models/Microsoft/Graph/AdministrativeUnit.cs index 7361f2cdf0c..a90e3faadda 100644 --- a/src/generated/Models/Microsoft/Graph/AdministrativeUnit.cs +++ b/src/generated/Models/Microsoft/Graph/AdministrativeUnit.cs @@ -5,15 +5,15 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AdministrativeUnit : DirectoryObject, IParsable { - /// An optional description for the administrative unit. + /// An optional description for the administrative unit. Supports $filter (eq, ne, in, startsWith). public string Description { get; set; } - /// Display name for the administrative unit. + /// Display name for the administrative unit. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values), $search, and $orderBy. public string DisplayName { get; set; } - /// The collection of open extensions defined for this Administrative Unit. Nullable. + /// The collection of open extensions defined for this administrative unit. Nullable. public List Extensions { get; set; } - /// Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). + /// Users and groups that are members of this administrative unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members). public List Members { get; set; } - /// Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). + /// Scoped-role members of this administrative unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). public List ScopedRoleMembers { get; set; } /// Controls whether the administrative unit and its members are hidden or public. Can be set to HiddenMembership or Public. If not set, default behavior is Public. When set to HiddenMembership, only members of the administrative unit can list other members of the administrative unit. public string Visibility { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Agreement.cs b/src/generated/Models/Microsoft/Graph/Agreement.cs index 52ce303f77d..f63927fa606 100644 --- a/src/generated/Models/Microsoft/Graph/Agreement.cs +++ b/src/generated/Models/Microsoft/Graph/Agreement.cs @@ -11,9 +11,9 @@ public class Agreement : Entity, IParsable { public string DisplayName { get; set; } /// Default PDF linked to this agreement. public AgreementFile File { get; set; } - /// PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. + /// PDFs linked to this agreement. Note: This property is in the process of being deprecated. Use the file property instead. public List Files { get; set; } - /// Indicates whether end users are required to accept this agreement on every device that they access it from. The end user is required to register their device in Azure AD, if they haven't already done so. + /// This setting enables you to require end users to accept this agreement on every device that they are accessing it from. The end user will be required to register their device in Azure AD, if they haven't already done so. public bool? IsPerDeviceAcceptanceRequired { get; set; } /// Indicates whether the user has to expand the agreement before accepting. public bool? IsViewingBeforeAcceptanceRequired { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AgreementAcceptance.cs b/src/generated/Models/Microsoft/Graph/AgreementAcceptance.cs index 783db88a581..a8f4402e487 100644 --- a/src/generated/Models/Microsoft/Graph/AgreementAcceptance.cs +++ b/src/generated/Models/Microsoft/Graph/AgreementAcceptance.cs @@ -5,29 +5,29 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AgreementAcceptance : Entity, IParsable { - /// The identifier of the agreement file accepted by the user. + /// ID of the agreement file accepted by the user. public string AgreementFileId { get; set; } - /// The identifier of the agreement. + /// ID of the agreement. public string AgreementId { get; set; } /// The display name of the device used for accepting the agreement. public string DeviceDisplayName { get; set; } /// The unique identifier of the device used for accepting the agreement. public string DeviceId { get; set; } - /// The operating system used to accept the agreement. + /// The operating system used for accepting the agreement. public string DeviceOSType { get; set; } - /// The operating system version of the device used to accept the agreement. + /// The operating system version of the device used for accepting the agreement. public string DeviceOSVersion { get; set; } - /// The expiration date time of the acceptance. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. + /// The expiration date time of the acceptance. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z public DateTimeOffset? ExpirationDateTime { get; set; } - /// The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. + /// The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z public DateTimeOffset? RecordedDateTime { get; set; } - /// The state of the agreement acceptance. Possible values are: accepted, declined. + /// Possible values are: accepted, declined. public AgreementAcceptanceState? State { get; set; } /// Display name of the user when the acceptance was recorded. public string UserDisplayName { get; set; } /// Email of the user when the acceptance was recorded. public string UserEmail { get; set; } - /// The identifier of the user who accepted the agreement. + /// ID of the user who accepted the agreement. public string UserId { get; set; } /// UPN of the user when the acceptance was recorded. public string UserPrincipalName { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AgreementFile.cs b/src/generated/Models/Microsoft/Graph/AgreementFile.cs index 6167233522d..f11a61d14db 100644 --- a/src/generated/Models/Microsoft/Graph/AgreementFile.cs +++ b/src/generated/Models/Microsoft/Graph/AgreementFile.cs @@ -5,6 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AgreementFile : AgreementFileProperties, IParsable { + /// The localized version of the terms of use agreement files attached to the agreement. public List Localizations { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/AgreementFileLocalization.cs b/src/generated/Models/Microsoft/Graph/AgreementFileLocalization.cs index 62a7233d50f..8553633f951 100644 --- a/src/generated/Models/Microsoft/Graph/AgreementFileLocalization.cs +++ b/src/generated/Models/Microsoft/Graph/AgreementFileLocalization.cs @@ -5,6 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AgreementFileLocalization : AgreementFileProperties, IParsable { + /// Read-only. Customized versions of the terms of use agreement in the Azure AD tenant. public List Versions { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/AgreementFileProperties.cs b/src/generated/Models/Microsoft/Graph/AgreementFileProperties.cs index 785e16ae972..76f846ca57d 100644 --- a/src/generated/Models/Microsoft/Graph/AgreementFileProperties.cs +++ b/src/generated/Models/Microsoft/Graph/AgreementFileProperties.cs @@ -5,12 +5,19 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AgreementFileProperties : Entity, IParsable { + /// The date time representing when the file was created.The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. public DateTimeOffset? CreatedDateTime { get; set; } + /// Localized display name of the policy file of an agreement. The localized display name is shown to end users who view the agreement. public string DisplayName { get; set; } + /// Data that represents the terms of use PDF document. Read-only. public AgreementFileData FileData { get; set; } + /// Name of the agreement file (for example, TOU.pdf). Read-only. public string FileName { get; set; } + /// If none of the languages matches the client preference, indicates whether this is the default agreement file . If none of the files are marked as default, the first one is treated as the default. Read-only. public bool? IsDefault { get; set; } + /// Indicates whether the agreement file is a major version update. Major version updates invalidate the agreement's acceptances on the corresponding language. public bool? IsMajorVersion { get; set; } + /// The language of the agreement file in the format 'languagecode2-country/regioncode2'. 'languagecode2' is a lowercase two-letter code derived from ISO 639-1, while 'country/regioncode2' is derived from ISO 3166 and usually consists of two uppercase letters, or a BCP-47 language tag. For example, U.S. English is en-US. Read-only. public string Language { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/AndroidManagedAppProtection.cs b/src/generated/Models/Microsoft/Graph/AndroidManagedAppProtection.cs index 6291e1f1499..e1c81fc722f 100644 --- a/src/generated/Models/Microsoft/Graph/AndroidManagedAppProtection.cs +++ b/src/generated/Models/Microsoft/Graph/AndroidManagedAppProtection.cs @@ -7,9 +7,9 @@ namespace ApiSdk.Models.Microsoft.Graph { public class AndroidManagedAppProtection : TargetedManagedAppProtection, IParsable { /// List of apps to which the policy is deployed. public List Apps { get; set; } - /// Friendly name of the preferred custom browser to open weblink on Android. When this property is configured, ManagedBrowserToOpenLinksRequired should be true. + /// Friendly name of the preferred custom browser to open weblink on Android. public string CustomBrowserDisplayName { get; set; } - /// Unique identifier of the preferred custom browser to open weblink on Android. When this property is configured, ManagedBrowserToOpenLinksRequired should be true. + /// Unique identifier of a custom browser to open weblink on Android. public string CustomBrowserPackageId { get; set; } /// Count of apps to which the current policy is deployed. public int? DeployedAppCount { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AnswerInputType.cs b/src/generated/Models/Microsoft/Graph/AnswerInputType.cs new file mode 100644 index 00000000000..3af573dad72 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/AnswerInputType.cs @@ -0,0 +1,7 @@ +namespace ApiSdk.Models.Microsoft.Graph { + public enum AnswerInputType { + Text, + RadioButton, + UnknownFutureValue, + } +} diff --git a/src/generated/Models/Microsoft/Graph/AppConsentApprovalRoute.cs b/src/generated/Models/Microsoft/Graph/AppConsentApprovalRoute.cs index 08afcfb1f4b..1f410e57f7d 100644 --- a/src/generated/Models/Microsoft/Graph/AppConsentApprovalRoute.cs +++ b/src/generated/Models/Microsoft/Graph/AppConsentApprovalRoute.cs @@ -5,6 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AppConsentApprovalRoute : Entity, IParsable { + /// A collection of userConsentRequest objects for a specific application. public List AppConsentRequests { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/AppConsentRequest.cs b/src/generated/Models/Microsoft/Graph/AppConsentRequest.cs index ed2f7a66442..aa8d2dcf628 100644 --- a/src/generated/Models/Microsoft/Graph/AppConsentRequest.cs +++ b/src/generated/Models/Microsoft/Graph/AppConsentRequest.cs @@ -9,7 +9,7 @@ public class AppConsentRequest : Entity, IParsable { public string AppDisplayName { get; set; } /// The identifier of the application. Required. Supports $filter (eq only) and $orderby. public string AppId { get; set; } - /// A list of pending scopes waiting for approval. Required. + /// A list of pending scopes waiting for approval. This is empty if the consentType is Static. Required. public List PendingScopes { get; set; } /// A list of pending user consent requests. public List UserConsentRequests { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AppScope.cs b/src/generated/Models/Microsoft/Graph/AppScope.cs index 91b0cafd658..7d1ddb5c54f 100644 --- a/src/generated/Models/Microsoft/Graph/AppScope.cs +++ b/src/generated/Models/Microsoft/Graph/AppScope.cs @@ -5,9 +5,9 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AppScope : Entity, IParsable { - /// Provides the display name of the app-specific resource represented by the app scope. Provided for display purposes since appScopeId is often an immutable, non-human-readable id. Read-only. + /// Provides the display name of the app-specific resource represented by the app scope. Provided for display purposes since appScopeId is often an immutable, non-human-readable id. This property is read only. public string DisplayName { get; set; } - /// Describes the type of app-specific resource represented by the app scope. Provided for display purposes, so a user interface can convey to the user the kind of app specific resource represented by the app scope. Read-only. + /// Describes the type of app-specific resource represented by the app scope. Provided for display purposes, so a user interface can convey to the user the kind of app specific resource represented by the app scope. This property is read only. public string Type { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/Application.cs b/src/generated/Models/Microsoft/Graph/Application.cs index 9a4fd501df7..6f703535de7 100644 --- a/src/generated/Models/Microsoft/Graph/Application.cs +++ b/src/generated/Models/Microsoft/Graph/Application.cs @@ -9,9 +9,9 @@ public class Application : DirectoryObject, IParsable { public List AddIns { get; set; } /// Specifies settings for an application that implements a web API. public ApiApplication Api { get; set; } - /// The unique identifier for the application that is assigned to an application by Azure AD. Not nullable. Read-only. + /// The unique identifier for the application that is assigned by Azure AD. Not nullable. Read-only. public string AppId { get; set; } - /// Unique identifier of the applicationTemplate. + /// Unique identifier of the applicationTemplate. Supports $filter (eq, not, ne). public string ApplicationTemplateId { get; set; } /// The collection of roles assigned to the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable. public List AppRoles { get; set; } @@ -19,7 +19,7 @@ public class Application : DirectoryObject, IParsable { public DateTimeOffset? CreatedDateTime { get; set; } /// Read-only. public DirectoryObject CreatedOnBehalfOf { get; set; } - /// An optional description of the application. Supports $filter (eq, ne, not, ge, le, startsWith) and $search. + /// Free text field to provide a description of the application object to end users. The maximum allowed size is 1024 characters. Returned by default. Supports $filter (eq, ne, not, ge, le, startsWith) and $search. public string Description { get; set; } /// Specifies whether Microsoft has disabled the registered application. Possible values are: null (default value), NotDisabled, and DisabledDueToViolationOfServicesAgreement (reasons may include suspicious, abusive, or malicious activity, or a violation of the Microsoft Services Agreement). Supports $filter (eq, ne, not). public string DisabledByMicrosoftStatus { get; set; } @@ -27,16 +27,16 @@ public class Application : DirectoryObject, IParsable { public string DisplayName { get; set; } /// Read-only. Nullable. public List ExtensionProperties { get; set; } - /// Configures the groups claim issued in a user or OAuth 2.0 access token that the application expects. To set this attribute, use one of the following valid string values: None, SecurityGroup (for security groups and Azure AD roles), All (this gets all of the security groups, distribution groups, and Azure AD directory roles that the signed-in user is a member of). + /// Configures the groups claim issued in a user or OAuth 2.0 access token that the application expects. To set this attribute, use one of the following string values: None, SecurityGroup (for security groups and Azure AD roles), All (this gets all security groups, distribution groups, and Azure AD directory roles that the signed-in user is a member of). public string GroupMembershipClaims { get; set; } public List HomeRealmDiscoveryPolicies { get; set; } /// Also known as App ID URI, this value is set when an application is used as a resource app. The identifierUris acts as the prefix for the scopes you'll reference in your API's code, and it must be globally unique. You can use the default value provided, which is in the form api://, or specify a more readable URI like https://contoso.com/api. For more information on valid identifierUris patterns and best practices, see Azure AD application registration security best practices. Not nullable. Supports $filter (eq, ne, ge, le, startsWith). public List IdentifierUris { get; set; } - /// Basic profile information of the application such as app's marketing, support, terms of service and privacy statement URLs. The terms of service and privacy statement are surfaced to users through the user consent experience. For more info, see How to: Add Terms of service and privacy statement for registered Azure AD apps. Supports $filter (eq, ne, not, ge, le, and eq on null values). + /// Basic profile information of the application, such as it's marketing, support, terms of service, and privacy statement URLs. The terms of service and privacy statement are surfaced to users through the user consent experience. For more information, see How to: Add Terms of service and privacy statement for registered Azure AD apps. Supports $filter (eq, ne, not, ge, le, and eq on null values). public InformationalUrl Info { get; set; } /// Specifies whether this application supports device authentication without a user. The default is false. public bool? IsDeviceOnlyAuthSupported { get; set; } - /// Specifies the fallback application type as public client, such as an installed application running on a mobile device. The default value is false which means the fallback application type is confidential client such as a web app. There are certain scenarios where Azure AD cannot determine the client application type. For example, the ROPC flow where it is configured without specifying a redirect URI. In those cases Azure AD interprets the application type based on the value of this property. + /// Specifies the fallback application type as public client, such as an installed application running on a mobile device. The default value is false which means the fallback application type is confidential client such as a web app. There are certain scenarios where Azure AD cannot determine the client application type. For example, the ROPC flow where the application is configured without specifying a redirect URI. In those cases Azure AD interprets the application type based on the value of this property. public bool? IsFallbackPublicClient { get; set; } /// The collection of key credentials associated with the application. Not nullable. Supports $filter (eq, not, ge, le). public List KeyCredentials { get; set; } @@ -55,7 +55,7 @@ public class Application : DirectoryObject, IParsable { public List PasswordCredentials { get; set; } /// Specifies settings for installed clients such as desktop or mobile devices. public PublicClientApplication PublicClient { get; set; } - /// The verified publisher domain for the application. Read-only. For more information, see How to: Configure an application's publisher domain. Supports $filter (eq, ne, ge, le, startsWith). + /// The verified publisher domain for the application. Read-only. Supports $filter (eq, ne, ge, le, startsWith). public string PublisherDomain { get; set; } /// Specifies the resources that the application needs to access. This property also specifies the set of delegated permissions and application roles that it needs for each of those resources. This configuration of access to the required resources drives the consent experience. No more than 50 resource services (APIs) can be configured. Beginning mid-October 2021, the total number of required permissions must not exceed 400. Not nullable. Supports $filter (eq, not, ge, le). public List RequiredResourceAccess { get; set; } @@ -63,14 +63,14 @@ public class Application : DirectoryObject, IParsable { public string SignInAudience { get; set; } /// Specifies settings for a single-page application, including sign out URLs and redirect URIs for authorization codes and access tokens. public SpaApplication Spa { get; set; } - /// Custom strings that can be used to categorize and identify the application. Not nullable. Supports $filter (eq, not, ge, le, startsWith). + /// Custom strings that can be used to categorize and identify the application. Not nullable.Supports $filter (eq, not, ge, le, startsWith). public List Tags { get; set; } /// Specifies the keyId of a public key from the keyCredentials collection. When configured, Azure AD encrypts all the tokens it emits by using the key this property points to. The application code that receives the encrypted token must use the matching private key to decrypt the token before it can be used for the signed-in user. public string TokenEncryptionKeyId { get; set; } public List TokenIssuancePolicies { get; set; } /// The tokenLifetimePolicies assigned to this application. Supports $expand. public List TokenLifetimePolicies { get; set; } - /// Specifies the verified publisher of the application. + /// Specifies the verified publisher of the application. For more information about how publisher verification helps support application security, trustworthiness, and compliance, see Publisher verification. public VerifiedPublisher VerifiedPublisher { get; set; } /// Specifies settings for a web application. public WebApplication Web { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AppliedConditionalAccessPolicy.cs b/src/generated/Models/Microsoft/Graph/AppliedConditionalAccessPolicy.cs index 5d6cad03dc3..eed2bae466a 100644 --- a/src/generated/Models/Microsoft/Graph/AppliedConditionalAccessPolicy.cs +++ b/src/generated/Models/Microsoft/Graph/AppliedConditionalAccessPolicy.cs @@ -7,15 +7,15 @@ namespace ApiSdk.Models.Microsoft.Graph { public class AppliedConditionalAccessPolicy : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Refers to the Name of the conditional access policy (example: 'Require MFA for Salesforce'). + /// Name of the conditional access policy. public string DisplayName { get; set; } /// Refers to the grant controls enforced by the conditional access policy (example: 'Require multi-factor authentication'). public List EnforcedGrantControls { get; set; } /// Refers to the session controls enforced by the conditional access policy (example: 'Require app enforced controls'). public List EnforcedSessionControls { get; set; } - /// An identifier of the conditional access policy. + /// Identifier of the conditional access policy. public string Id { get; set; } - /// Indicates the result of the CA policy that was triggered. Possible values are: success, failure, notApplied (Policy isn't applied because policy conditions were not met),notEnabled (This is due to the policy in disabled state), unknown, unknownFutureValue. + /// Indicates the result of the CA policy that was triggered. Possible values are: success, failure, notApplied (Policy isn't applied because policy conditions were not met),notEnabled (This is due to the policy in disabled state), unknown, unknownFutureValue, reportOnlySuccess, reportOnlyFailure, reportOnlyNotApplied, reportOnlyInterrupted. Note that you must use the Prefer: include-unknown-enum-members request header to get the following values in this evolvable enum: reportOnlySuccess, reportOnlyFailure, reportOnlyNotApplied, reportOnlyInterrupted. public AppliedConditionalAccessPolicyResult? Result { get; set; } /// /// Instantiates a new appliedConditionalAccessPolicy and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/Approval.cs b/src/generated/Models/Microsoft/Graph/Approval.cs index 85d768b180c..d47036c6fe8 100644 --- a/src/generated/Models/Microsoft/Graph/Approval.cs +++ b/src/generated/Models/Microsoft/Graph/Approval.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class Approval : Entity, IParsable { - /// A collection of stages in the approval decision. + /// Used for the approvalStages property of approval settings in the requestApprovalSettings property of an access package assignment policy. Specifies the primary, fallback, and escalation approvers of each stage. public List Stages { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/AssignedPlan.cs b/src/generated/Models/Microsoft/Graph/AssignedPlan.cs index d6b68a92b7f..a7d199e9480 100644 --- a/src/generated/Models/Microsoft/Graph/AssignedPlan.cs +++ b/src/generated/Models/Microsoft/Graph/AssignedPlan.cs @@ -7,9 +7,9 @@ namespace ApiSdk.Models.Microsoft.Graph { public class AssignedPlan : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The date and time at which the plan was assigned. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. + /// The date and time at which the plan was assigned; for example: 2013-01-02T19:32:30Z. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z public DateTimeOffset? AssignedDateTime { get; set; } - /// Condition of the capability assignment. The possible values are Enabled, Warning, Suspended, Deleted, LockedOut. See a detailed description of each value. + /// Condition of the capability assignment. The possible values are Enabled, Warning, Suspended, Deleted, LockedOut. public string CapabilityStatus { get; set; } /// The name of the service; for example, 'Exchange'. public string Service { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AssignmentOrder.cs b/src/generated/Models/Microsoft/Graph/AssignmentOrder.cs index 444e2b742c5..d5dd3bec31f 100644 --- a/src/generated/Models/Microsoft/Graph/AssignmentOrder.cs +++ b/src/generated/Models/Microsoft/Graph/AssignmentOrder.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class AssignmentOrder : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// A list of identityUserFlowAttribute object identifiers that determine the order in which attributes should be collected within a user flow. + /// A list of identityUserFlowAttribute IDs provided to determine the order in which attributes should be collected within a user flow. public List Order { get; set; } /// /// Instantiates a new assignmentOrder and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/Attachment.cs b/src/generated/Models/Microsoft/Graph/Attachment.cs index bac5e46e97a..a627c5393d5 100644 --- a/src/generated/Models/Microsoft/Graph/Attachment.cs +++ b/src/generated/Models/Microsoft/Graph/Attachment.cs @@ -11,7 +11,7 @@ public class Attachment : Entity, IParsable { public bool? IsInline { get; set; } /// The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z public DateTimeOffset? LastModifiedDateTime { get; set; } - /// The attachment's file name. + /// The display name of the attachment. This does not need to be the actual file name. public string Name { get; set; } /// The length of the attachment in bytes. public int? Size { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AttachmentItem.cs b/src/generated/Models/Microsoft/Graph/AttachmentItem.cs index 3664d12579a..8e9fa9e0fff 100644 --- a/src/generated/Models/Microsoft/Graph/AttachmentItem.cs +++ b/src/generated/Models/Microsoft/Graph/AttachmentItem.cs @@ -9,6 +9,8 @@ public class AttachmentItem : IParsable { public IDictionary AdditionalData { get; set; } /// The type of attachment. Possible values are: file, item, reference. Required. public AttachmentType? AttachmentType { get; set; } + /// The CID or Content-Id of the attachment for referencing in case of in-line attachments using tag in HTML messages. Optional. + public string ContentId { get; set; } /// The nature of the data in the attachment. Optional. public string ContentType { get; set; } /// true if the attachment is an inline attachment; otherwise, false. Optional. @@ -29,6 +31,7 @@ public AttachmentItem() { public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"attachmentType", (o,n) => { (o as AttachmentItem).AttachmentType = n.GetEnumValue(); } }, + {"contentId", (o,n) => { (o as AttachmentItem).ContentId = n.GetStringValue(); } }, {"contentType", (o,n) => { (o as AttachmentItem).ContentType = n.GetStringValue(); } }, {"isInline", (o,n) => { (o as AttachmentItem).IsInline = n.GetBoolValue(); } }, {"name", (o,n) => { (o as AttachmentItem).Name = n.GetStringValue(); } }, @@ -42,6 +45,7 @@ public IDictionary> GetFieldDeserializers() { public void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteEnumValue("attachmentType", AttachmentType); + writer.WriteStringValue("contentId", ContentId); writer.WriteStringValue("contentType", ContentType); writer.WriteBoolValue("isInline", IsInline); writer.WriteStringValue("name", Name); diff --git a/src/generated/Models/Microsoft/Graph/AttendanceInterval.cs b/src/generated/Models/Microsoft/Graph/AttendanceInterval.cs new file mode 100644 index 00000000000..a2d9fcd4ee7 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/AttendanceInterval.cs @@ -0,0 +1,44 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class AttendanceInterval : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Duration of the meeting interval in seconds; that is, the difference between joinDateTime and leaveDateTime. + public int? DurationInSeconds { get; set; } + /// The time the attendee joined in UTC. + public DateTimeOffset? JoinDateTime { get; set; } + /// The time the attendee left in UTC. + public DateTimeOffset? LeaveDateTime { get; set; } + /// + /// Instantiates a new attendanceInterval and sets the default values. + /// + public AttendanceInterval() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"durationInSeconds", (o,n) => { (o as AttendanceInterval).DurationInSeconds = n.GetIntValue(); } }, + {"joinDateTime", (o,n) => { (o as AttendanceInterval).JoinDateTime = n.GetDateTimeOffsetValue(); } }, + {"leaveDateTime", (o,n) => { (o as AttendanceInterval).LeaveDateTime = n.GetDateTimeOffsetValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("durationInSeconds", DurationInSeconds); + writer.WriteDateTimeOffsetValue("joinDateTime", JoinDateTime); + writer.WriteDateTimeOffsetValue("leaveDateTime", LeaveDateTime); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/AttendanceRecord.cs b/src/generated/Models/Microsoft/Graph/AttendanceRecord.cs new file mode 100644 index 00000000000..020076ffda5 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/AttendanceRecord.cs @@ -0,0 +1,44 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class AttendanceRecord : Entity, IParsable { + /// List of time periods between joining and leaving a meeting. + public List AttendanceIntervals { get; set; } + /// Email address of the user associated with this atttendance record. + public string EmailAddress { get; set; } + /// Identity of the user associated with this atttendance record. + public ApiSdk.Models.Microsoft.Graph.Identity Identity { get; set; } + /// Role of the attendee. Possible values are: None, Attendee, Presenter, and Organizer. + public string Role { get; set; } + /// Total duration of the attendances in seconds. + public int? TotalAttendanceInSeconds { get; set; } + /// + /// The deserialization information for the current model + /// + public new IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + {"attendanceIntervals", (o,n) => { (o as AttendanceRecord).AttendanceIntervals = n.GetCollectionOfObjectValues().ToList(); } }, + {"emailAddress", (o,n) => { (o as AttendanceRecord).EmailAddress = n.GetStringValue(); } }, + {"identity", (o,n) => { (o as AttendanceRecord).Identity = n.GetObjectValue(); } }, + {"role", (o,n) => { (o as AttendanceRecord).Role = n.GetStringValue(); } }, + {"totalAttendanceInSeconds", (o,n) => { (o as AttendanceRecord).TotalAttendanceInSeconds = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public new void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("attendanceIntervals", AttendanceIntervals); + writer.WriteStringValue("emailAddress", EmailAddress); + writer.WriteObjectValue("identity", Identity); + writer.WriteStringValue("role", Role); + writer.WriteIntValue("totalAttendanceInSeconds", TotalAttendanceInSeconds); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/AttendeeAvailability.cs b/src/generated/Models/Microsoft/Graph/AttendeeAvailability.cs index dc3e3a5c3e4..78bf3831530 100644 --- a/src/generated/Models/Microsoft/Graph/AttendeeAvailability.cs +++ b/src/generated/Models/Microsoft/Graph/AttendeeAvailability.cs @@ -9,7 +9,7 @@ public class AttendeeAvailability : IParsable { public IDictionary AdditionalData { get; set; } /// The email address and type of attendee - whether it's a person or a resource, and whether required or optional if it's a person. public AttendeeBase Attendee { get; set; } - /// The availability status of the attendee. The possible values are: free, tentative, busy, oof, workingElsewhere, unknown. + /// The availability status of the attendee. Possible values are: free, tentative, busy, oof, workingElsewhere, unknown. public FreeBusyStatus? Availability { get; set; } /// /// Instantiates a new attendeeAvailability and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/AttendeeBase.cs b/src/generated/Models/Microsoft/Graph/AttendeeBase.cs index cdec37026ce..d7c461a2085 100644 --- a/src/generated/Models/Microsoft/Graph/AttendeeBase.cs +++ b/src/generated/Models/Microsoft/Graph/AttendeeBase.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AttendeeBase : Recipient, IParsable { - /// The type of attendee. The possible values are: required, optional, resource. Currently if the attendee is a person, findMeetingTimes always considers the person is of the Required type. + /// The type of attendee. Possible values are: required, optional, resource. Currently if the attendee is a person, findMeetingTimes always considers the person is of the Required type. public AttendeeType? Type { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/AuditActivityInitiator.cs b/src/generated/Models/Microsoft/Graph/AuditActivityInitiator.cs index eddcebf5cbc..f4581cbaea9 100644 --- a/src/generated/Models/Microsoft/Graph/AuditActivityInitiator.cs +++ b/src/generated/Models/Microsoft/Graph/AuditActivityInitiator.cs @@ -7,9 +7,9 @@ namespace ApiSdk.Models.Microsoft.Graph { public class AuditActivityInitiator : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// If the resource initiating the activity is an app, this property indicates all the app related information like appId, Name, servicePrincipalId, Name. + /// If the actor initiating the activity is an app, this property indicates all its identification information including appId, displayName, servicePrincipalId, and servicePrincipalName. public AppIdentity App { get; set; } - /// If the resource initiating the activity is a user, this property Indicates all the user related information like userId, Name, UserPrinicpalName. + /// If the actor initiating the activity is a user, this property indicates their identification information including their id, displayName, and userPrincipalName. public UserIdentity User { get; set; } /// /// Instantiates a new auditActivityInitiator and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/AuthenticationFlowsPolicy.cs b/src/generated/Models/Microsoft/Graph/AuthenticationFlowsPolicy.cs index 052a12202eb..22b9edd224e 100644 --- a/src/generated/Models/Microsoft/Graph/AuthenticationFlowsPolicy.cs +++ b/src/generated/Models/Microsoft/Graph/AuthenticationFlowsPolicy.cs @@ -5,11 +5,11 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class AuthenticationFlowsPolicy : Entity, IParsable { - /// Inherited property. A description of the policy. Optional. Read-only. + /// Inherited property. A description of the policy. This property is not a key. Optional. Read-only. public string Description { get; set; } - /// Inherited property. The human-readable name of the policy. Optional. Read-only. + /// Inherited property. The human-readable name of the policy. This property is not a key. Optional. Read-only. public string DisplayName { get; set; } - /// Contains selfServiceSignUpAuthenticationFlowConfiguration settings that convey whether self-service sign-up is enabled or disabled. Optional. Read-only. + /// Contains selfServiceSignUpAuthenticationFlowConfiguration settings that convey whether self-service sign-up is enabled or disabled. This property is not a key. Optional. Read-only. public SelfServiceSignUpAuthenticationFlowConfiguration SelfServiceSignUp { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/AuthenticationMethodsPolicy.cs b/src/generated/Models/Microsoft/Graph/AuthenticationMethodsPolicy.cs index 7f6d4692650..72a214c5257 100644 --- a/src/generated/Models/Microsoft/Graph/AuthenticationMethodsPolicy.cs +++ b/src/generated/Models/Microsoft/Graph/AuthenticationMethodsPolicy.cs @@ -7,13 +7,13 @@ namespace ApiSdk.Models.Microsoft.Graph { public class AuthenticationMethodsPolicy : Entity, IParsable { /// Represents the settings for each authentication method. public List AuthenticationMethodConfigurations { get; set; } - /// A description of the policy. Read-only. + /// A description of the policy. public string Description { get; set; } - /// The name of the policy. Read-only. + /// The name of the policy. public string DisplayName { get; set; } - /// The date and time of the last update to the policy. Read-only. + /// The date and time of the last update to the policy. public DateTimeOffset? LastModifiedDateTime { get; set; } - /// The version of the policy in use. Read-only. + /// The version of the policy in use. public string PolicyVersion { get; set; } public int? ReconfirmationInDays { get; set; } /// Enforce registration at sign-in time. This property can be used to remind users to set up targeted authentication methods. diff --git a/src/generated/Models/Microsoft/Graph/AuthenticationMethodsRegistrationCampaign.cs b/src/generated/Models/Microsoft/Graph/AuthenticationMethodsRegistrationCampaign.cs index 1b2d51ea835..14f70286d31 100644 --- a/src/generated/Models/Microsoft/Graph/AuthenticationMethodsRegistrationCampaign.cs +++ b/src/generated/Models/Microsoft/Graph/AuthenticationMethodsRegistrationCampaign.cs @@ -11,9 +11,9 @@ public class AuthenticationMethodsRegistrationCampaign : IParsable { public List ExcludeTargets { get; set; } /// Users and groups of users that are prompted to set up the authentication method. public List IncludeTargets { get; set; } - /// Specifies the number of days that the user sees a prompt again if they select 'Not now' and snoozes the prompt. Minimum: 0 days. Maximum: 14 days. If the value is '0', the user is prompted during every MFA attempt. + /// Specifies the number of days that the user sees a prompt again if they select 'Not now' and snoozes the prompt. Minimum 0 days. Maximum: 14 days. If the value is '0' – The user is prompted during every MFA attempt. public int? SnoozeDurationInDays { get; set; } - /// Enable or disable the feature. Possible values are: default, enabled, disabled, unknownFutureValue. The default value is used when the configuration hasn't been explicitly set and uses the default behavior of Azure Active Directory for the setting. The default value is disabled. + /// Enable or disable the feature. Possible values are: default, enabled, disabled, unknownFutureValue. The default value is used when the configuration hasn't been explicitly set and uses the default behavior of Azure AD for the setting. The default value is disabled. public AdvancedConfigState? State { get; set; } /// /// Instantiates a new authenticationMethodsRegistrationCampaign and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/AuthenticationMethodsRegistrationCampaignIncludeTarget.cs b/src/generated/Models/Microsoft/Graph/AuthenticationMethodsRegistrationCampaignIncludeTarget.cs index fb52cfec5fd..a31a705fb49 100644 --- a/src/generated/Models/Microsoft/Graph/AuthenticationMethodsRegistrationCampaignIncludeTarget.cs +++ b/src/generated/Models/Microsoft/Graph/AuthenticationMethodsRegistrationCampaignIncludeTarget.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class AuthenticationMethodsRegistrationCampaignIncludeTarget : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The object identifier of an Azure Active Directory user or group. + /// The object identifier of an Azure AD user or group. public string Id { get; set; } /// The authentication method that the user is prompted to register. The value must be microsoftAuthenticator. public string TargetedAuthenticationMethod { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/AuthorizationPolicy.cs b/src/generated/Models/Microsoft/Graph/AuthorizationPolicy.cs index e4d2eaf93ad..1509c86cbcf 100644 --- a/src/generated/Models/Microsoft/Graph/AuthorizationPolicy.cs +++ b/src/generated/Models/Microsoft/Graph/AuthorizationPolicy.cs @@ -16,7 +16,7 @@ public class AuthorizationPolicy : PolicyBase, IParsable { /// To disable the use of MSOL PowerShell set this property to true. This will also disable user-based access to the legacy service endpoint used by MSOL PowerShell. This does not affect Azure AD Connect or Microsoft Graph. public bool? BlockMsolPowerShell { get; set; } public DefaultUserRolePermissions DefaultUserRolePermissions { get; set; } - /// Represents role templateId for the role that should be granted to guest user. Currently following roles are supported: User (a0b1b346-4d3e-4e8b-98f8-753987be4970), Guest User (10dae51f-b6af-4016-8d66-8c2a99b929b3), and Restricted Guest User (2af84b1e-32c8-42b7-82bc-daa82404023b). + /// Represents role templateId for the role that should be granted to guest user. Refer to List unifiedRoleDefinitions to find the list of available role templates. Currently following roles are supported: User (a0b1b346-4d3e-4e8b-98f8-753987be4970), Guest User (10dae51f-b6af-4016-8d66-8c2a99b929b3), and Restricted Guest User (2af84b1e-32c8-42b7-82bc-daa82404023b). public string GuestUserRoleId { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/AutomaticRepliesSetting.cs b/src/generated/Models/Microsoft/Graph/AutomaticRepliesSetting.cs index 74c937f9bf6..93b54affa9d 100644 --- a/src/generated/Models/Microsoft/Graph/AutomaticRepliesSetting.cs +++ b/src/generated/Models/Microsoft/Graph/AutomaticRepliesSetting.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class AutomaticRepliesSetting : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The set of audience external to the signed-in user's organization who will receive the ExternalReplyMessage, if Status is AlwaysEnabled or Scheduled. The possible values are: none, contactsOnly, all. + /// The set of audience external to the signed-in user's organization who will receive the ExternalReplyMessage, if Status is AlwaysEnabled or Scheduled. Possible values are: none, contactsOnly, all. public ExternalAudienceScope? ExternalAudience { get; set; } /// The automatic reply to send to the specified external audience, if Status is AlwaysEnabled or Scheduled. public string ExternalReplyMessage { get; set; } @@ -17,7 +17,7 @@ public class AutomaticRepliesSetting : IParsable { public DateTimeTimeZone ScheduledEndDateTime { get; set; } /// The date and time that automatic replies are set to begin, if Status is set to Scheduled. public DateTimeTimeZone ScheduledStartDateTime { get; set; } - /// Configurations status for automatic replies. The possible values are: disabled, alwaysEnabled, scheduled. + /// Configurations status for automatic replies. Possible values are: disabled, alwaysEnabled, scheduled. public AutomaticRepliesStatus? Status { get; set; } /// /// Instantiates a new automaticRepliesSetting and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/B2xIdentityUserFlow.cs b/src/generated/Models/Microsoft/Graph/B2xIdentityUserFlow.cs index 6dc350a53ac..ef43b28d978 100644 --- a/src/generated/Models/Microsoft/Graph/B2xIdentityUserFlow.cs +++ b/src/generated/Models/Microsoft/Graph/B2xIdentityUserFlow.cs @@ -5,11 +5,11 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class B2xIdentityUserFlow : IdentityUserFlow, IParsable { - /// Configuration for enabling an API connector for use as part of the self-service sign-up user flow. You can only obtain the value of this object using Get userFlowApiConnectorConfiguration. + /// Configuration for enabling an API connector for use as part of the self-service sign up user flow. You can only obtain the value of this object using Get userFlowApiConnectorConfiguration. public UserFlowApiConnectorConfiguration ApiConnectorConfiguration { get; set; } /// The identity providers included in the user flow. public List IdentityProviders { get; set; } - /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign-up user flow. You cannot create custom languages in self-service sign-up user flows. + /// The languages supported for customization within the user flow. Language customization is enabled by default in self-service sign up user flow. You cannot create custom languages in self-service sign up user flows. public List Languages { get; set; } /// The user attribute assignments included in the user flow. public List UserAttributeAssignments { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/BitlockerRecoveryKey.cs b/src/generated/Models/Microsoft/Graph/BitlockerRecoveryKey.cs index f47fdbc935d..50e4125d5d2 100644 --- a/src/generated/Models/Microsoft/Graph/BitlockerRecoveryKey.cs +++ b/src/generated/Models/Microsoft/Graph/BitlockerRecoveryKey.cs @@ -5,13 +5,13 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class BitlockerRecoveryKey : Entity, IParsable { - /// The date and time when the key was originally backed up to Azure Active Directory. Not nullable. + /// The date and time when the key was originally backed up to Azure Active Directory. public DateTimeOffset? CreatedDateTime { get; set; } - /// Identifier of the device the BitLocker key is originally backed up from. Supports $filter (eq). + /// ID of the device the BitLocker key is originally backed up from. public string DeviceId { get; set; } - /// The BitLocker recovery key. Returned only on $select. Not nullable. + /// The BitLocker recovery key. public string Key { get; set; } - /// Indicates the type of volume the BitLocker key is associated with. The possible values are: 1 (for operatingSystemVolume), 2 (for fixedDataVolume), 3 (for removableDataVolume), and 4 (for unknownFutureValue). + /// Indicates the type of volume the BitLocker key is associated with. Possible values are: operatingSystemVolume, fixedDataVolume, removableDataVolume, unknownFutureValue. public VolumeType? VolumeType { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/BookingAppointment.cs b/src/generated/Models/Microsoft/Graph/BookingAppointment.cs new file mode 100644 index 00000000000..bdb9e5a069e --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingAppointment.cs @@ -0,0 +1,114 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class BookingAppointment : Entity, IParsable { + /// Additional information that is sent to the customer when an appointment is confirmed. + public string AdditionalInformation { get; set; } + /// It lists down the customer properties for an appointment. An appointment will contain a list of customer information and each unit will indicate the properties of a customer who is part of that appointment. Optional. + public List Customers { get; set; } + /// The time zone of the customer. For a list of possible values, see dateTimeTimeZone. + public string CustomerTimeZone { get; set; } + /// The length of the appointment, denoted in ISO8601 format. + public string Duration { get; set; } + public DateTimeTimeZone EndDateTime { get; set; } + /// The current number of customers in the appointment. + public int? FilledAttendeesCount { get; set; } + /// True indicates that the appointment will be held online. Default value is false. + public bool? IsLocationOnline { get; set; } + /// The URL of the online meeting for the appointment. + public string JoinWebUrl { get; set; } + /// The maximum number of customers allowed in an appointment. + public int? MaximumAttendeesCount { get; set; } + /// True indicates that the bookingCustomer for this appointment does not wish to receive a confirmation for this appointment. + public bool? OptOutOfCustomerEmail { get; set; } + /// The amount of time to reserve after the appointment ends, for cleaning up, as an example. The value is expressed in ISO8601 format. + public string PostBuffer { get; set; } + /// The amount of time to reserve before the appointment begins, for preparation, as an example. The value is expressed in ISO8601 format. + public string PreBuffer { get; set; } + /// The regular price for an appointment for the specified bookingService. + public double? Price { get; set; } + /// A setting to provide flexibility for the pricing structure of services. Possible values are: undefined, fixedPrice, startingAt, hourly, free, priceVaries, callUs, notSet, unknownFutureValue. + public BookingPriceType? PriceType { get; set; } + /// The collection of customer reminders sent for this appointment. The value of this property is available only when reading this bookingAppointment by its ID. + public List Reminders { get; set; } + /// An additional tracking ID for the appointment, if the appointment has been created directly by the customer on the scheduling page, as opposed to by a staff member on the behalf of the customer. + public string SelfServiceAppointmentId { get; set; } + /// The ID of the bookingService associated with this appointment. + public string ServiceId { get; set; } + /// The location where the service is delivered. + public Location ServiceLocation { get; set; } + /// The name of the bookingService associated with this appointment.This property is optional when creating a new appointment. If not specified, it is computed from the service associated with the appointment by the serviceId property. + public string ServiceName { get; set; } + /// Notes from a bookingStaffMember. The value of this property is available only when reading this bookingAppointment by its ID. + public string ServiceNotes { get; set; } + /// True indicates SMS notifications will be sent to the customers for the appointment. Default value is false. + public bool? SmsNotificationsEnabled { get; set; } + /// The ID of each bookingStaffMember who is scheduled in this appointment. + public List StaffMemberIds { get; set; } + public DateTimeTimeZone StartDateTime { get; set; } + /// + /// The deserialization information for the current model + /// + public new IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + {"additionalInformation", (o,n) => { (o as BookingAppointment).AdditionalInformation = n.GetStringValue(); } }, + {"customers", (o,n) => { (o as BookingAppointment).Customers = n.GetCollectionOfObjectValues().ToList(); } }, + {"customerTimeZone", (o,n) => { (o as BookingAppointment).CustomerTimeZone = n.GetStringValue(); } }, + {"duration", (o,n) => { (o as BookingAppointment).Duration = n.GetStringValue(); } }, + {"endDateTime", (o,n) => { (o as BookingAppointment).EndDateTime = n.GetObjectValue(); } }, + {"filledAttendeesCount", (o,n) => { (o as BookingAppointment).FilledAttendeesCount = n.GetIntValue(); } }, + {"isLocationOnline", (o,n) => { (o as BookingAppointment).IsLocationOnline = n.GetBoolValue(); } }, + {"joinWebUrl", (o,n) => { (o as BookingAppointment).JoinWebUrl = n.GetStringValue(); } }, + {"maximumAttendeesCount", (o,n) => { (o as BookingAppointment).MaximumAttendeesCount = n.GetIntValue(); } }, + {"optOutOfCustomerEmail", (o,n) => { (o as BookingAppointment).OptOutOfCustomerEmail = n.GetBoolValue(); } }, + {"postBuffer", (o,n) => { (o as BookingAppointment).PostBuffer = n.GetStringValue(); } }, + {"preBuffer", (o,n) => { (o as BookingAppointment).PreBuffer = n.GetStringValue(); } }, + {"price", (o,n) => { (o as BookingAppointment).Price = n.GetDoubleValue(); } }, + {"priceType", (o,n) => { (o as BookingAppointment).PriceType = n.GetEnumValue(); } }, + {"reminders", (o,n) => { (o as BookingAppointment).Reminders = n.GetCollectionOfObjectValues().ToList(); } }, + {"selfServiceAppointmentId", (o,n) => { (o as BookingAppointment).SelfServiceAppointmentId = n.GetStringValue(); } }, + {"serviceId", (o,n) => { (o as BookingAppointment).ServiceId = n.GetStringValue(); } }, + {"serviceLocation", (o,n) => { (o as BookingAppointment).ServiceLocation = n.GetObjectValue(); } }, + {"serviceName", (o,n) => { (o as BookingAppointment).ServiceName = n.GetStringValue(); } }, + {"serviceNotes", (o,n) => { (o as BookingAppointment).ServiceNotes = n.GetStringValue(); } }, + {"smsNotificationsEnabled", (o,n) => { (o as BookingAppointment).SmsNotificationsEnabled = n.GetBoolValue(); } }, + {"staffMemberIds", (o,n) => { (o as BookingAppointment).StaffMemberIds = n.GetCollectionOfPrimitiveValues().ToList(); } }, + {"startDateTime", (o,n) => { (o as BookingAppointment).StartDateTime = n.GetObjectValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public new void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteStringValue("additionalInformation", AdditionalInformation); + writer.WriteCollectionOfObjectValues("customers", Customers); + writer.WriteStringValue("customerTimeZone", CustomerTimeZone); + writer.WriteStringValue("duration", Duration); + writer.WriteObjectValue("endDateTime", EndDateTime); + writer.WriteIntValue("filledAttendeesCount", FilledAttendeesCount); + writer.WriteBoolValue("isLocationOnline", IsLocationOnline); + writer.WriteStringValue("joinWebUrl", JoinWebUrl); + writer.WriteIntValue("maximumAttendeesCount", MaximumAttendeesCount); + writer.WriteBoolValue("optOutOfCustomerEmail", OptOutOfCustomerEmail); + writer.WriteStringValue("postBuffer", PostBuffer); + writer.WriteStringValue("preBuffer", PreBuffer); + writer.WriteDoubleValue("price", Price); + writer.WriteEnumValue("priceType", PriceType); + writer.WriteCollectionOfObjectValues("reminders", Reminders); + writer.WriteStringValue("selfServiceAppointmentId", SelfServiceAppointmentId); + writer.WriteStringValue("serviceId", ServiceId); + writer.WriteObjectValue("serviceLocation", ServiceLocation); + writer.WriteStringValue("serviceName", ServiceName); + writer.WriteStringValue("serviceNotes", ServiceNotes); + writer.WriteBoolValue("smsNotificationsEnabled", SmsNotificationsEnabled); + writer.WriteCollectionOfPrimitiveValues("staffMemberIds", StaffMemberIds); + writer.WriteObjectValue("startDateTime", StartDateTime); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/BookingBusiness.cs b/src/generated/Models/Microsoft/Graph/BookingBusiness.cs new file mode 100644 index 00000000000..150819b6a5a --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingBusiness.cs @@ -0,0 +1,92 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class BookingBusiness : Entity, IParsable { + /// The street address of the business. The address property, together with phone and webSiteUrl, appear in the footer of a business scheduling page. + public PhysicalAddress Address { get; set; } + /// All the appointments of this business. Read-only. Nullable. + public List Appointments { get; set; } + /// The hours of operation for the business. + public List BusinessHours { get; set; } + /// The type of business. + public string BusinessType { get; set; } + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + public List CalendarView { get; set; } + /// All the customers of this business. Read-only. Nullable. + public List Customers { get; set; } + /// All the custom questions of this business. Read-only. Nullable. + public List CustomQuestions { get; set; } + /// The code for the currency that the business operates in on Microsoft Bookings. + public string DefaultCurrencyIso { get; set; } + /// The name of the business, which interfaces with customers. This name appears at the top of the business scheduling page. + public string DisplayName { get; set; } + /// The email address for the business. + public string Email { get; set; } + /// The scheduling page has been made available to external customers. Use the publish and unpublish actions to set this property. Read-only. + public bool? IsPublished { get; set; } + /// The telephone number for the business. The phone property, together with address and webSiteUrl, appear in the footer of a business scheduling page. + public string Phone { get; set; } + /// The URL for the scheduling page, which is set after you publish or unpublish the page. Read-only. + public string PublicUrl { get; set; } + /// Specifies how bookings can be created for this business. + public BookingSchedulingPolicy SchedulingPolicy { get; set; } + /// All the services offered by this business. Read-only. Nullable. + public List Services { get; set; } + /// All the staff members that provide services in this business. Read-only. Nullable. + public List StaffMembers { get; set; } + /// The URL of the business web site. The webSiteUrl property, together with address, phone, appear in the footer of a business scheduling page. + public string WebSiteUrl { get; set; } + /// + /// The deserialization information for the current model + /// + public new IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + {"address", (o,n) => { (o as BookingBusiness).Address = n.GetObjectValue(); } }, + {"appointments", (o,n) => { (o as BookingBusiness).Appointments = n.GetCollectionOfObjectValues().ToList(); } }, + {"businessHours", (o,n) => { (o as BookingBusiness).BusinessHours = n.GetCollectionOfObjectValues().ToList(); } }, + {"businessType", (o,n) => { (o as BookingBusiness).BusinessType = n.GetStringValue(); } }, + {"calendarView", (o,n) => { (o as BookingBusiness).CalendarView = n.GetCollectionOfObjectValues().ToList(); } }, + {"customers", (o,n) => { (o as BookingBusiness).Customers = n.GetCollectionOfObjectValues().ToList(); } }, + {"customQuestions", (o,n) => { (o as BookingBusiness).CustomQuestions = n.GetCollectionOfObjectValues().ToList(); } }, + {"defaultCurrencyIso", (o,n) => { (o as BookingBusiness).DefaultCurrencyIso = n.GetStringValue(); } }, + {"displayName", (o,n) => { (o as BookingBusiness).DisplayName = n.GetStringValue(); } }, + {"email", (o,n) => { (o as BookingBusiness).Email = n.GetStringValue(); } }, + {"isPublished", (o,n) => { (o as BookingBusiness).IsPublished = n.GetBoolValue(); } }, + {"phone", (o,n) => { (o as BookingBusiness).Phone = n.GetStringValue(); } }, + {"publicUrl", (o,n) => { (o as BookingBusiness).PublicUrl = n.GetStringValue(); } }, + {"schedulingPolicy", (o,n) => { (o as BookingBusiness).SchedulingPolicy = n.GetObjectValue(); } }, + {"services", (o,n) => { (o as BookingBusiness).Services = n.GetCollectionOfObjectValues().ToList(); } }, + {"staffMembers", (o,n) => { (o as BookingBusiness).StaffMembers = n.GetCollectionOfObjectValues().ToList(); } }, + {"webSiteUrl", (o,n) => { (o as BookingBusiness).WebSiteUrl = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public new void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("address", Address); + writer.WriteCollectionOfObjectValues("appointments", Appointments); + writer.WriteCollectionOfObjectValues("businessHours", BusinessHours); + writer.WriteStringValue("businessType", BusinessType); + writer.WriteCollectionOfObjectValues("calendarView", CalendarView); + writer.WriteCollectionOfObjectValues("customers", Customers); + writer.WriteCollectionOfObjectValues("customQuestions", CustomQuestions); + writer.WriteStringValue("defaultCurrencyIso", DefaultCurrencyIso); + writer.WriteStringValue("displayName", DisplayName); + writer.WriteStringValue("email", Email); + writer.WriteBoolValue("isPublished", IsPublished); + writer.WriteStringValue("phone", Phone); + writer.WriteStringValue("publicUrl", PublicUrl); + writer.WriteObjectValue("schedulingPolicy", SchedulingPolicy); + writer.WriteCollectionOfObjectValues("services", Services); + writer.WriteCollectionOfObjectValues("staffMembers", StaffMembers); + writer.WriteStringValue("webSiteUrl", WebSiteUrl); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/BookingCurrency.cs b/src/generated/Models/Microsoft/Graph/BookingCurrency.cs new file mode 100644 index 00000000000..a11d3771074 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingCurrency.cs @@ -0,0 +1,28 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class BookingCurrency : Entity, IParsable { + /// The currency symbol. For example, the currency symbol for the US dollar and for the Australian dollar is $. + public string Symbol { get; set; } + /// + /// The deserialization information for the current model + /// + public new IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + {"symbol", (o,n) => { (o as BookingCurrency).Symbol = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public new void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteStringValue("symbol", Symbol); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/BookingCustomQuestion.cs b/src/generated/Models/Microsoft/Graph/BookingCustomQuestion.cs new file mode 100644 index 00000000000..92c254fd318 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingCustomQuestion.cs @@ -0,0 +1,36 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class BookingCustomQuestion : Entity, IParsable { + /// The expected answer type. The possible values are: text, radioButton, unknownFutureValue. + public AnswerInputType? AnswerInputType { get; set; } + /// List of possible answer values. + public List AnswerOptions { get; set; } + /// Display name of this entity. + public string DisplayName { get; set; } + /// + /// The deserialization information for the current model + /// + public new IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + {"answerInputType", (o,n) => { (o as BookingCustomQuestion).AnswerInputType = n.GetEnumValue(); } }, + {"answerOptions", (o,n) => { (o as BookingCustomQuestion).AnswerOptions = n.GetCollectionOfPrimitiveValues().ToList(); } }, + {"displayName", (o,n) => { (o as BookingCustomQuestion).DisplayName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public new void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteEnumValue("answerInputType", AnswerInputType); + writer.WriteCollectionOfPrimitiveValues("answerOptions", AnswerOptions); + writer.WriteStringValue("displayName", DisplayName); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/BookingCustomerBase.cs b/src/generated/Models/Microsoft/Graph/BookingCustomerBase.cs new file mode 100644 index 00000000000..362f681c686 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingCustomerBase.cs @@ -0,0 +1,24 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class BookingCustomerBase : Entity, IParsable { + /// + /// The deserialization information for the current model + /// + public new IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public new void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/BookingCustomerInformationBase.cs b/src/generated/Models/Microsoft/Graph/BookingCustomerInformationBase.cs new file mode 100644 index 00000000000..f7790f81419 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingCustomerInformationBase.cs @@ -0,0 +1,32 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class BookingCustomerInformationBase : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new bookingCustomerInformationBase and sets the default values. + /// + public BookingCustomerInformationBase() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/BookingPriceType.cs b/src/generated/Models/Microsoft/Graph/BookingPriceType.cs new file mode 100644 index 00000000000..84762cabec9 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingPriceType.cs @@ -0,0 +1,13 @@ +namespace ApiSdk.Models.Microsoft.Graph { + public enum BookingPriceType { + Undefined, + FixedPrice, + StartingAt, + Hourly, + Free, + PriceVaries, + CallUs, + NotSet, + UnknownFutureValue, + } +} diff --git a/src/generated/Models/Microsoft/Graph/BookingQuestionAssignment.cs b/src/generated/Models/Microsoft/Graph/BookingQuestionAssignment.cs new file mode 100644 index 00000000000..80ccd129a0f --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingQuestionAssignment.cs @@ -0,0 +1,40 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class BookingQuestionAssignment : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Indicates whether it is mandatory to answer the custom question. + public bool? IsRequired { get; set; } + /// If it is mandatory to answer the custom question. + public string QuestionId { get; set; } + /// + /// Instantiates a new bookingQuestionAssignment and sets the default values. + /// + public BookingQuestionAssignment() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"isRequired", (o,n) => { (o as BookingQuestionAssignment).IsRequired = n.GetBoolValue(); } }, + {"questionId", (o,n) => { (o as BookingQuestionAssignment).QuestionId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("isRequired", IsRequired); + writer.WriteStringValue("questionId", QuestionId); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/BookingReminder.cs b/src/generated/Models/Microsoft/Graph/BookingReminder.cs new file mode 100644 index 00000000000..82494d08a90 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingReminder.cs @@ -0,0 +1,44 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class BookingReminder : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The message in the reminder. + public string Message { get; set; } + /// The amount of time before the start of an appointment that the reminder should be sent. It's denoted in ISO 8601 format. + public string Offset { get; set; } + /// The persons who should receive the reminder. Possible values are: allAttendees, staff, customer and unknownFutureValue. + public BookingReminderRecipients? Recipients { get; set; } + /// + /// Instantiates a new bookingReminder and sets the default values. + /// + public BookingReminder() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"message", (o,n) => { (o as BookingReminder).Message = n.GetStringValue(); } }, + {"offset", (o,n) => { (o as BookingReminder).Offset = n.GetStringValue(); } }, + {"recipients", (o,n) => { (o as BookingReminder).Recipients = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("message", Message); + writer.WriteStringValue("offset", Offset); + writer.WriteEnumValue("recipients", Recipients); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/BookingReminderRecipients.cs b/src/generated/Models/Microsoft/Graph/BookingReminderRecipients.cs new file mode 100644 index 00000000000..8f223b5282e --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingReminderRecipients.cs @@ -0,0 +1,8 @@ +namespace ApiSdk.Models.Microsoft.Graph { + public enum BookingReminderRecipients { + AllAttendees, + Staff, + Customer, + UnknownFutureValue, + } +} diff --git a/src/generated/Models/Microsoft/Graph/BookingSchedulingPolicy.cs b/src/generated/Models/Microsoft/Graph/BookingSchedulingPolicy.cs new file mode 100644 index 00000000000..fbc08bab36a --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingSchedulingPolicy.cs @@ -0,0 +1,52 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class BookingSchedulingPolicy : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// True if to allow customers to choose a specific person for the booking. + public bool? AllowStaffSelection { get; set; } + /// Maximum number of days in advance that a booking can be made. It follows the ISO 8601 format. + public string MaximumAdvance { get; set; } + /// The minimum amount of time before which bookings and cancellations must be made. It follows the ISO 8601 format. + public string MinimumLeadTime { get; set; } + /// True to notify the business via email when a booking is created or changed. Use the email address specified in the email property of the bookingBusiness entity for the business. + public bool? SendConfirmationsToOwner { get; set; } + /// Duration of each time slot, denoted in ISO 8601 format. + public string TimeSlotInterval { get; set; } + /// + /// Instantiates a new bookingSchedulingPolicy and sets the default values. + /// + public BookingSchedulingPolicy() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"allowStaffSelection", (o,n) => { (o as BookingSchedulingPolicy).AllowStaffSelection = n.GetBoolValue(); } }, + {"maximumAdvance", (o,n) => { (o as BookingSchedulingPolicy).MaximumAdvance = n.GetStringValue(); } }, + {"minimumLeadTime", (o,n) => { (o as BookingSchedulingPolicy).MinimumLeadTime = n.GetStringValue(); } }, + {"sendConfirmationsToOwner", (o,n) => { (o as BookingSchedulingPolicy).SendConfirmationsToOwner = n.GetBoolValue(); } }, + {"timeSlotInterval", (o,n) => { (o as BookingSchedulingPolicy).TimeSlotInterval = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("allowStaffSelection", AllowStaffSelection); + writer.WriteStringValue("maximumAdvance", MaximumAdvance); + writer.WriteStringValue("minimumLeadTime", MinimumLeadTime); + writer.WriteBoolValue("sendConfirmationsToOwner", SendConfirmationsToOwner); + writer.WriteStringValue("timeSlotInterval", TimeSlotInterval); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/BookingService.cs b/src/generated/Models/Microsoft/Graph/BookingService.cs new file mode 100644 index 00000000000..37821590374 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingService.cs @@ -0,0 +1,100 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class BookingService : Entity, IParsable { + /// Additional information that is sent to the customer when an appointment is confirmed. + public string AdditionalInformation { get; set; } + /// Contains the set of custom questions associated with a particular service. + public List CustomQuestions { get; set; } + /// The default length of the service, represented in numbers of days, hours, minutes, and seconds. For example, P11D23H59M59.999999999999S. + public string DefaultDuration { get; set; } + /// The default physical location for the service. + public Location DefaultLocation { get; set; } + /// The default monetary price for the service. + public double? DefaultPrice { get; set; } + /// The default way the service is charged. Possible values are: undefined, fixedPrice, startingAt, hourly, free, priceVaries, callUs, notSet, unknownFutureValue. + public BookingPriceType? DefaultPriceType { get; set; } + /// The default set of reminders for an appointment of this service. The value of this property is available only when reading this bookingService by its ID. + public List DefaultReminders { get; set; } + /// A text description for the service. + public string Description { get; set; } + /// A service name. + public string DisplayName { get; set; } + /// True means this service is not available to customers for booking. + public bool? IsHiddenFromCustomers { get; set; } + /// True indicates that the appointments for the service will be held online. Default value is false. + public bool? IsLocationOnline { get; set; } + /// The maximum number of customers allowed in a service. + public int? MaximumAttendeesCount { get; set; } + /// Additional information about this service. + public string Notes { get; set; } + /// The time to buffer after an appointment for this service ends, and before the next customer appointment can be booked. + public string PostBuffer { get; set; } + /// The time to buffer before an appointment for this service can start. + public string PreBuffer { get; set; } + /// The set of policies that determine how appointments for this type of service should be created and managed. + public BookingSchedulingPolicy SchedulingPolicy { get; set; } + /// True indicates SMS notifications can be sent to the customers for the appointment of the service. Default value is false. + public bool? SmsNotificationsEnabled { get; set; } + /// Represents those staff members who provide this service. + public List StaffMemberIds { get; set; } + /// The URL a customer uses to access the service. + public string WebUrl { get; set; } + /// + /// The deserialization information for the current model + /// + public new IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + {"additionalInformation", (o,n) => { (o as BookingService).AdditionalInformation = n.GetStringValue(); } }, + {"customQuestions", (o,n) => { (o as BookingService).CustomQuestions = n.GetCollectionOfObjectValues().ToList(); } }, + {"defaultDuration", (o,n) => { (o as BookingService).DefaultDuration = n.GetStringValue(); } }, + {"defaultLocation", (o,n) => { (o as BookingService).DefaultLocation = n.GetObjectValue(); } }, + {"defaultPrice", (o,n) => { (o as BookingService).DefaultPrice = n.GetDoubleValue(); } }, + {"defaultPriceType", (o,n) => { (o as BookingService).DefaultPriceType = n.GetEnumValue(); } }, + {"defaultReminders", (o,n) => { (o as BookingService).DefaultReminders = n.GetCollectionOfObjectValues().ToList(); } }, + {"description", (o,n) => { (o as BookingService).Description = n.GetStringValue(); } }, + {"displayName", (o,n) => { (o as BookingService).DisplayName = n.GetStringValue(); } }, + {"isHiddenFromCustomers", (o,n) => { (o as BookingService).IsHiddenFromCustomers = n.GetBoolValue(); } }, + {"isLocationOnline", (o,n) => { (o as BookingService).IsLocationOnline = n.GetBoolValue(); } }, + {"maximumAttendeesCount", (o,n) => { (o as BookingService).MaximumAttendeesCount = n.GetIntValue(); } }, + {"notes", (o,n) => { (o as BookingService).Notes = n.GetStringValue(); } }, + {"postBuffer", (o,n) => { (o as BookingService).PostBuffer = n.GetStringValue(); } }, + {"preBuffer", (o,n) => { (o as BookingService).PreBuffer = n.GetStringValue(); } }, + {"schedulingPolicy", (o,n) => { (o as BookingService).SchedulingPolicy = n.GetObjectValue(); } }, + {"smsNotificationsEnabled", (o,n) => { (o as BookingService).SmsNotificationsEnabled = n.GetBoolValue(); } }, + {"staffMemberIds", (o,n) => { (o as BookingService).StaffMemberIds = n.GetCollectionOfPrimitiveValues().ToList(); } }, + {"webUrl", (o,n) => { (o as BookingService).WebUrl = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public new void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteStringValue("additionalInformation", AdditionalInformation); + writer.WriteCollectionOfObjectValues("customQuestions", CustomQuestions); + writer.WriteStringValue("defaultDuration", DefaultDuration); + writer.WriteObjectValue("defaultLocation", DefaultLocation); + writer.WriteDoubleValue("defaultPrice", DefaultPrice); + writer.WriteEnumValue("defaultPriceType", DefaultPriceType); + writer.WriteCollectionOfObjectValues("defaultReminders", DefaultReminders); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("displayName", DisplayName); + writer.WriteBoolValue("isHiddenFromCustomers", IsHiddenFromCustomers); + writer.WriteBoolValue("isLocationOnline", IsLocationOnline); + writer.WriteIntValue("maximumAttendeesCount", MaximumAttendeesCount); + writer.WriteStringValue("notes", Notes); + writer.WriteStringValue("postBuffer", PostBuffer); + writer.WriteStringValue("preBuffer", PreBuffer); + writer.WriteObjectValue("schedulingPolicy", SchedulingPolicy); + writer.WriteBoolValue("smsNotificationsEnabled", SmsNotificationsEnabled); + writer.WriteCollectionOfPrimitiveValues("staffMemberIds", StaffMemberIds); + writer.WriteStringValue("webUrl", WebUrl); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/BookingStaffMemberBase.cs b/src/generated/Models/Microsoft/Graph/BookingStaffMemberBase.cs new file mode 100644 index 00000000000..23d165f8a73 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingStaffMemberBase.cs @@ -0,0 +1,24 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class BookingStaffMemberBase : Entity, IParsable { + /// + /// The deserialization information for the current model + /// + public new IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public new void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/BookingWorkHours.cs b/src/generated/Models/Microsoft/Graph/BookingWorkHours.cs new file mode 100644 index 00000000000..8f91db0283e --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingWorkHours.cs @@ -0,0 +1,40 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class BookingWorkHours : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The day of the week represented by this instance. Possible values are: sunday, monday, tuesday, wednesday, thursday, friday, saturday. + public DayOfWeek? Day { get; set; } + /// A list of start/end times during a day. + public List TimeSlots { get; set; } + /// + /// Instantiates a new bookingWorkHours and sets the default values. + /// + public BookingWorkHours() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"day", (o,n) => { (o as BookingWorkHours).Day = n.GetEnumValue(); } }, + {"timeSlots", (o,n) => { (o as BookingWorkHours).TimeSlots = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("day", Day); + writer.WriteCollectionOfObjectValues("timeSlots", TimeSlots); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/BookingWorkTimeSlot.cs b/src/generated/Models/Microsoft/Graph/BookingWorkTimeSlot.cs new file mode 100644 index 00000000000..95c0fc3a85f --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/BookingWorkTimeSlot.cs @@ -0,0 +1,40 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class BookingWorkTimeSlot : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The time of the day when work stops. For example, 17:00:00.0000000. + public string EndTime { get; set; } + /// The time of the day when work starts. For example, 08:00:00.0000000. + public string StartTime { get; set; } + /// + /// Instantiates a new bookingWorkTimeSlot and sets the default values. + /// + public BookingWorkTimeSlot() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"endTime", (o,n) => { (o as BookingWorkTimeSlot).EndTime = n.GetStringValue(); } }, + {"startTime", (o,n) => { (o as BookingWorkTimeSlot).StartTime = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("endTime", EndTime); + writer.WriteStringValue("startTime", StartTime); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/Calendar.cs b/src/generated/Models/Microsoft/Graph/Calendar.cs index 0308c1115dc..555310d1f0d 100644 --- a/src/generated/Models/Microsoft/Graph/Calendar.cs +++ b/src/generated/Models/Microsoft/Graph/Calendar.cs @@ -11,11 +11,11 @@ public class Calendar : Entity, IParsable { public List CalendarPermissions { get; set; } /// The calendar view for the calendar. Navigation property. Read-only. public List<@Event> CalendarView { get; set; } - /// true if the user can write to the calendar, false otherwise. This property is true for the user who created the calendar. This property is also true for a user who has been shared a calendar and granted write access. + /// true if the user can write to the calendar, false otherwise. This property is true for the user who created the calendar. This property is also true for a user who has been shared a calendar and granted write access, through an Outlook client or the corresponding calendarPermission resource. Read-only. public bool? CanEdit { get; set; } - /// true if the user has the permission to share the calendar, false otherwise. Only the user who created the calendar can share it. + /// true if the user has the permission to share the calendar, false otherwise. Only the user who created the calendar can share it. Read-only. public bool? CanShare { get; set; } - /// true if the user can read calendar items that have been marked private, false otherwise. + /// true if the user can read calendar items that have been marked private, false otherwise. This property is set through an Outlook client or the corresponding calendarPermission resource. Read-only. public bool? CanViewPrivateItems { get; set; } /// Identifies the version of the calendar object. Every time the calendar is changed, changeKey changes as well. This allows Exchange to apply changes to the correct version of the object. Read-only. public string ChangeKey { get; set; } @@ -25,7 +25,7 @@ public class Calendar : Entity, IParsable { public OnlineMeetingProviderType? DefaultOnlineMeetingProvider { get; set; } /// The events in the calendar. Navigation property. Read-only. public List<@Event> Events { get; set; } - /// The calendar color, expressed in a hex color code of three hexadecimal values, each ranging from 00 to FF and representing the red, green, or blue components of the color in the RGB color space. If the user has never explicitly set a color for the calendar, this property is empty. Read-only. + /// The calendar color, expressed in a hex color code of three hexadecimal values, each ranging from 00 to FF and representing the red, green, or blue components of the color in the RGB color space. If the user has never explicitly set a color for the calendar, this property is empty. public string HexColor { get; set; } /// true if this is the default calendar where new events are created by default, false otherwise. public bool? IsDefaultCalendar { get; set; } @@ -37,7 +37,7 @@ public class Calendar : Entity, IParsable { public List MultiValueExtendedProperties { get; set; } /// The calendar name. public string Name { get; set; } - /// If set, this represents the user who created or added the calendar. For a calendar that the user created or added, the owner property is set to the user. For a calendar shared with the user, the owner property is set to the person who shared that calendar with the user. + /// If set, this represents the user who created or added the calendar. For a calendar that the user created or added, the owner property is set to the user. For a calendar shared with the user, the owner property is set to the person who shared that calendar with the user. Read-only. public EmailAddress Owner { get; set; } /// The collection of single-value extended properties defined for the calendar. Read-only. Nullable. public List SingleValueExtendedProperties { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Call.cs b/src/generated/Models/Microsoft/Graph/Call.cs index 893fe2d00c7..4148d761bcf 100644 --- a/src/generated/Models/Microsoft/Graph/Call.cs +++ b/src/generated/Models/Microsoft/Graph/Call.cs @@ -14,17 +14,17 @@ public class Call : Entity, IParsable { public CallOptions CallOptions { get; set; } /// The routing information on how the call was retargeted. Read-only. public List CallRoutes { get; set; } - /// The chat information. Required information for joining a meeting. + /// The chat information. Required information for meeting scenarios. public ChatInfo ChatInfo { get; set; } /// The direction of the call. The possible value are incoming or outgoing. Read-only. public CallDirection? Direction { get; set; } /// The context associated with an incoming call. Read-only. Server generated. public IncomingContext IncomingContext { get; set; } - /// The media configuration. Required. + /// The media configuration. Required information for creating peer to peer calls or joining meetings. public MediaConfig MediaConfig { get; set; } /// Read-only. The call media state. public CallMediaState MediaState { get; set; } - /// The meeting information that's required for joining a meeting. + /// The meeting information. Required information for meeting scenarios. public MeetingInfo MeetingInfo { get; set; } public string MyParticipantId { get; set; } /// Read-only. Nullable. diff --git a/src/generated/Models/Microsoft/Graph/CallOptions.cs b/src/generated/Models/Microsoft/Graph/CallOptions.cs index dc91edf4b05..a1ca71460b1 100644 --- a/src/generated/Models/Microsoft/Graph/CallOptions.cs +++ b/src/generated/Models/Microsoft/Graph/CallOptions.cs @@ -7,6 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class CallOptions : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } + public bool? HideBotAfterEscalation { get; set; } /// /// Instantiates a new callOptions and sets the default values. /// @@ -18,6 +19,7 @@ public CallOptions() { /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { + {"hideBotAfterEscalation", (o,n) => { (o as CallOptions).HideBotAfterEscalation = n.GetBoolValue(); } }, }; } /// @@ -26,6 +28,7 @@ public IDictionary> GetFieldDeserializers() { /// public void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("hideBotAfterEscalation", HideBotAfterEscalation); writer.WriteAdditionalData(AdditionalData); } } diff --git a/src/generated/Models/Microsoft/Graph/CallRecords/CallRecord.cs b/src/generated/Models/Microsoft/Graph/CallRecords/CallRecord.cs index 5bbf8785f01..2cb9932446a 100644 --- a/src/generated/Models/Microsoft/Graph/CallRecords/CallRecord.cs +++ b/src/generated/Models/Microsoft/Graph/CallRecords/CallRecord.cs @@ -19,11 +19,11 @@ public class CallRecord : Entity, IParsable { public List Participants { get; set; } /// List of sessions involved in the call. Peer-to-peer calls typically only have one session, whereas group calls typically have at least one session per participant. Read-only. Nullable. public List Sessions { get; set; } - /// UTC time when the first user joined the call. The DatetimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. + /// UTC time when the first user joined the call. The DatetimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z public DateTimeOffset? StartDateTime { get; set; } /// Indicates the type of the call. Possible values are: unknown, groupCall, peerToPeer, unknownFutureValue. public CallType? Type { get; set; } - /// Monotonically increasing version of the call record. Higher version call records with the same id includes additional data compared to the lower version. + /// Monotonically increasing version of the call record. Higher version call records with the same ID includes additional data compared to the lower version. public long? Version { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/CallRecords/Session.cs b/src/generated/Models/Microsoft/Graph/CallRecords/Session.cs index 62d071ac142..ee727a1eafd 100644 --- a/src/generated/Models/Microsoft/Graph/CallRecords/Session.cs +++ b/src/generated/Models/Microsoft/Graph/CallRecords/Session.cs @@ -17,7 +17,7 @@ public class Session : Entity, IParsable { public List Modalities { get; set; } /// The list of segments involved in the session. Read-only. Nullable. public List Segments { get; set; } - /// UTC time when the first user joined the session. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z + /// UTC fime when the first user joined the session. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z public DateTimeOffset? StartDateTime { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/Channel.cs b/src/generated/Models/Microsoft/Graph/Channel.cs index 724b638bf60..54c4614c593 100644 --- a/src/generated/Models/Microsoft/Graph/Channel.cs +++ b/src/generated/Models/Microsoft/Graph/Channel.cs @@ -19,7 +19,7 @@ public class Channel : Entity, IParsable { public bool? IsFavoriteByDefault { get; set; } /// A collection of membership records associated with the channel. public List Members { get; set; } - /// The type of the channel. Can be set during creation and can't be changed. Possible values are: standard - Channel inherits the list of members of the parent team; private - Channel can have members that are a subset of all the members on the parent team. + /// The type of the channel. Can be set during creation and can't be changed. The possible values are: standard, private, unknownFutureValue, shared. The default value is standard. Note that you must use the Prefer: include-unknown-enum-members request header to get the following value in this evolvable enum: shared. public ChannelMembershipType? MembershipType { get; set; } /// A collection of all the messages in the channel. A navigation property. Nullable. public List Messages { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Chat.cs b/src/generated/Models/Microsoft/Graph/Chat.cs index 74be13253ef..6c5b0f15cd3 100644 --- a/src/generated/Models/Microsoft/Graph/Chat.cs +++ b/src/generated/Models/Microsoft/Graph/Chat.cs @@ -20,6 +20,8 @@ public class Chat : Entity, IParsable { public List Tabs { get; set; } /// (Optional) Subject or topic for the chat. Only available for group chats. public string Topic { get; set; } + /// The URL for the chat in Microsoft Teams. The URL should be treated as an opaque blob, and not parsed. Read-only. + public string WebUrl { get; set; } /// /// The deserialization information for the current model /// @@ -33,6 +35,7 @@ public class Chat : Entity, IParsable { {"messages", (o,n) => { (o as Chat).Messages = n.GetCollectionOfObjectValues().ToList(); } }, {"tabs", (o,n) => { (o as Chat).Tabs = n.GetCollectionOfObjectValues().ToList(); } }, {"topic", (o,n) => { (o as Chat).Topic = n.GetStringValue(); } }, + {"webUrl", (o,n) => { (o as Chat).WebUrl = n.GetStringValue(); } }, }; } /// @@ -50,6 +53,7 @@ public class Chat : Entity, IParsable { writer.WriteCollectionOfObjectValues("messages", Messages); writer.WriteCollectionOfObjectValues("tabs", Tabs); writer.WriteStringValue("topic", Topic); + writer.WriteStringValue("webUrl", WebUrl); } } } diff --git a/src/generated/Models/Microsoft/Graph/ChatInfo.cs b/src/generated/Models/Microsoft/Graph/ChatInfo.cs index 90cd7448547..fc410639d0f 100644 --- a/src/generated/Models/Microsoft/Graph/ChatInfo.cs +++ b/src/generated/Models/Microsoft/Graph/ChatInfo.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class ChatInfo : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The unique identifier of a message in a Microsoft Teams channel. + /// The unique identifier for a message in a Microsoft Teams channel. public string MessageId { get; set; } /// The ID of the reply message. public string ReplyChainMessageId { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/ChatMessage.cs b/src/generated/Models/Microsoft/Graph/ChatMessage.cs index f5ede98a310..2b3697a3306 100644 --- a/src/generated/Models/Microsoft/Graph/ChatMessage.cs +++ b/src/generated/Models/Microsoft/Graph/ChatMessage.cs @@ -18,7 +18,7 @@ public class ChatMessage : Entity, IParsable { public DateTimeOffset? DeletedDateTime { get; set; } /// Read-only. Version number of the chat message. public string Etag { get; set; } - /// Read-only. If present, represents details of an event that happened in a chat, a channel, or a team, for example, members were added, and so on. For event messages, the messageType property will be set to systemEventMessage. + /// Read-only. If present, represents details of an event that happened in a chat, a channel, or a team, for example, adding new members. For event messages, the messageType property will be set to systemEventMessage. public EventMessageDetail EventDetail { get; set; } /// Details of the sender of the chat message. Can only be set during migration. public ChatMessageFromIdentitySet From { get; set; } @@ -32,7 +32,7 @@ public class ChatMessage : Entity, IParsable { public DateTimeOffset? LastModifiedDateTime { get; set; } /// Locale of the chat message set by the client. Always set to en-us. public string Locale { get; set; } - /// List of entities mentioned in the chat message. Supported entities are: user, bot, team, and channel. + /// List of entities mentioned in the chat message. Supported entities are: user, bot, team, channel, and tag. public List Mentions { get; set; } /// The type of chat message. The possible values are: message, chatEvent, typing, unknownFutureValue, systemEventMessage. Note that you must use the Prefer: include-unknown-enum-members request header to get the following value in this evolvable enum: systemEventMessage. public ChatMessageType? MessageType { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/CloudAppSecuritySessionControl.cs b/src/generated/Models/Microsoft/Graph/CloudAppSecuritySessionControl.cs index 8a90fc9b5e9..e1081dd790f 100644 --- a/src/generated/Models/Microsoft/Graph/CloudAppSecuritySessionControl.cs +++ b/src/generated/Models/Microsoft/Graph/CloudAppSecuritySessionControl.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class CloudAppSecuritySessionControl : ConditionalAccessSessionControl, IParsable { - /// Possible values are: mcasConfigured, monitorOnly, blockDownloads, unknownFutureValue. For more information, see Deploy Conditional Access App Control for featured apps. + /// Possible values are: mcasConfigured, monitorOnly, blockDownloads. To learn more about these values, Deploy Conditional Access App Control for featured apps. public CloudAppSecuritySessionControlType? CloudAppSecurityType { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/ColumnDefinition.cs b/src/generated/Models/Microsoft/Graph/ColumnDefinition.cs index 45019fd5c20..3a1eb64286d 100644 --- a/src/generated/Models/Microsoft/Graph/ColumnDefinition.cs +++ b/src/generated/Models/Microsoft/Graph/ColumnDefinition.cs @@ -35,7 +35,7 @@ public class ColumnDefinition : Entity, IParsable { public bool? Hidden { get; set; } /// This column stores hyperlink or picture values. public HyperlinkOrPictureColumn HyperlinkOrPicture { get; set; } - /// Specifies whether the column values can be used for sorting and searching. + /// Specifies whether the column values can used for sorting and searching. public bool? Indexed { get; set; } /// Indicates whether this column can be deleted. public bool? IsDeletable { get; set; } @@ -51,11 +51,11 @@ public class ColumnDefinition : Entity, IParsable { public NumberColumn Number { get; set; } /// This column stores Person or Group values. public PersonOrGroupColumn PersonOrGroup { get; set; } - /// If 'true', changes to this column will be propagated to lists that implement the column. + /// If true, changes to this column will be propagated to lists that implement the column. public bool? PropagateChanges { get; set; } /// Specifies whether the column value isn't optional. public bool? Required { get; set; } - /// The source column for the content type column. + /// The source column for content type column. public ColumnDefinition SourceColumn { get; set; } /// This column stores taxonomy terms. public TermColumn Term { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/ColumnValidation.cs b/src/generated/Models/Microsoft/Graph/ColumnValidation.cs index 119a0dfc97a..001d636b04a 100644 --- a/src/generated/Models/Microsoft/Graph/ColumnValidation.cs +++ b/src/generated/Models/Microsoft/Graph/ColumnValidation.cs @@ -11,7 +11,7 @@ public class ColumnValidation : IParsable { public string DefaultLanguage { get; set; } /// Localized messages that explain what is needed for this column's value to be considered valid. User will be prompted with this message if validation fails. public List Descriptions { get; set; } - /// The formula to validate column value. For examples, see Examples of common formulas in lists. + /// The formula to validate column value. For examples, see Examples of common formulas in lists public string Formula { get; set; } /// /// Instantiates a new columnValidation and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/ConditionalAccessDevices.cs b/src/generated/Models/Microsoft/Graph/ConditionalAccessDevices.cs index 33a1a2c4686..904f162aebb 100644 --- a/src/generated/Models/Microsoft/Graph/ConditionalAccessDevices.cs +++ b/src/generated/Models/Microsoft/Graph/ConditionalAccessDevices.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class ConditionalAccessDevices : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Filter that defines the dynamic-device-syntax rule to include/exclude devices. A filter can use device properties (such as extension attributes) to include/exclude them. + /// Filter that defines the dynamic-device-syntax rule to include/exclude devices. A filter can use device properties (such as extension attributes) to include/exclude them. Cannot be set if includeDevices or excludeDevices is set. public ConditionalAccessFilter DeviceFilter { get; set; } /// /// Instantiates a new conditionalAccessDevices and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/ConditionalAccessFilter.cs b/src/generated/Models/Microsoft/Graph/ConditionalAccessFilter.cs index fdfe700c3cf..b85b1ff1469 100644 --- a/src/generated/Models/Microsoft/Graph/ConditionalAccessFilter.cs +++ b/src/generated/Models/Microsoft/Graph/ConditionalAccessFilter.cs @@ -9,7 +9,7 @@ public class ConditionalAccessFilter : IParsable { public IDictionary AdditionalData { get; set; } /// Mode to use for the filter. Possible values are include or exclude. public FilterMode? Mode { get; set; } - /// Rule syntax is similar to that used for membership rules for groups in Azure Active Directory (Azure AD). For details, see rules with multiple expressions + /// Rule syntax is similar to that used for membership rules for groups in Azure Active Directory. For details, see rules with multiple expressions public string Rule { get; set; } /// /// Instantiates a new conditionalAccessFilter and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/ConditionalAccessGrantControls.cs b/src/generated/Models/Microsoft/Graph/ConditionalAccessGrantControls.cs index 27a902a974b..e2d3b98df45 100644 --- a/src/generated/Models/Microsoft/Graph/ConditionalAccessGrantControls.cs +++ b/src/generated/Models/Microsoft/Graph/ConditionalAccessGrantControls.cs @@ -11,7 +11,7 @@ public class ConditionalAccessGrantControls : IParsable { public IDictionary AdditionalData { get; set; } /// List of values of built-in controls required by the policy. Possible values: block, mfa, compliantDevice, domainJoinedDevice, approvedApplication, compliantApplication, passwordChange, unknownFutureValue. public List BuiltInControls { get; set; } - /// List of custom controls IDs required by the policy. For more information, see Custom controls. + /// List of custom controls IDs required by the policy. To learn more about custom control, see Custom controls (preview). public List CustomAuthenticationFactors { get; set; } /// List of terms of use IDs required by the policy. public List TermsOfUse { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/ConditionalAccessRoot.cs b/src/generated/Models/Microsoft/Graph/ConditionalAccessRoot.cs index 818a1e57d07..cdb20fda3b2 100644 --- a/src/generated/Models/Microsoft/Graph/ConditionalAccessRoot.cs +++ b/src/generated/Models/Microsoft/Graph/ConditionalAccessRoot.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class ConditionalAccessRoot : Entity, IParsable { /// Read-only. Nullable. Returns a collection of the specified named locations. public List NamedLocations { get; set; } - /// Read-only. Nullable. Returns a collection of the specified Conditional Access (CA) policies. + /// Read-only. Nullable. Returns a collection of the specified Conditional Access policies. public List Policies { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/ConditionalAccessSessionControls.cs b/src/generated/Models/Microsoft/Graph/ConditionalAccessSessionControls.cs index cd7cd65822a..30e23085ebf 100644 --- a/src/generated/Models/Microsoft/Graph/ConditionalAccessSessionControls.cs +++ b/src/generated/Models/Microsoft/Graph/ConditionalAccessSessionControls.cs @@ -11,6 +11,8 @@ public class ConditionalAccessSessionControls : IParsable { public ApplicationEnforcedRestrictionsSessionControl ApplicationEnforcedRestrictions { get; set; } /// Session control to apply cloud app security. public CloudAppSecuritySessionControl CloudAppSecurity { get; set; } + /// Session control that determines whether it is acceptable for Azure AD to extend existing sessions based on information collected prior to an outage or not. + public bool? DisableResilienceDefaults { get; set; } /// Session control to define whether to persist cookies or not. All apps should be selected for this session control to work correctly. public PersistentBrowserSessionControl PersistentBrowser { get; set; } /// Session control to enforce signin frequency. @@ -28,6 +30,7 @@ public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"applicationEnforcedRestrictions", (o,n) => { (o as ConditionalAccessSessionControls).ApplicationEnforcedRestrictions = n.GetObjectValue(); } }, {"cloudAppSecurity", (o,n) => { (o as ConditionalAccessSessionControls).CloudAppSecurity = n.GetObjectValue(); } }, + {"disableResilienceDefaults", (o,n) => { (o as ConditionalAccessSessionControls).DisableResilienceDefaults = n.GetBoolValue(); } }, {"persistentBrowser", (o,n) => { (o as ConditionalAccessSessionControls).PersistentBrowser = n.GetObjectValue(); } }, {"signInFrequency", (o,n) => { (o as ConditionalAccessSessionControls).SignInFrequency = n.GetObjectValue(); } }, }; @@ -40,6 +43,7 @@ public void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("applicationEnforcedRestrictions", ApplicationEnforcedRestrictions); writer.WriteObjectValue("cloudAppSecurity", CloudAppSecurity); + writer.WriteBoolValue("disableResilienceDefaults", DisableResilienceDefaults); writer.WriteObjectValue("persistentBrowser", PersistentBrowser); writer.WriteObjectValue("signInFrequency", SignInFrequency); writer.WriteAdditionalData(AdditionalData); diff --git a/src/generated/Models/Microsoft/Graph/ConnectedOrganization.cs b/src/generated/Models/Microsoft/Graph/ConnectedOrganization.cs index 8594b2a695c..c52c076a11a 100644 --- a/src/generated/Models/Microsoft/Graph/ConnectedOrganization.cs +++ b/src/generated/Models/Microsoft/Graph/ConnectedOrganization.cs @@ -9,10 +9,11 @@ public class ConnectedOrganization : Entity, IParsable { public DateTimeOffset? CreatedDateTime { get; set; } /// The description of the connected organization. public string Description { get; set; } - /// The display name of the connected organization. + /// The display name of the connected organization. Supports $filter (eq). public string DisplayName { get; set; } /// Nullable. public List ExternalSponsors { get; set; } + /// The identity sources in this connected organization, one of azureActiveDirectoryTenant, domainIdentitySource or externalDomainFederation. Nullable. public List IdentitySources { get; set; } /// Nullable. public List InternalSponsors { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Contact.cs b/src/generated/Models/Microsoft/Graph/Contact.cs index f163ceb5f49..937ac9a7b6b 100644 --- a/src/generated/Models/Microsoft/Graph/Contact.cs +++ b/src/generated/Models/Microsoft/Graph/Contact.cs @@ -25,7 +25,7 @@ public class Contact : OutlookItem, IParsable { public string DisplayName { get; set; } /// The contact's email addresses. public List EmailAddresses { get; set; } - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. public List Extensions { get; set; } /// The name the contact is filed under. public string FileAs { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/ContentType.cs b/src/generated/Models/Microsoft/Graph/ContentType.cs index 957c333d4da..da6d1e3bd2e 100644 --- a/src/generated/Models/Microsoft/Graph/ContentType.cs +++ b/src/generated/Models/Microsoft/Graph/ContentType.cs @@ -7,15 +7,15 @@ namespace ApiSdk.Models.Microsoft.Graph { public class ContentType : Entity, IParsable { /// Parent contentType from which this content type is derived. public ContentType @Base { get; set; } - /// If true, the content type can't be modified unless this value is first set to false. + /// If true, the content type cannot be modified unless this value is first set to false. public bool? @ReadOnly { get; set; } - /// If true, the content type can't be modified by users or through push-down operations. Only site collection administrators can seal or unseal content types. + /// If true, the content type cannot be modified by users or through push-down operations. Only site collection administrators can seal or unseal content types. public bool? @Sealed { get; set; } - /// List of canonical URLs for hub sites with which this content type is associated to. This will contain all hub sites where this content type is queued to be enforced or is already enforced. Enforcing a content type means that the content type will be applied to the lists in the enforced sites. + /// List of canonical URLs for hub sites with which this content type is associated to. This will contain all hubsites where this content type is queued to be enforced or is already enforced. Enforcing a content type means that the content type will be applied to the lists in the enforced sites. public List AssociatedHubsUrls { get; set; } /// The collection of content types that are ancestors of this content type. public List BaseTypes { get; set; } - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type public List ColumnLinks { get; set; } /// Column order information in a content type. public List ColumnPositions { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Conversation.cs b/src/generated/Models/Microsoft/Graph/Conversation.cs index fe4b3a05eff..607f361ccc2 100644 --- a/src/generated/Models/Microsoft/Graph/Conversation.cs +++ b/src/generated/Models/Microsoft/Graph/Conversation.cs @@ -7,9 +7,9 @@ namespace ApiSdk.Models.Microsoft.Graph { public class Conversation : Entity, IParsable { /// Indicates whether any of the posts within this Conversation has at least one attachment. Supports $filter (eq, ne) and $search. public bool? HasAttachments { get; set; } - /// The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z + /// The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Supports $filter (eq, ne, le, ge). public DateTimeOffset? LastDeliveredDateTime { get; set; } - /// A short summary from the body of the latest post in this conversation. Supports $filter (eq, ne, le, ge). + /// A short summary from the body of the latest post in this conversation. public string Preview { get; set; } /// A collection of all the conversation threads in the conversation. A navigation property. Read-only. Nullable. public List Threads { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/ConversationThread.cs b/src/generated/Models/Microsoft/Graph/ConversationThread.cs index ad1b27e1d38..0f8ce7a757d 100644 --- a/src/generated/Models/Microsoft/Graph/ConversationThread.cs +++ b/src/generated/Models/Microsoft/Graph/ConversationThread.cs @@ -11,7 +11,7 @@ public class ConversationThread : Entity, IParsable { public bool? HasAttachments { get; set; } /// Indicates if the thread is locked. Returned by default. public bool? IsLocked { get; set; } - /// The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.Returned by default. + /// The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Returned by default. public DateTimeOffset? LastDeliveredDateTime { get; set; } /// Read-only. Nullable. public List Posts { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/DateTimeTimeZone.cs b/src/generated/Models/Microsoft/Graph/DateTimeTimeZone.cs index 87de429df29..56e329c26de 100644 --- a/src/generated/Models/Microsoft/Graph/DateTimeTimeZone.cs +++ b/src/generated/Models/Microsoft/Graph/DateTimeTimeZone.cs @@ -7,9 +7,9 @@ namespace ApiSdk.Models.Microsoft.Graph { public class DateTimeTimeZone : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// A single point of time in a combined date and time representation ({date}T{time}; for example, 2017-08-29T04:00:00.0000000). + /// A single point of time in a combined date and time representation ({date}T{time}). For example, '2019-04-16T09:00:00'. public string DateTime { get; set; } - /// Represents a time zone, for example, 'Pacific Standard Time'. See below for more possible values. + /// Represents a time zone, for example, 'Pacific Standard Time'. See below for possible values. public string TimeZone { get; set; } /// /// Instantiates a new dateTimeTimeZone and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/DelegatedPermissionClassification.cs b/src/generated/Models/Microsoft/Graph/DelegatedPermissionClassification.cs index 3bae27505a7..555af3f0da9 100644 --- a/src/generated/Models/Microsoft/Graph/DelegatedPermissionClassification.cs +++ b/src/generated/Models/Microsoft/Graph/DelegatedPermissionClassification.cs @@ -7,9 +7,9 @@ namespace ApiSdk.Models.Microsoft.Graph { public class DelegatedPermissionClassification : Entity, IParsable { /// The classification value being given. Possible value: low. Does not support $filter. public PermissionClassificationType? Classification { get; set; } - /// The unique identifier (id) for the delegated permission listed in the oauth2PermissionScopes collection of the servicePrincipal. Required on create. Does not support $filter. + /// The unique identifier (id) for the delegated permission listed in the publishedPermissionScopes collection of the servicePrincipal. Required on create. Does not support $filter. public string PermissionId { get; set; } - /// The claim value (value) for the delegated permission listed in the oauth2PermissionScopes collection of the servicePrincipal. Does not support $filter. + /// The claim value (value) for the delegated permission listed in the publishedPermissionScopes collection of the servicePrincipal. Does not support $filter. public string PermissionName { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/Device.cs b/src/generated/Models/Microsoft/Graph/Device.cs index 1583a088efd..21a4f950576 100644 --- a/src/generated/Models/Microsoft/Graph/Device.cs +++ b/src/generated/Models/Microsoft/Graph/Device.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class Device : DirectoryObject, IParsable { - /// true if the account is enabled; otherwise, false. Required. Default is true. Supports $filter (eq, ne, not, in). Only callers in Global Administrator and Cloud Device Administrator roles can set this property. + /// true if the account is enabled; otherwise, false. Default is true. Supports $filter (eq, ne, not, in). Only callers in Global Administrator and Cloud Device Administrator roles can set this property. public bool? AccountEnabled { get; set; } /// For internal use only. Not nullable. Supports $filter (eq, not, ge, le). public List AlternativeSecurityIds { get; set; } @@ -13,7 +13,7 @@ public class Device : DirectoryObject, IParsable { public DateTimeOffset? ApproximateLastSignInDateTime { get; set; } /// The timestamp when the device is no longer deemed compliant. The timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. public DateTimeOffset? ComplianceExpirationDateTime { get; set; } - /// Unique identifier set by Azure Device Registration Service at the time of registration. Supports $filter (eq, ne, not, startsWith). + /// Identifier set by Azure Device Registration Service at the time of registration. Supports $filter (eq, ne, not, startsWith). public string DeviceId { get; set; } /// For internal use only. Set to null. public string DeviceMetadata { get; set; } @@ -37,7 +37,7 @@ public class Device : DirectoryObject, IParsable { public bool? OnPremisesSyncEnabled { get; set; } /// The type of operating system on the device. Required. Supports $filter (eq, ne, not, ge, le, startsWith, and eq on null values). public string OperatingSystem { get; set; } - /// The version of the operating system on the device. Required. Supports $filter (eq, ne, not, ge, le, startsWith, and eq on null values). + /// Operating system version of the device. Required. Supports $filter (eq, ne, not, ge, le, startsWith, and eq on null values). public string OperatingSystemVersion { get; set; } /// For internal use only. Not nullable. Supports $filter (eq, not, ge, le, startsWith). public List PhysicalIds { get; set; } @@ -49,9 +49,9 @@ public class Device : DirectoryObject, IParsable { public List RegisteredUsers { get; set; } /// List of labels applied to the device by the system. public List SystemLabels { get; set; } - /// Groups that the device is a member of. This operation is transitive. Supports $expand. + /// Groups that this device is a member of. This operation is transitive. Supports $expand. public List TransitiveMemberOf { get; set; } - /// Type of trust for the joined device. Read-only. Possible values: Workplace (indicates bring your own personal devices), AzureAd (Cloud only joined devices), ServerAd (on-premises domain joined devices joined to Azure AD). For more details, see Introduction to device management in Azure Active Directory + /// Type of trust for the joined device. Read-only. Possible values: Workplace (indicates bring your own personal devices), AzureAd (Cloud only joined devices), ServerAd (on-premises domain joined devices joined to Azure AD). For more details, see Introduction to device management in Azure Active Directory public string TrustType { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/DeviceComplianceActionItem.cs b/src/generated/Models/Microsoft/Graph/DeviceComplianceActionItem.cs index 1c0b701aae5..a1f700472b9 100644 --- a/src/generated/Models/Microsoft/Graph/DeviceComplianceActionItem.cs +++ b/src/generated/Models/Microsoft/Graph/DeviceComplianceActionItem.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class DeviceComplianceActionItem : Entity, IParsable { - /// What action to take. Possible values are: noAction, notification, block, retire, wipe, removeResourceAccessProfiles, pushNotification. + /// What action to take. Possible values are: noAction, notification, block, retire, wipe, removeResourceAccessProfiles, pushNotification, remoteLock. public DeviceComplianceActionType? ActionType { get; set; } /// Number of hours to wait till the action will be enforced. Valid values 0 to 8760 public int? GracePeriodHours { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/DeviceCompliancePolicy.cs b/src/generated/Models/Microsoft/Graph/DeviceCompliancePolicy.cs index 786feea8754..32e555a5a37 100644 --- a/src/generated/Models/Microsoft/Graph/DeviceCompliancePolicy.cs +++ b/src/generated/Models/Microsoft/Graph/DeviceCompliancePolicy.cs @@ -21,7 +21,7 @@ public class DeviceCompliancePolicy : Entity, IParsable { public string DisplayName { get; set; } /// DateTime the object was last modified. public DateTimeOffset? LastModifiedDateTime { get; set; } - /// The list of scheduled action per rule for this compliance policy. This is a required property when creating any individual per-platform compliance policies. + /// The list of scheduled action for this rule public List ScheduledActionsForRule { get; set; } /// List of DeviceComplianceUserStatus. public List UserStatuses { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/DeviceCompliancePolicySettingStateSummary.cs b/src/generated/Models/Microsoft/Graph/DeviceCompliancePolicySettingStateSummary.cs index 34fc333a237..6a91e5f696f 100644 --- a/src/generated/Models/Microsoft/Graph/DeviceCompliancePolicySettingStateSummary.cs +++ b/src/generated/Models/Microsoft/Graph/DeviceCompliancePolicySettingStateSummary.cs @@ -17,7 +17,7 @@ public class DeviceCompliancePolicySettingStateSummary : Entity, IParsable { public int? NonCompliantDeviceCount { get; set; } /// Number of not applicable devices public int? NotApplicableDeviceCount { get; set; } - /// Setting platform. Possible values are: android, iOS, macOS, windowsPhone81, windows81AndLater, windows10AndLater, androidWorkProfile, all. + /// Setting platform. Possible values are: android, androidForWork, iOS, macOS, windowsPhone81, windows81AndLater, windows10AndLater, androidWorkProfile, windows10XProfile, androidAOSP, all. public PolicyPlatformType? PlatformType { get; set; } /// Number of remediated devices public int? RemediatedDeviceCount { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/DeviceDetail.cs b/src/generated/Models/Microsoft/Graph/DeviceDetail.cs index 57538676416..86bcd0c3a3c 100644 --- a/src/generated/Models/Microsoft/Graph/DeviceDetail.cs +++ b/src/generated/Models/Microsoft/Graph/DeviceDetail.cs @@ -7,19 +7,19 @@ namespace ApiSdk.Models.Microsoft.Graph { public class DeviceDetail : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Indicates the browser information of the used for signing in. + /// Indicates the browser information of the used for signing-in. public string Browser { get; set; } - /// Refers to the UniqueID of the device used for signing in. + /// Refers to the UniqueID of the device used for signing-in. public string DeviceId { get; set; } - /// Refers to the name of the device used for signing in. + /// Refers to the name of the device used for signing-in. public string DisplayName { get; set; } - /// Indicates whether the device is compliant. + /// Indicates whether the device is compliant or not. public bool? IsCompliant { get; set; } - /// Indicates whether the device is managed. + /// Indicates if the device is managed or not. public bool? IsManaged { get; set; } - /// Indicates the operating system name and version used for signing in. + /// Indicates the OS name and version used for signing-in. public string OperatingSystem { get; set; } - /// Provides information about whether the signed-in device is Workplace Joined, AzureAD Joined, Domain Joined. + /// Indicates information on whether the signed-in device is Workplace Joined, AzureAD Joined, Domain Joined. public string TrustType { get; set; } /// /// Instantiates a new deviceDetail and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/DeviceManagement.cs b/src/generated/Models/Microsoft/Graph/DeviceManagement.cs index 3f150ecc5fa..aafe0f52a44 100644 --- a/src/generated/Models/Microsoft/Graph/DeviceManagement.cs +++ b/src/generated/Models/Microsoft/Graph/DeviceManagement.cs @@ -33,7 +33,7 @@ public class DeviceManagement : Entity, IParsable { public List ExchangeConnectors { get; set; } /// Collection of imported Windows autopilot devices. public List ImportedWindowsAutopilotDeviceIdentities { get; set; } - /// Intune Account Id for given tenant + /// Intune Account ID for given tenant public string IntuneAccountId { get; set; } /// intuneBrand contains data which is used in customizing the appearance of the Company Portal applications as well as the end user web portal. public IntuneBrand IntuneBrand { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/DirectoryAudit.cs b/src/generated/Models/Microsoft/Graph/DirectoryAudit.cs index 2be4a290ef6..d862268ba66 100644 --- a/src/generated/Models/Microsoft/Graph/DirectoryAudit.cs +++ b/src/generated/Models/Microsoft/Graph/DirectoryAudit.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class DirectoryAudit : Entity, IParsable { /// Indicates the date and time the activity was performed. The Timestamp type is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. public DateTimeOffset? ActivityDateTime { get; set; } - /// Indicates the activity name or the operation name (examples: 'Create User' and 'Add member to group'). For full list, see Azure AD activity list. + /// Indicates the activity name or the operation name (E.g. 'Create User', 'Add member to group'). For a list of activities logged, refer to Azure Ad activity list. public string ActivityDisplayName { get; set; } /// Indicates additional details on the activity. public List AdditionalDetails { get; set; } @@ -23,7 +23,7 @@ public class DirectoryAudit : Entity, IParsable { public OperationResult? Result { get; set; } /// Indicates the reason for failure if the result is failure or timeout. public string ResultReason { get; set; } - /// Indicates information on which resource was changed due to the activity. Target Resource Type can be User, Device, Directory, App, Role, Group, Policy or Other. + /// Information about the resource that changed due to the activity. public List TargetResources { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/DocumentSet.cs b/src/generated/Models/Microsoft/Graph/DocumentSet.cs index fd7373d8f84..b2901492f2e 100644 --- a/src/generated/Models/Microsoft/Graph/DocumentSet.cs +++ b/src/generated/Models/Microsoft/Graph/DocumentSet.cs @@ -14,7 +14,7 @@ public class DocumentSet : IParsable { /// Specifies whether to push welcome page changes to inherited content types. public bool? PropagateWelcomePageChanges { get; set; } public List SharedColumns { get; set; } - /// Add the name of the document set to each file name. + /// Add the name of the Document Set to each file name. public bool? ShouldPrefixNameToFile { get; set; } public List WelcomePageColumns { get; set; } /// Welcome page absolute URL. diff --git a/src/generated/Models/Microsoft/Graph/DocumentSetContent.cs b/src/generated/Models/Microsoft/Graph/DocumentSetContent.cs index 5e92a2c19ef..1a5167d5661 100644 --- a/src/generated/Models/Microsoft/Graph/DocumentSetContent.cs +++ b/src/generated/Models/Microsoft/Graph/DocumentSetContent.cs @@ -9,7 +9,7 @@ public class DocumentSetContent : IParsable { public IDictionary AdditionalData { get; set; } /// Content type information of the file. public ContentTypeInfo ContentType { get; set; } - /// Name of the file in resource folder that should be added as a default content or a template in the document set. + /// Name of the file in resource folder that should be added as a default content or a template in the document set public string FileName { get; set; } /// Folder name in which the file will be placed when a new document set is created in the library. public string FolderName { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Domain.cs b/src/generated/Models/Microsoft/Graph/Domain.cs index 3d4644d78d1..126fc993440 100644 --- a/src/generated/Models/Microsoft/Graph/Domain.cs +++ b/src/generated/Models/Microsoft/Graph/Domain.cs @@ -31,7 +31,7 @@ public class Domain : Entity, IParsable { public List ServiceConfigurationRecords { get; set; } /// Status of asynchronous operations scheduled for the domain. public DomainState State { get; set; } - /// The capabilities assigned to the domain. Can include 0, 1 or more of following values: Email, Sharepoint, EmailInternalRelayOnly, OfficeCommunicationsOnline, SharePointDefaultDomain, FullRedelegation, SharePointPublic, OrgIdAuthentication, Yammer, Intune. The values which you can add/remove using Graph API include: Email, OfficeCommunicationsOnline, Yammer. Not nullable + /// The capabilities assigned to the domain. Can include 0, 1 or more of following values: Email, Sharepoint, EmailInternalRelayOnly, OfficeCommunicationsOnline,SharePointDefaultDomain, FullRedelegation, SharePointPublic, OrgIdAuthentication, Yammer, Intune. The values which you can add/remove using Graph API include: Email, OfficeCommunicationsOnline, Yammer. Not nullable public List SupportedServices { get; set; } /// DNS records that the customer adds to the DNS zone file of the domain before the customer can complete domain ownership verification with Azure AD. Read-only, Nullable public List VerificationDnsRecords { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/DriveItem.cs b/src/generated/Models/Microsoft/Graph/DriveItem.cs index 7ac25ddc70c..21b25f02b65 100644 --- a/src/generated/Models/Microsoft/Graph/DriveItem.cs +++ b/src/generated/Models/Microsoft/Graph/DriveItem.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class DriveItem : BaseItem, IParsable { /// Analytics about the view activities that took place on this item. public ItemAnalytics Analytics { get; set; } - /// Audio metadata, if the item is an audio file. Read-only. + /// Audio metadata, if the item is an audio file. Read-only. Only on OneDrive Personal. public Audio Audio { get; set; } public Bundle Bundle { get; set; } /// Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable. @@ -34,7 +34,7 @@ public class DriveItem : BaseItem, IParsable { public Malware Malware { get; set; } /// If present, indicates that this item is a package instead of a folder or file. Packages are treated like files in some contexts and folders in others. Read-only. public Package Package { get; set; } - /// If present, indicates that one or more operations that might affect the state of the driveItem are pending completion. Read-only. + /// If present, indicates that indicates that one or more operations that may affect the state of the driveItem are pending completion. Read-only. public PendingOperations PendingOperations { get; set; } /// The set of permissions for the item. Read-only. Nullable. public List Permissions { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/DriveItemVersion.cs b/src/generated/Models/Microsoft/Graph/DriveItemVersion.cs index 0a3ad883f9b..bcdd4e26b35 100644 --- a/src/generated/Models/Microsoft/Graph/DriveItemVersion.cs +++ b/src/generated/Models/Microsoft/Graph/DriveItemVersion.cs @@ -5,7 +5,6 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class DriveItemVersion : BaseItemVersion, IParsable { - /// The content stream for this version of the item. public byte[] Content { get; set; } /// Indicates the size of the content stream for this version of the item. public long? Size { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/EducationAddToCalendarOptions.cs b/src/generated/Models/Microsoft/Graph/EducationAddToCalendarOptions.cs new file mode 100644 index 00000000000..09aff40d17c --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/EducationAddToCalendarOptions.cs @@ -0,0 +1,9 @@ +namespace ApiSdk.Models.Microsoft.Graph { + public enum EducationAddToCalendarOptions { + None, + StudentsAndPublisher, + StudentsAndTeamOwners, + UnknownFutureValue, + StudentsOnly, + } +} diff --git a/src/generated/Models/Microsoft/Graph/EducationAssignment.cs b/src/generated/Models/Microsoft/Graph/EducationAssignment.cs index 5d12002a257..0762825ac95 100644 --- a/src/generated/Models/Microsoft/Graph/EducationAssignment.cs +++ b/src/generated/Models/Microsoft/Graph/EducationAssignment.cs @@ -7,11 +7,13 @@ namespace ApiSdk.Models.Microsoft.Graph { public class EducationAssignment : Entity, IParsable { /// Optional field to control the assignment behavior for students who are added after the assignment is published. If not specified, defaults to none value. Currently supports only two values: none or assignIfOpen. public EducationAddedStudentAction? AddedStudentAction { get; set; } - /// Identifies whether students can submit after the due date. If this property isn't specified during create, it defaults to true. + /// Optional field to control the assignment behavior for adding assignments to students' and teachers' calendars when the assignment is published. The possible values are: none, studentsAndPublisher, studentsAndTeamOwners, unknownFutureValue, and studentsOnly. Note that you must use the Prefer: include-unknown-enum-members request header to get the following value(s) in this evolvable enum: studentsOnly. The default value is none. + public EducationAddToCalendarOptions? AddToCalendarAction { get; set; } + /// Identifies whether students can submit after the due date. If this property is not specified during create, it defaults to true. public bool? AllowLateSubmissions { get; set; } /// Identifies whether students can add their own resources to a submission or if they can only modify resources added by the teacher. public bool? AllowStudentsToAddResourcesToSubmission { get; set; } - /// The date when the assignment should become active. If in the future, the assignment isn't shown to the student until this date. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z + /// The date when the assignment should become active. If in the future, the assignment is not shown to the student until this date. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z public DateTimeOffset? AssignDateTime { get; set; } /// The moment that the assignment was published to students and the assignment shows up on the students timeline. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z public DateTimeOffset? AssignedDateTime { get; set; } @@ -39,7 +41,7 @@ public class EducationAssignment : Entity, IParsable { public IdentitySet LastModifiedBy { get; set; } /// Moment when the assignment was last modified. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z public DateTimeOffset? LastModifiedDateTime { get; set; } - /// Optional field to specify the URL of the channel to post the assignment publish notification. If not specified or null, defaults to the General channel. This field only applies to assignments where the assignTo value is educationAssignmentClassRecipient. Updating the notificationChannelUrl isn't allowed after the assignment has been published. + /// Optional field to specify the URL of the channel to post the assignment publish notification. If not specified or null, defaults to the General channel. This field only applies to assignments where the assignTo value is educationAssignmentClassRecipient. Updating the notificationChannelUrl is not allowed after the assignment has been published. public string NotificationChannelUrl { get; set; } /// Learning objects that are associated with this assignment. Only teachers can modify this list. Nullable. public List Resources { get; set; } @@ -47,7 +49,7 @@ public class EducationAssignment : Entity, IParsable { public string ResourcesFolderUrl { get; set; } /// When set, the grading rubric attached to this assignment. public EducationRubric Rubric { get; set; } - /// Status of the Assignment. You can't PATCH this value. Possible values are: draft, scheduled, published, assigned. + /// Status of the Assignment. You can not PATCH this value. Possible values are: draft, scheduled, published, assigned. public EducationAssignmentStatus? Status { get; set; } /// Once published, there is a submission object for each student representing their work and grade. Read-only. Nullable. public List Submissions { get; set; } @@ -59,6 +61,7 @@ public class EducationAssignment : Entity, IParsable { public new IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { {"addedStudentAction", (o,n) => { (o as EducationAssignment).AddedStudentAction = n.GetEnumValue(); } }, + {"addToCalendarAction", (o,n) => { (o as EducationAssignment).AddToCalendarAction = n.GetEnumValue(); } }, {"allowLateSubmissions", (o,n) => { (o as EducationAssignment).AllowLateSubmissions = n.GetBoolValue(); } }, {"allowStudentsToAddResourcesToSubmission", (o,n) => { (o as EducationAssignment).AllowStudentsToAddResourcesToSubmission = n.GetBoolValue(); } }, {"assignDateTime", (o,n) => { (o as EducationAssignment).AssignDateTime = n.GetDateTimeOffsetValue(); } }, @@ -92,6 +95,7 @@ public class EducationAssignment : Entity, IParsable { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteEnumValue("addedStudentAction", AddedStudentAction); + writer.WriteEnumValue("addToCalendarAction", AddToCalendarAction); writer.WriteBoolValue("allowLateSubmissions", AllowLateSubmissions); writer.WriteBoolValue("allowStudentsToAddResourcesToSubmission", AllowStudentsToAddResourcesToSubmission); writer.WriteDateTimeOffsetValue("assignDateTime", AssignDateTime); diff --git a/src/generated/Models/Microsoft/Graph/EducationAssignmentDefaults.cs b/src/generated/Models/Microsoft/Graph/EducationAssignmentDefaults.cs index 55e0020aef6..183c6a691c9 100644 --- a/src/generated/Models/Microsoft/Graph/EducationAssignmentDefaults.cs +++ b/src/generated/Models/Microsoft/Graph/EducationAssignmentDefaults.cs @@ -7,6 +7,8 @@ namespace ApiSdk.Models.Microsoft.Graph { public class EducationAssignmentDefaults : Entity, IParsable { /// Class-level default behavior for handling students who are added after the assignment is published. Possible values are: none, assignIfOpen. public EducationAddedStudentAction? AddedStudentAction { get; set; } + /// Optional field to control adding assignments to students' and teachers' calendars when the assignment is published. The possible values are: none, studentsAndPublisher, studentsAndTeamOwners, unknownFutureValue, and studentsOnly. Note that you must use the Prefer: include-unknown-enum-members request header to get the following value(s) in this evolvable enum: studentsOnly. The default value is none. + public EducationAddToCalendarOptions? AddToCalendarAction { get; set; } /// Class-level default value for due time field. Default value is 23:59:00. public string DueTime { get; set; } /// Default Teams channel to which notifications will be sent. Default value is null. @@ -17,6 +19,7 @@ public class EducationAssignmentDefaults : Entity, IParsable { public new IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { {"addedStudentAction", (o,n) => { (o as EducationAssignmentDefaults).AddedStudentAction = n.GetEnumValue(); } }, + {"addToCalendarAction", (o,n) => { (o as EducationAssignmentDefaults).AddToCalendarAction = n.GetEnumValue(); } }, {"dueTime", (o,n) => { (o as EducationAssignmentDefaults).DueTime = n.GetStringValue(); } }, {"notificationChannelUrl", (o,n) => { (o as EducationAssignmentDefaults).NotificationChannelUrl = n.GetStringValue(); } }, }; @@ -29,6 +32,7 @@ public class EducationAssignmentDefaults : Entity, IParsable { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteEnumValue("addedStudentAction", AddedStudentAction); + writer.WriteEnumValue("addToCalendarAction", AddToCalendarAction); writer.WriteStringValue("dueTime", DueTime); writer.WriteStringValue("notificationChannelUrl", NotificationChannelUrl); } diff --git a/src/generated/Models/Microsoft/Graph/EducationClass.cs b/src/generated/Models/Microsoft/Graph/EducationClass.cs index a31f8681cd9..d4b2f5e28e3 100644 --- a/src/generated/Models/Microsoft/Graph/EducationClass.cs +++ b/src/generated/Models/Microsoft/Graph/EducationClass.cs @@ -14,7 +14,7 @@ public class EducationClass : Entity, IParsable { public string ClassCode { get; set; } /// Course information for the class. public EducationCourse Course { get; set; } - /// Entity who created the class + /// Entity who created the class. public IdentitySet CreatedBy { get; set; } /// Description of the class. public string Description { get; set; } @@ -24,7 +24,7 @@ public class EducationClass : Entity, IParsable { public string ExternalId { get; set; } /// Name of the class in the syncing system. public string ExternalName { get; set; } - /// How this class was created. Possible values are: sis, manual. + /// The type of external source this resource was generated from (automatically determined from externalSourceDetail). Possible values are: sis, lms, or manual. public EducationExternalSource? ExternalSource { get; set; } /// The name of the external source this resources was generated from. public string ExternalSourceDetail { get; set; } @@ -40,7 +40,7 @@ public class EducationClass : Entity, IParsable { public List Schools { get; set; } /// All teachers in the class. Nullable. public List Teachers { get; set; } - /// Term for this class. + /// Term for the class. public EducationTerm Term { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/EducationOrganization.cs b/src/generated/Models/Microsoft/Graph/EducationOrganization.cs index f48d6d81a46..2034fe908ce 100644 --- a/src/generated/Models/Microsoft/Graph/EducationOrganization.cs +++ b/src/generated/Models/Microsoft/Graph/EducationOrganization.cs @@ -9,7 +9,7 @@ public class EducationOrganization : Entity, IParsable { public string Description { get; set; } /// Organization display name. public string DisplayName { get; set; } - /// Source where this organization was created from. Possible values are: sis, manual. + /// Where this user was created from. Possible values are: sis, lms, or manual. public EducationExternalSource? ExternalSource { get; set; } /// The name of the external source this resources was generated from. public string ExternalSourceDetail { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/EducationResource.cs b/src/generated/Models/Microsoft/Graph/EducationResource.cs index 7676e82f7dd..063080700c0 100644 --- a/src/generated/Models/Microsoft/Graph/EducationResource.cs +++ b/src/generated/Models/Microsoft/Graph/EducationResource.cs @@ -7,15 +7,15 @@ namespace ApiSdk.Models.Microsoft.Graph { public class EducationResource : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The individual who created the resource. + /// Who created the resource. public IdentitySet CreatedBy { get; set; } - /// Moment in time when the resource was created. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z + /// The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z public DateTimeOffset? CreatedDateTime { get; set; } /// Display name of resource. public string DisplayName { get; set; } - /// The last user to modify the resource. + /// Who was the last user to modify the resource. public IdentitySet LastModifiedBy { get; set; } - /// Moment in time when the resource was last modified. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. + /// Moment in time when the resource was last modified. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z public DateTimeOffset? LastModifiedDateTime { get; set; } /// /// Instantiates a new educationResource and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/EducationStudent.cs b/src/generated/Models/Microsoft/Graph/EducationStudent.cs index 8d6f25b38fd..80f068f4d05 100644 --- a/src/generated/Models/Microsoft/Graph/EducationStudent.cs +++ b/src/generated/Models/Microsoft/Graph/EducationStudent.cs @@ -11,7 +11,7 @@ public class EducationStudent : IParsable { public string BirthDate { get; set; } /// ID of the student in the source system. public string ExternalId { get; set; } - /// The possible values are: female, male, other, unknownFutureValue. + /// Possible values are: female, male, other. public EducationGender? Gender { get; set; } /// Current grade level of the student. public string Grade { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/EducationSubmission.cs b/src/generated/Models/Microsoft/Graph/EducationSubmission.cs index bdfefdde985..a8df09a7de5 100644 --- a/src/generated/Models/Microsoft/Graph/EducationSubmission.cs +++ b/src/generated/Models/Microsoft/Graph/EducationSubmission.cs @@ -7,6 +7,10 @@ namespace ApiSdk.Models.Microsoft.Graph { public class EducationSubmission : Entity, IParsable { /// Read-Write. Nullable. public List Outcomes { get; set; } + /// User who moved the status of this submission to reassigned. + public IdentitySet ReassignedBy { get; set; } + /// Moment in time when the submission was reassigned. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z + public DateTimeOffset? ReassignedDateTime { get; set; } /// Who this submission is assigned to. public EducationSubmissionRecipient Recipient { get; set; } /// Nullable. @@ -17,7 +21,7 @@ public class EducationSubmission : Entity, IParsable { public IdentitySet ReturnedBy { get; set; } /// Moment in time when the submission was returned. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z public DateTimeOffset? ReturnedDateTime { get; set; } - /// Read-Only. Possible values are: working, submitted, released, returned. + /// Read-only. Possible values are: working, submitted, released, returned, unknownFutureValue and reassigned. Note that you must use the Prefer: include-unknown-enum-members request header to get the following value(s) in this evolvable enum: reassigned. public EducationSubmissionStatus? Status { get; set; } /// User who moved the resource into the submitted state. public IdentitySet SubmittedBy { get; set; } @@ -35,6 +39,8 @@ public class EducationSubmission : Entity, IParsable { public new IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { {"outcomes", (o,n) => { (o as EducationSubmission).Outcomes = n.GetCollectionOfObjectValues().ToList(); } }, + {"reassignedBy", (o,n) => { (o as EducationSubmission).ReassignedBy = n.GetObjectValue(); } }, + {"reassignedDateTime", (o,n) => { (o as EducationSubmission).ReassignedDateTime = n.GetDateTimeOffsetValue(); } }, {"recipient", (o,n) => { (o as EducationSubmission).Recipient = n.GetObjectValue(); } }, {"resources", (o,n) => { (o as EducationSubmission).Resources = n.GetCollectionOfObjectValues().ToList(); } }, {"resourcesFolderUrl", (o,n) => { (o as EducationSubmission).ResourcesFolderUrl = n.GetStringValue(); } }, @@ -56,6 +62,8 @@ public class EducationSubmission : Entity, IParsable { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteCollectionOfObjectValues("outcomes", Outcomes); + writer.WriteObjectValue("reassignedBy", ReassignedBy); + writer.WriteDateTimeOffsetValue("reassignedDateTime", ReassignedDateTime); writer.WriteObjectValue("recipient", Recipient); writer.WriteCollectionOfObjectValues("resources", Resources); writer.WriteStringValue("resourcesFolderUrl", ResourcesFolderUrl); diff --git a/src/generated/Models/Microsoft/Graph/EducationSubmissionStatus.cs b/src/generated/Models/Microsoft/Graph/EducationSubmissionStatus.cs index 87888cb1acc..25442c0ce89 100644 --- a/src/generated/Models/Microsoft/Graph/EducationSubmissionStatus.cs +++ b/src/generated/Models/Microsoft/Graph/EducationSubmissionStatus.cs @@ -5,5 +5,6 @@ public enum EducationSubmissionStatus { Released, Returned, UnknownFutureValue, + Reassigned, } } diff --git a/src/generated/Models/Microsoft/Graph/EducationTeacher.cs b/src/generated/Models/Microsoft/Graph/EducationTeacher.cs index 3a2556eaab5..426974e143b 100644 --- a/src/generated/Models/Microsoft/Graph/EducationTeacher.cs +++ b/src/generated/Models/Microsoft/Graph/EducationTeacher.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class EducationTeacher : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// ID of the teacher in the source system. + /// Id of the Teacher in external source system. public string ExternalId { get; set; } /// Teacher number. public string TeacherNumber { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/EducationUser.cs b/src/generated/Models/Microsoft/Graph/EducationUser.cs index 1c8b4556af8..576a5453f59 100644 --- a/src/generated/Models/Microsoft/Graph/EducationUser.cs +++ b/src/generated/Models/Microsoft/Graph/EducationUser.cs @@ -5,55 +5,57 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class EducationUser : Entity, IParsable { - /// True if the account is enabled; otherwise, false. This property is required when a user is created. Supports $filter. + /// True if the account is enabled; otherwise, false. This property is required when a user is created. Supports /$filter. public bool? AccountEnabled { get; set; } /// The licenses that are assigned to the user. Not nullable. public List AssignedLicenses { get; set; } /// The plans that are assigned to the user. Read-only. Not nullable. public List AssignedPlans { get; set; } + /// List of assignments for the user. Nullable. + public List Assignments { get; set; } /// The telephone numbers for the user. Note: Although this is a string collection, only one number can be set for this property. public List BusinessPhones { get; set; } /// Classes to which the user belongs. Nullable. public List Classes { get; set; } /// Entity who created the user. public IdentitySet CreatedBy { get; set; } - /// The name for the department in which the user works. Supports $filter. + /// The name for the department in which the user works. Supports /$filter. public string Department { get; set; } - /// The name displayed in the address book for the user. This is usually the combination of the user's first name, middle initial, and last name. This property is required when a user is created and it cannot be cleared during updates. Supports $filter and $orderby. + /// The name displayed in the address book for the user. Supports $filter and $orderby. public string DisplayName { get; set; } - /// Where this user was created from. Possible values are: sis, manual. + /// The type of external source this resource was generated from (automatically determined from externalSourceDetail). Possible values are: sis, lms, or manual. public EducationExternalSource? ExternalSource { get; set; } /// The name of the external source this resources was generated from. public string ExternalSourceDetail { get; set; } - /// The given name (first name) of the user. Supports $filter. + /// The given name (first name) of the user. Supports /$filter. public string GivenName { get; set; } - /// The SMTP address for the user; for example, jeff@contoso.onmicrosoft.com. Read-Only. Supports $filter. + /// The SMTP address for the user; for example, 'jeff@contoso.onmicrosoft.com'. Read-Only. Supports /$filter. public string Mail { get; set; } - /// Mail address of user. + /// Mail address of user. Note: type and postOfficeBox are not supported for educationUser resources. public PhysicalAddress MailingAddress { get; set; } - /// The mail alias for the user. This property must be specified when a user is created. Supports $filter. + /// The mail alias for the user. This property must be specified when a user is created. Supports /$filter. public string MailNickname { get; set; } /// The middle name of user. public string MiddleName { get; set; } /// The primary cellular telephone number for the user. public string MobilePhone { get; set; } public string OfficeLocation { get; set; } - /// Additional information used to associate the Azure AD user with its Active Directory counterpart. + /// Additional information used to associate the AAD user with it's Active Directory counterpart. public EducationOnPremisesInfo OnPremisesInfo { get; set; } - /// Specifies password policies for the user. This value is an enumeration with one possible value being DisableStrongPassword, which allows weaker passwords than the default policy to be specified. DisablePasswordExpiration can also be specified. The two can be specified together; for example: DisablePasswordExpiration, DisableStrongPassword. + /// Specifies password policies for the user. See standard [user] resource for additional details. public string PasswordPolicies { get; set; } - /// Specifies the password profile for the user. The profile contains the user's password. This property is required when a user is created. The password in the profile must satisfy minimum requirements as specified by the passwordPolicies property. By default, a strong password is required. + /// Specifies the password profile for the user. The profile contains the user's password. This property is required when a user is created. See standard [user] resource for additional details. public PasswordProfile PasswordProfile { get; set; } /// The preferred language for the user. Should follow ISO 639-1 Code; for example, 'en-US'. public string PreferredLanguage { get; set; } - /// Default role for a user. The user's role might be different in an individual class. Possible values are: student, teacher, none, unknownFutureValue. + /// Default role for a user. The user's role might be different in an individual class. Possible values are: student, teacher, faculty. Supports /$filter. public EducationUserRole? PrimaryRole { get; set; } /// The plans that are provisioned for the user. Read-only. Not nullable. public List ProvisionedPlans { get; set; } public DateTimeOffset? RefreshTokensValidFromDateTime { get; set; } /// Related records related to the user. Possible relationships are parent, relative, aide, doctor, guardian, child, other, unknownFutureValue public List RelatedContacts { get; set; } - /// Address where user lives. + /// Address where user lives. Note: type and postOfficeBox are not supported for educationUser resources. public PhysicalAddress ResidenceAddress { get; set; } public List Rubrics { get; set; } /// Schools to which the user belongs. Nullable. @@ -62,19 +64,19 @@ public class EducationUser : Entity, IParsable { public bool? ShowInAddressList { get; set; } /// If the primary role is student, this block will contain student specific data. public EducationStudent Student { get; set; } - /// The user's surname (family name or last name). Supports $filter. + /// The user's surname (family name or last name). Supports /$filter. public string Surname { get; set; } /// Classes for which the user is a teacher. public List TaughtClasses { get; set; } /// If the primary role is teacher, this block will contain teacher specific data. public EducationTeacher Teacher { get; set; } - /// A two-letter country code (ISO standard 3166). Required for users who will be assigned licenses due to a legal requirement to check for availability of services in countries or regions. Examples include: 'US', 'JP', and 'GB'. Not nullable. Supports $filter. + /// A two-letter country code ([ISO 3166 Alpha-2]). Required for users who will be assigned licenses. Not nullable. Supports /$filter. public string UsageLocation { get; set; } /// The directory user corresponding to this user. public ApiSdk.Models.Microsoft.Graph.User User { get; set; } - /// The user principal name (UPN) of the user. The UPN is an Internet-style login name for the user based on the Internet standard RFC 822. By convention, this should map to the user's email name. The general format is alias@domain, where domain must be present in the tenant's collection of verified domains. This property is required when a user is created. The verified domains for the tenant can be accessed from the verifiedDomains property of organization. Supports $filter and $orderby. + /// The user principal name (UPN) for the user. Supports $filter and $orderby. See standard [user] resource for additional details. public string UserPrincipalName { get; set; } - /// A string value that can be used to classify user types in your directory, such as 'Member' and 'Guest'. Supports $filter. + /// A string value that can be used to classify user types in your directory, such as 'Member' and 'Guest'. Supports /$filter. public string UserType { get; set; } /// /// The deserialization information for the current model @@ -84,6 +86,7 @@ public class EducationUser : Entity, IParsable { {"accountEnabled", (o,n) => { (o as EducationUser).AccountEnabled = n.GetBoolValue(); } }, {"assignedLicenses", (o,n) => { (o as EducationUser).AssignedLicenses = n.GetCollectionOfObjectValues().ToList(); } }, {"assignedPlans", (o,n) => { (o as EducationUser).AssignedPlans = n.GetCollectionOfObjectValues().ToList(); } }, + {"assignments", (o,n) => { (o as EducationUser).Assignments = n.GetCollectionOfObjectValues().ToList(); } }, {"businessPhones", (o,n) => { (o as EducationUser).BusinessPhones = n.GetCollectionOfPrimitiveValues().ToList(); } }, {"classes", (o,n) => { (o as EducationUser).Classes = n.GetCollectionOfObjectValues().ToList(); } }, {"createdBy", (o,n) => { (o as EducationUser).CreatedBy = n.GetObjectValue(); } }, @@ -130,6 +133,7 @@ public class EducationUser : Entity, IParsable { writer.WriteBoolValue("accountEnabled", AccountEnabled); writer.WriteCollectionOfObjectValues("assignedLicenses", AssignedLicenses); writer.WriteCollectionOfObjectValues("assignedPlans", AssignedPlans); + writer.WriteCollectionOfObjectValues("assignments", Assignments); writer.WriteCollectionOfPrimitiveValues("businessPhones", BusinessPhones); writer.WriteCollectionOfObjectValues("classes", Classes); writer.WriteObjectValue("createdBy", CreatedBy); diff --git a/src/generated/Models/Microsoft/Graph/EmailAddress.cs b/src/generated/Models/Microsoft/Graph/EmailAddress.cs index 64de8722f46..f3139c74109 100644 --- a/src/generated/Models/Microsoft/Graph/EmailAddress.cs +++ b/src/generated/Models/Microsoft/Graph/EmailAddress.cs @@ -7,9 +7,9 @@ namespace ApiSdk.Models.Microsoft.Graph { public class EmailAddress : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The email address of the person or entity. + /// The email address of an entity instance. public string Address { get; set; } - /// The display name of the person or entity. + /// The display name of an entity instance. public string Name { get; set; } /// /// Instantiates a new emailAddress and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/EntitlementManagement.cs b/src/generated/Models/Microsoft/Graph/EntitlementManagement.cs index c0b8d78141d..48d97cce518 100644 --- a/src/generated/Models/Microsoft/Graph/EntitlementManagement.cs +++ b/src/generated/Models/Microsoft/Graph/EntitlementManagement.cs @@ -6,11 +6,17 @@ namespace ApiSdk.Models.Microsoft.Graph { public class EntitlementManagement : Entity, IParsable { public List AccessPackageAssignmentApprovals { get; set; } + /// Represents access package objects. public List AccessPackages { get; set; } + /// Represents access package assignment requests created by or on behalf of a user. public List AssignmentRequests { get; set; } + /// Represents the grant of an access package to a subject (user or group). public List Assignments { get; set; } + /// Represents a group of access packages. public List Catalogs { get; set; } + /// Represents references to a directory or domain of another organization whose users can request access. public List ConnectedOrganizations { get; set; } + /// Represents the settings that control the behavior of Azure AD entitlement management. public EntitlementManagementSettings Settings { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/EntitlementManagementSchedule.cs b/src/generated/Models/Microsoft/Graph/EntitlementManagementSchedule.cs index 2cf1af6043c..852c1490f46 100644 --- a/src/generated/Models/Microsoft/Graph/EntitlementManagementSchedule.cs +++ b/src/generated/Models/Microsoft/Graph/EntitlementManagementSchedule.cs @@ -7,8 +7,11 @@ namespace ApiSdk.Models.Microsoft.Graph { public class EntitlementManagementSchedule : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } + /// When the access should expire. public ExpirationPattern Expiration { get; set; } + /// For recurring access. Not used at present. public PatternedRecurrence Recurrence { get; set; } + /// The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. public DateTimeOffset? StartDateTime { get; set; } /// /// Instantiates a new entitlementManagementSchedule and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/EntitlementManagementSettings.cs b/src/generated/Models/Microsoft/Graph/EntitlementManagementSettings.cs index 1e7751aa009..9a13009d4dc 100644 --- a/src/generated/Models/Microsoft/Graph/EntitlementManagementSettings.cs +++ b/src/generated/Models/Microsoft/Graph/EntitlementManagementSettings.cs @@ -5,6 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class EntitlementManagementSettings : Entity, IParsable { + /// If externalUserLifecycleAction is blockSignInAndDelete, the duration, typically a number of days, after an external user is blocked from sign in before their account is deleted. public string DurationUntilExternalUserDeletedAfterBlocked { get; set; } /// One of None, BlockSignIn, or BlockSignInAndDelete. public AccessPackageExternalUserLifecycleAction? ExternalUserLifecycleAction { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/ExcludeTarget.cs b/src/generated/Models/Microsoft/Graph/ExcludeTarget.cs index d2010ec1704..81bcb2455c6 100644 --- a/src/generated/Models/Microsoft/Graph/ExcludeTarget.cs +++ b/src/generated/Models/Microsoft/Graph/ExcludeTarget.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class ExcludeTarget : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The object identifier of an Azure Active Directory user or group. + /// The object identifier of an Azure AD user or group. public string Id { get; set; } /// The type of the authentication method target. Possible values are: user, group, unknownFutureValue. public AuthenticationMethodTargetType? TargetType { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/ExtensionSchemaProperty.cs b/src/generated/Models/Microsoft/Graph/ExtensionSchemaProperty.cs index 91b587a4fed..a667c0ff5fa 100644 --- a/src/generated/Models/Microsoft/Graph/ExtensionSchemaProperty.cs +++ b/src/generated/Models/Microsoft/Graph/ExtensionSchemaProperty.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class ExtensionSchemaProperty : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The name of the strongly-typed property defined as part of a schema extension. + /// The name of the strongly typed property defined as part of a schema extension. public string Name { get; set; } /// The type of the property that is defined as part of a schema extension. Allowed values are Binary, Boolean, DateTime, Integer or String. See the table below for more details. public string Type { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/ExternalConnectors/Acl.cs b/src/generated/Models/Microsoft/Graph/ExternalConnectors/Acl.cs index 0c2149a9a42..8410a17b173 100644 --- a/src/generated/Models/Microsoft/Graph/ExternalConnectors/Acl.cs +++ b/src/generated/Models/Microsoft/Graph/ExternalConnectors/Acl.cs @@ -5,13 +5,13 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph.ExternalConnectors { public class Acl : IParsable { - /// The access granted to the identity. Possible values are: grant, deny, unknownFutureValue. + /// The access granted to the identity. Possible values are: grant, deny. public AccessType? AccessType { get; set; } /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The type of identity. Possible values are: user, group, everyone, everyoneExceptGuests, externalGroup, unknownFutureValue. + /// The type of identity. Possible values are: user, group, everyone, everyoneExceptGuests if the identitySource is azureActiveDirectory and just group if the identitySource is external. public AclType? Type { get; set; } - /// The unique identifer of the identity. In case of Azure Active Directory identities, value is set to the object identifier of the user, group or tenant for types user, group and everyone (and everyoneExceptGuests) respectively. In case of external groups value is set to the ID of the externalGroup + /// The unique identifer of the identity. In case of Azure Active Directory identities, value is set to the object identifier of the user, group or tenant for types user, group and everyone (and everyoneExceptGuests) respectively. In case of external groups value is set to the ID of the externalGroup. public string Value { get; set; } /// /// Instantiates a new acl and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/ExternalConnectors/ConnectionOperation.cs b/src/generated/Models/Microsoft/Graph/ExternalConnectors/ConnectionOperation.cs index 05a2a0d24b7..ea25973f5ec 100644 --- a/src/generated/Models/Microsoft/Graph/ExternalConnectors/ConnectionOperation.cs +++ b/src/generated/Models/Microsoft/Graph/ExternalConnectors/ConnectionOperation.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph.ExternalConnectors { public class ConnectionOperation : Entity, IParsable { /// If status is failed, provides more information about the error that caused the failure. public PublicError Error { get; set; } - /// Indicates the status of the asynchronous operation. Possible values are: unspecified, inprogress, completed, failed, unknownFutureValue. + /// Indicates the status of the asynchronous operation. Possible values are: unspecified, inprogress, completed, failed. public ConnectionOperationStatus? Status { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/ExternalConnectors/ExternalConnection.cs b/src/generated/Models/Microsoft/Graph/ExternalConnectors/ExternalConnection.cs index 1767c4d7fc6..13b52c9cb60 100644 --- a/src/generated/Models/Microsoft/Graph/ExternalConnectors/ExternalConnection.cs +++ b/src/generated/Models/Microsoft/Graph/ExternalConnectors/ExternalConnection.cs @@ -19,7 +19,7 @@ public class ExternalConnection : Entity, IParsable { public List Operations { get; set; } /// Read-only. Nullable. public ApiSdk.Models.Microsoft.Graph.ExternalConnectors.Schema Schema { get; set; } - /// Indicates the current state of the connection. Possible values are: draft, ready, obsolete, limitExceeded, unknownFutureValue. + /// Indicates the current state of the connection. Possible values are draft, ready, obsolete, and limitExceeded. Required. public ConnectionState? State { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/ExternalConnectors/ExternalGroup.cs b/src/generated/Models/Microsoft/Graph/ExternalConnectors/ExternalGroup.cs index e44c7cb43b3..6665cab397f 100644 --- a/src/generated/Models/Microsoft/Graph/ExternalConnectors/ExternalGroup.cs +++ b/src/generated/Models/Microsoft/Graph/ExternalConnectors/ExternalGroup.cs @@ -9,7 +9,7 @@ public class ExternalGroup : Entity, IParsable { public string Description { get; set; } /// The friendly name of the external group. Optional. public string DisplayName { get; set; } - /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or an externalGroup as members. + /// A member added to an externalGroup. You can add Azure Active Directory users, Azure Active Directory groups, or other externalGroups as members. public List Members { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/ExternalConnectors/ExternalItemContent.cs b/src/generated/Models/Microsoft/Graph/ExternalConnectors/ExternalItemContent.cs index e59279517cf..2145d157632 100644 --- a/src/generated/Models/Microsoft/Graph/ExternalConnectors/ExternalItemContent.cs +++ b/src/generated/Models/Microsoft/Graph/ExternalConnectors/ExternalItemContent.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph.ExternalConnectors { public class ExternalItemContent : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The type of content in the value property. Possible values are: text, html, unknownFutureValue. + /// The type of content in the value property. Possible values are text and html. Required. public ExternalItemContentType? Type { get; set; } /// The content for the externalItem. Required. public string Value { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/ExternalConnectors/Property.cs b/src/generated/Models/Microsoft/Graph/ExternalConnectors/Property.cs index fdab558944f..fb0a4dd2d2b 100644 --- a/src/generated/Models/Microsoft/Graph/ExternalConnectors/Property.cs +++ b/src/generated/Models/Microsoft/Graph/ExternalConnectors/Property.cs @@ -15,13 +15,13 @@ public class Property : IParsable { public bool? IsRefinable { get; set; } /// Specifies if the property is retrievable. Retrievable properties are returned in the result set when items are returned by the search API. Retrievable properties are also available to add to the display template used to render search results. Optional. public bool? IsRetrievable { get; set; } - /// Specifies if the property is searchable. Only properties of type String or StringCollection can be searchable. Non-searchable properties are not added to the search index. Optional. + /// Specifies if the property is searchable. Only properties of type string or stringCollection can be searchable. Non-searchable properties are not added to the search index. Optional. public bool? IsSearchable { get; set; } - /// Specifies one or more well-known tags added against a property. Labels help Microsoft Search understand the semantics of the data in the connection. Adding appropriate labels would result in an enhanced search experience (e.g. better relevance). The possible values are: title, url, createdBy, lastModifiedBy, authors, createdDateTime, lastModifiedDateTime, fileName, fileExtension, unknownFutureValue. Optional. + /// Specifies one or more well-known tags added against a property. Labels help Microsoft Search understand the semantics of the data in the connection. Adding appropriate labels would result in an enhanced search experience (e.g. better relevance). Optional.The possible values are: title, url, createdBy, lastModifiedBy, authors, createdDateTime, lastModifiedDateTime, fileName, fileExtension, unknownFutureValue, iconUrl, containerName, containerUrl. Note that you must use the Prefer: include-unknown-enum-members request header to get the following values in this evolvable enum: iconUrl, containerName, containerUrl. public List Labels { get; set; } /// The name of the property. Maximum 32 characters. Only alphanumeric characters allowed. For example, each string may not contain control characters, whitespace, or any of the following: :, ;, ,, (, ), [, ], {, }, %, $, +, !, *, =, &, ?, @, #, /, ~, ', ', <, >, `, ^. Required. public string Name { get; set; } - /// The data type of the property. Possible values are: string, int64, double, dateTime, boolean, stringCollection, int64Collection, doubleCollection, dateTimeCollection, unknownFutureValue. + /// The data type of the property. Possible values are: string, int64, double, dateTime, boolean, stringCollection, int64Collection, doubleCollection, dateTimeCollection, unknownFutureValue. Required. public PropertyType? Type { get; set; } /// /// Instantiates a new property and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/ExternalConnectors/Schema.cs b/src/generated/Models/Microsoft/Graph/ExternalConnectors/Schema.cs index cd520af4179..0cbb72f9c24 100644 --- a/src/generated/Models/Microsoft/Graph/ExternalConnectors/Schema.cs +++ b/src/generated/Models/Microsoft/Graph/ExternalConnectors/Schema.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph.ExternalConnectors { public class Schema : Entity, IParsable { - /// Must be set to microsoft.graph.externalConnector.externalItem. Required. + /// Must be set to microsoft.graph.externalItem. Required. public string BaseType { get; set; } /// The properties defined for the items in the connection. The minimum number of properties is one, the maximum is 128. public List Properties { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Fido2AuthenticationMethod.cs b/src/generated/Models/Microsoft/Graph/Fido2AuthenticationMethod.cs index 57bcf879042..d0f410ef01e 100644 --- a/src/generated/Models/Microsoft/Graph/Fido2AuthenticationMethod.cs +++ b/src/generated/Models/Microsoft/Graph/Fido2AuthenticationMethod.cs @@ -9,7 +9,7 @@ public class Fido2AuthenticationMethod : AuthenticationMethod, IParsable { public string AaGuid { get; set; } /// The attestation certificate(s) attached to this security key. public List AttestationCertificates { get; set; } - /// The attestation level of this FIDO2 security key. Possible values are: attested, or notAttested. + /// The attestation level of this FIDO2 security key. Possible values are: attested, notAttested, unknownFutureValue. public AttestationLevel? AttestationLevel { get; set; } /// The timestamp when this key was registered to the user. public DateTimeOffset? CreatedDateTime { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/GeoCoordinates.cs b/src/generated/Models/Microsoft/Graph/GeoCoordinates.cs index 2bd4f8a7f6d..862e6927e71 100644 --- a/src/generated/Models/Microsoft/Graph/GeoCoordinates.cs +++ b/src/generated/Models/Microsoft/Graph/GeoCoordinates.cs @@ -9,9 +9,9 @@ public class GeoCoordinates : IParsable { public IDictionary AdditionalData { get; set; } /// Optional. The altitude (height), in feet, above sea level for the item. Read-only. public double? Altitude { get; set; } - /// Optional. The latitude, in decimal, for the item. Read-only. + /// Optional. The latitude, in decimal, for the item. Writable on OneDrive Personal. public double? Latitude { get; set; } - /// Optional. The longitude, in decimal, for the item. Read-only. + /// Optional. The longitude, in decimal, for the item. Writable on OneDrive Personal. public double? Longitude { get; set; } /// /// Instantiates a new geoCoordinates and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/Group.cs b/src/generated/Models/Microsoft/Graph/Group.cs index 34598b23497..93909d2cc6e 100644 --- a/src/generated/Models/Microsoft/Graph/Group.cs +++ b/src/generated/Models/Microsoft/Graph/Group.cs @@ -11,9 +11,9 @@ public class Group : DirectoryObject, IParsable { public bool? AllowExternalSenders { get; set; } /// Represents the app roles a group has been granted for an application. Supports $expand. public List AppRoleAssignments { get; set; } - /// The list of sensitivity label pairs (label ID, label name) associated with a Microsoft 365 group. Returned only on $select. Read-only. + /// The list of sensitivity label pairs (label ID, label name) associated with a Microsoft 365 group. Returned only on $select. public List AssignedLabels { get; set; } - /// The licenses that are assigned to the group. Returned only on $select. Supports $filter (eq).Read-only. + /// The licenses that are assigned to the group. Returned only on $select. Supports $filter (eq). Read-only. public List AssignedLicenses { get; set; } /// Indicates if new members added to the group will be auto-subscribed to receive email notifications. You can set this property in a PATCH request for the group; do not set it in the initial POST request that creates the group. Default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID}). public bool? AutoSubscribeNewMembers { get; set; } @@ -27,17 +27,17 @@ public class Group : DirectoryObject, IParsable { public List Conversations { get; set; } /// Timestamp of when the group was created. The value cannot be modified and is automatically populated when the group is created. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Returned by default. Supports $filter (eq, ne, not, ge, le, in). Read-only. public DateTimeOffset? CreatedDateTime { get; set; } - /// The user (or application) that created the group. NOTE: This is not set if the user is an administrator. Read-only. + /// The user (or application) that created the group. Note: This is not set if the user is an administrator. Read-only. public DirectoryObject CreatedOnBehalfOf { get; set; } /// An optional description for the group. Returned by default. Supports $filter (eq, ne, not, ge, le, startsWith) and $search. public string Description { get; set; } - /// The display name for the group. This property is required when a group is created and cannot be cleared during updates. Returned by default. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values), $search, and $orderBy. + /// The display name for the group. Required. Returned by default. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values), $search, and $orderBy. public string DisplayName { get; set; } /// The group's default drive. Read-only. public ApiSdk.Models.Microsoft.Graph.Drive Drive { get; set; } /// The group's drives. Read-only. public List Drives { get; set; } - /// The group's calendar events. + /// The group's events. public List<@Event> Events { get; set; } /// Timestamp of when the group is set to expire. The value cannot be modified and is automatically populated when the group is created. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Returned by default. Supports $filter (eq, ne, not, ge, le, in). Read-only. public DateTimeOffset? ExpirationDateTime { get; set; } @@ -47,28 +47,28 @@ public class Group : DirectoryObject, IParsable { public List GroupLifecyclePolicies { get; set; } /// Specifies the group type and its membership. If the collection contains Unified, the group is a Microsoft 365 group; otherwise, it's either a security group or distribution group. For details, see groups overview.If the collection includes DynamicMembership, the group has dynamic membership; otherwise, membership is static. Returned by default. Supports $filter (eq, not). public List GroupTypes { get; set; } - /// Indicates whether there are members in this group that have license errors from its group-based license assignment. This property is never returned on a GET operation. You can use it as a $filter argument to get groups that have members with license errors (that is, filter for this property being true). See an example. Supports $filter (eq). + /// Indicates whether there are members in this group that have license errors from its group-based license assignment. This property is never returned on a GET operation. You can use it as a $filter argument to get groups that have members with license errors (that is, filter for this property being true). Supports $filter (eq). public bool? HasMembersWithLicenseErrors { get; set; } - /// True if the group is not displayed in certain parts of the Outlook UI: the Address Book, address lists for selecting message recipients, and the Browse Groups dialog for searching groups; otherwise, false. Default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID}). + /// true if the group is not displayed in certain parts of the Outlook user interface: in the Address Book, in address lists for selecting message recipients, and in the Browse Groups dialog for searching groups; false otherwise. Default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID}). public bool? HideFromAddressLists { get; set; } - /// True if the group is not displayed in Outlook clients, such as Outlook for Windows and Outlook on the web; otherwise, false. Default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID}). + /// true if the group is not displayed in Outlook clients, such as Outlook for Windows and Outlook on the web, false otherwise. Default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID}). public bool? HideFromOutlookClients { get; set; } public bool? IsArchived { get; set; } - /// Indicates whether this group can be assigned to an Azure Active Directory role or not. Optional. This property can only be set while creating the group and is immutable. If set to true, the securityEnabled property must also be set to true and the group cannot be a dynamic group (that is, groupTypes cannot contain DynamicMembership). Only callers in Global administrator and Privileged role administrator roles can set this property. The caller must be assigned the RoleManagement.ReadWrite.Directory permission to set this property or update the membership of such groups. For more, see Using a group to manage Azure AD role assignmentsReturned by default. Supports $filter (eq, ne, not). + /// Indicates whether this group can be assigned to an Azure Active Directory role. Optional. This property can only be set while creating the group and is immutable. If set to true, the securityEnabled property must also be set to true and the group cannot be a dynamic group (that is, groupTypes cannot contain DynamicMembership). Only callers in Global administrator and Privileged role administrator roles can set this property. The caller must be assigned the RoleManagement.ReadWrite.Directory permission to set this property or update the membership of such groups. For more, see Using a group to manage Azure AD role assignmentsReturned by default. Supports $filter (eq, ne, not). public bool? IsAssignableToRole { get; set; } /// Indicates whether the signed-in user is subscribed to receive email conversations. Default value is true. Returned only on $select. Supported only on the Get group API (GET /groups/{ID}). public bool? IsSubscribedByMail { get; set; } - /// Indicates status of the group license assignment to all members of the group. Default value is false. Read-only. Possible values: QueuedForProcessing, ProcessingInProgress, and ProcessingComplete.Returned only on $select. Read-only. + /// Indicates status of the group license assignment to all members of the group. Possible values: QueuedForProcessing, ProcessingInProgress, and ProcessingComplete. Returned only on $select. Read-only. public LicenseProcessingState LicenseProcessingState { get; set; } /// The SMTP address for the group, for example, 'serviceadmins@contoso.onmicrosoft.com'. Returned by default. Read-only. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). public string Mail { get; set; } - /// Specifies whether the group is mail-enabled. Required. Returned by default. Supports $filter (eq, ne, not). + /// Specifies whether the group is mail-enabled. Required. Returned by default. Supports $filter (eq, ne, not, and eq on null values). public bool? MailEnabled { get; set; } - /// The mail alias for the group, unique in the organization. Maximum length is 64 characters. This property can contain only characters in the ASCII character set 0 - 127 except the following: @ () / [] ' ; : . <> , SPACE. Required. Returned by default. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). + /// The mail alias for the group, unique for Microsoft 365 groups in the organization. Maximum length is 64 characters. This property can contain only characters in the ASCII character set 0 - 127 except the following: @ () / [] ' ; : . <> , SPACE. Returned by default. Supports $filter (eq, ne, not, ge, le, in, startsWith). public string MailNickname { get; set; } - /// Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + /// Groups and administrative units that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. public List MemberOf { get; set; } - /// Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). Nullable. Supports $expand. + /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand. public List Members { get; set; } /// The rule that determines members for this group if the group is a dynamic group (groupTypes contains DynamicMembership). For more information about the syntax of the membership rule, see Membership Rules syntax. Returned by default. Supports $filter (eq, ne, not, ge, le, startsWith). public string MembershipRule { get; set; } @@ -92,31 +92,31 @@ public class Group : DirectoryObject, IParsable { public string OnPremisesSecurityIdentifier { get; set; } /// true if this group is synced from an on-premises directory; false if this group was originally synced from an on-premises directory but is no longer synced; null if this object has never been synced from an on-premises directory (default). Returned by default. Read-only. Supports $filter (eq, ne, not, in, and eq on null values). public bool? OnPremisesSyncEnabled { get; set; } - /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. + /// The owners of the group. The owners are a set of non-admin users who are allowed to modify this object. Nullable. If this property is not specified when creating a Microsoft 365 group, the calling user is automatically assigned as the group owner. Supports $expand. public List Owners { get; set; } - /// The permission that has been granted for a group to a specific application. Supports $expand. + /// The permissions that have been granted for a group to a specific application. Supports $expand. public List PermissionGrants { get; set; } - /// The group's profile photo + /// The group's profile photo. public ProfilePhoto Photo { get; set; } /// The profile photos owned by the group. Read-only. Nullable. public List Photos { get; set; } - /// Entry-point to Planner resource that might exist for a Unified Group. + /// Selective Planner services available to the group. Read-only. Nullable. public PlannerGroup Planner { get; set; } /// The preferred data location for the Microsoft 365 group. By default, the group inherits the group creator's preferred data location. To set this property, the calling user must be assigned one of the following Azure AD roles: Global Administrator User Account Administrator Directory Writer Exchange Administrator SharePoint Administrator For more information about this property, see OneDrive Online Multi-Geo. Nullable. Returned by default. public string PreferredDataLocation { get; set; } /// The preferred language for a Microsoft 365 group. Should follow ISO 639-1 Code; for example en-US. Returned by default. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). public string PreferredLanguage { get; set; } - /// Email addresses for the group that direct to the same group mailbox. For example: ['SMTP: bob@contoso.com', 'smtp: bob@sales.contoso.com']. The any operator is required to filter expressions on multi-valued properties. Returned by default. Read-only. Not nullable. Supports $filter (eq, not, ge, le, startsWith). + /// Email addresses for the group that direct to the same group mailbox. For example: ['SMTP: bob@contoso.com', 'smtp: bob@sales.contoso.com']. The any operator is required for filter expressions on multi-valued properties. Returned by default. Read-only. Not nullable. Supports $filter (eq, not, ge, le, startsWith). public List ProxyAddresses { get; set; } /// The list of users or groups that are not allowed to create posts or calendar events in this group. Nullable public List RejectedSenders { get; set; } /// Timestamp of when the group was last renewed. This cannot be modified directly and is only updated via the renew service action. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Returned by default. Supports $filter (eq, ne, not, ge, le, in). Read-only. public DateTimeOffset? RenewedDateTime { get; set; } - /// Specifies whether the group is a security group. Required. Returned by default. Supports $filter (eq, ne, not, in). + /// Specifies whether the group is a security group. Required.Returned by default. Supports $filter (eq, ne, not, in). public bool? SecurityEnabled { get; set; } /// Security identifier of the group, used in Windows scenarios. Returned by default. public string SecurityIdentifier { get; set; } - /// Read-only. Nullable. + /// Settings that can govern this group's behavior, like whether members can invite guest users to the group. Nullable. public List Settings { get; set; } /// The list of SharePoint sites in this group. Access the default site with /sites/root. public List Sites { get; set; } @@ -127,9 +127,9 @@ public class Group : DirectoryObject, IParsable { public List Threads { get; set; } public List TransitiveMemberOf { get; set; } public List TransitiveMembers { get; set; } - /// Count of conversations that have received new posts since the signed-in user last visited the group. Returned only on $select. Supported only on the Get group API (GET /groups/{ID}). + /// Count of conversations that have received new posts since the signed-in user last visited the group. This property is the same as unseenConversationsCount.Returned only on $select. Supported only on the Get group API (GET /groups/{ID}). public int? UnseenCount { get; set; } - /// Specifies the group join policy and group content visibility for groups. Possible values are: Private, Public, or Hiddenmembership. Hiddenmembership can be set only for Microsoft 365 groups, when the groups are created. It can't be updated later. Other values of visibility can be updated after group creation. If visibility value is not specified during group creation on Microsoft Graph, a security group is created as Private by default and Microsoft 365 group is Public. Groups assignable to roles are always Private. See group visibility options to learn more. Returned by default. Nullable. + /// Specifies the group join policy and group content visibility for groups. Possible values are: Private, Public, or Hiddenmembership. Hiddenmembership can be set only for Microsoft 365 groups, when the groups are created. It can't be updated later. Other values of visibility can be updated after group creation. If visibility value is not specified during group creation on Microsoft Graph, a security group is created as Private by default and Microsoft 365 group is Public. Groups assignable to roles are always Private. See group visibility options to learn more. Returned by default. Nullable. public string Visibility { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/Hashes.cs b/src/generated/Models/Microsoft/Graph/Hashes.cs index 663675dc4b8..b8abfe579f5 100644 --- a/src/generated/Models/Microsoft/Graph/Hashes.cs +++ b/src/generated/Models/Microsoft/Graph/Hashes.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class Hashes : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The CRC32 value of the file in little endian (if available). Read-only. + /// The CRC32 value of the file (if available). Read-only. public string Crc32Hash { get; set; } /// A proprietary hash of the file that can be used to determine if the contents of the file have changed (if available). Read-only. public string QuickXorHash { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/IdentityContainer.cs b/src/generated/Models/Microsoft/Graph/IdentityContainer.cs index 6a5609727c6..5cc478f559d 100644 --- a/src/generated/Models/Microsoft/Graph/IdentityContainer.cs +++ b/src/generated/Models/Microsoft/Graph/IdentityContainer.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class IdentityContainer : Entity, IParsable { /// Represents entry point for API connectors. public List ApiConnectors { get; set; } - /// Represents entry point for B2X/self-service sign-up identity userflows. + /// Represents entry point for B2X and self-service sign-up identity userflows. public List B2xUserFlows { get; set; } /// the entry point for the Conditional Access (CA) object model. public ConditionalAccessRoot ConditionalAccess { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/IdentityProtection.cs b/src/generated/Models/Microsoft/Graph/IdentityProtection.cs new file mode 100644 index 00000000000..3b93bd6490e --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/IdentityProtection.cs @@ -0,0 +1,38 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class IdentityProtection : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public List RiskDetections { get; set; } + public List RiskyUsers { get; set; } + /// + /// Instantiates a new identityProtection and sets the default values. + /// + public IdentityProtection() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"riskDetections", (o,n) => { (o as IdentityProtection).RiskDetections = n.GetCollectionOfObjectValues().ToList(); } }, + {"riskyUsers", (o,n) => { (o as IdentityProtection).RiskyUsers = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("riskDetections", RiskDetections); + writer.WriteCollectionOfObjectValues("riskyUsers", RiskyUsers); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/IdentityProtectionRoot.cs b/src/generated/Models/Microsoft/Graph/IdentityProtectionRoot.cs new file mode 100644 index 00000000000..a398b1ceae2 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/IdentityProtectionRoot.cs @@ -0,0 +1,38 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class IdentityProtectionRoot : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public List RiskDetections { get; set; } + public List RiskyUsers { get; set; } + /// + /// Instantiates a new IdentityProtectionRoot and sets the default values. + /// + public IdentityProtectionRoot() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"riskDetections", (o,n) => { (o as IdentityProtectionRoot).RiskDetections = n.GetCollectionOfObjectValues().ToList(); } }, + {"riskyUsers", (o,n) => { (o as IdentityProtectionRoot).RiskyUsers = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("riskDetections", RiskDetections); + writer.WriteCollectionOfObjectValues("riskyUsers", RiskyUsers); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/IdentityProvider.cs b/src/generated/Models/Microsoft/Graph/IdentityProvider.cs index 44a71f03d07..187d38b642c 100644 --- a/src/generated/Models/Microsoft/Graph/IdentityProvider.cs +++ b/src/generated/Models/Microsoft/Graph/IdentityProvider.cs @@ -5,13 +5,13 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class IdentityProvider : Entity, IParsable { - /// The client ID for the application. This is the client ID obtained when registering the application with the identity provider. Required. Not nullable. + /// The client ID for the application obtained when registering the application with the identity provider. This is a required field. Required. Not nullable. public string ClientId { get; set; } - /// The client secret for the application. This is the client secret obtained when registering the application with the identity provider. This is write-only. A read operation will return ****. Required. Not nullable. + /// The client secret for the application obtained when registering the application with the identity provider. This is write-only. A read operation will return ****. This is a required field. Required. Not nullable. public string ClientSecret { get; set; } /// The display name of the identity provider. Not nullable. public string Name { get; set; } - /// The identity provider type is a required field. For B2B scenario: Google, Facebook. For B2C scenario: Microsoft, Google, Amazon, LinkedIn, Facebook, GitHub, Twitter, Weibo, QQ, WeChat, OpenIDConnect. Not nullable. + /// The identity provider type is a required field. For B2B scenario: Google, Facebook. For B2C scenario: Microsoft, Google, Amazon, LinkedIn, Facebook, GitHub, Twitter, Weibo,QQ, WeChat, OpenIDConnect. Not nullable. public string Type { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/IncomingContext.cs b/src/generated/Models/Microsoft/Graph/IncomingContext.cs index 6efc0358156..c80c8ec9892 100644 --- a/src/generated/Models/Microsoft/Graph/IncomingContext.cs +++ b/src/generated/Models/Microsoft/Graph/IncomingContext.cs @@ -7,11 +7,11 @@ namespace ApiSdk.Models.Microsoft.Graph { public class IncomingContext : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The ID of the participant that is under observation. Read-only. + /// The id of the participant that is under observation. Read-only. public string ObservedParticipantId { get; set; } /// The identity that the call is happening on behalf of. public IdentitySet OnBehalfOf { get; set; } - /// The ID of the participant that triggered the incoming call. Read-only. + /// The id of the participant that triggered the incoming call. Read-only. public string SourceParticipantId { get; set; } /// The identity that transferred the call. public IdentitySet Transferor { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/InferenceClassificationOverride.cs b/src/generated/Models/Microsoft/Graph/InferenceClassificationOverride.cs index af288678a01..3fae9a22221 100644 --- a/src/generated/Models/Microsoft/Graph/InferenceClassificationOverride.cs +++ b/src/generated/Models/Microsoft/Graph/InferenceClassificationOverride.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class InferenceClassificationOverride : Entity, IParsable { - /// Specifies how incoming messages from a specific sender should always be classified as. The possible values are: focused, other. + /// Specifies how incoming messages from a specific sender should always be classified as. Possible values are: focused, other. public InferenceClassificationType? ClassifyAs { get; set; } /// The email address information of the sender for whom the override is created. public EmailAddress SenderEmailAddress { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Invitation.cs b/src/generated/Models/Microsoft/Graph/Invitation.cs index 05a50468090..b784880233e 100644 --- a/src/generated/Models/Microsoft/Graph/Invitation.cs +++ b/src/generated/Models/Microsoft/Graph/Invitation.cs @@ -9,19 +9,19 @@ public class Invitation : Entity, IParsable { public ApiSdk.Models.Microsoft.Graph.User InvitedUser { get; set; } /// The display name of the user being invited. public string InvitedUserDisplayName { get; set; } - /// The email address of the user being invited. Required. The following special characters are not permitted in the email address:Tilde (~)Exclamation point (!)Number sign (#)Dollar sign ($)Percent (%)Circumflex (^)Ampersand (&)Asterisk (*)Parentheses (( ))Plus sign (+)Equal sign (=)Brackets ([ ])Braces ({ })Backslash (/)Slash mark (/)Pipe (/|)Semicolon (;)Colon (:)Quotation marks (')Angle brackets (< >)Question mark (?)Comma (,)However, the following exceptions apply:A period (.) or a hyphen (-) is permitted anywhere in the user name, except at the beginning or end of the name.An underscore (_) is permitted anywhere in the user name. This includes at the beginning or end of the name. + /// The email address of the user being invited. Required. The following special characters are not permitted in the email address:Tilde (~)Exclamation point (!)At sign (@)Number sign (#)Dollar sign ($)Percent (%)Circumflex (^)Ampersand (&)Asterisk (*)Parentheses (( ))Hyphen (-)Plus sign (+)Equal sign (=)Brackets ([ ])Braces ({ })Backslash (/)Slash mark (/)Pipe (` public string InvitedUserEmailAddress { get; set; } /// Additional configuration for the message being sent to the invited user, including customizing message text, language and cc recipient list. public InvitedUserMessageInfo InvitedUserMessageInfo { get; set; } - /// The userType of the user being invited. By default, this is Guest. You can invite as Member if you are a company administrator. + /// The userType of the user being invited. By default, this is Guest. You can invite as Member if you're are company administrator. The default is false. public string InvitedUserType { get; set; } /// The URL the user can use to redeem their invitation. Read-only. public string InviteRedeemUrl { get; set; } - /// The URL the user should be redirected to once the invitation is redeemed. Required. + /// The URL user should be redirected to once the invitation is redeemed. Required. public string InviteRedirectUrl { get; set; } /// Indicates whether an email should be sent to the user being invited. The default is false. public bool? SendInvitationMessage { get; set; } - /// The status of the invitation. Possible values are: PendingAcceptance, Completed, InProgress, and Error. + /// The status of the invitation. Possible values: PendingAcceptance, Completed, InProgress, and Error public string Status { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/InvitationParticipantInfo.cs b/src/generated/Models/Microsoft/Graph/InvitationParticipantInfo.cs index 501581c91a0..54d4f1be82e 100644 --- a/src/generated/Models/Microsoft/Graph/InvitationParticipantInfo.cs +++ b/src/generated/Models/Microsoft/Graph/InvitationParticipantInfo.cs @@ -7,8 +7,11 @@ namespace ApiSdk.Models.Microsoft.Graph { public class InvitationParticipantInfo : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } + public bool? Hidden { get; set; } public IdentitySet Identity { get; set; } - /// Optional. The call which the target identity is currently a part of. This call will be dropped once the participant is added. + public string ParticipantId { get; set; } + public bool? RemoveFromDefaultAudioRoutingGroup { get; set; } + /// Optional. The call which the target idenity is currently a part of. This call will be dropped once the participant is added. public string ReplacesCallId { get; set; } /// /// Instantiates a new invitationParticipantInfo and sets the default values. @@ -21,7 +24,10 @@ public InvitationParticipantInfo() { /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { + {"hidden", (o,n) => { (o as InvitationParticipantInfo).Hidden = n.GetBoolValue(); } }, {"identity", (o,n) => { (o as InvitationParticipantInfo).Identity = n.GetObjectValue(); } }, + {"participantId", (o,n) => { (o as InvitationParticipantInfo).ParticipantId = n.GetStringValue(); } }, + {"removeFromDefaultAudioRoutingGroup", (o,n) => { (o as InvitationParticipantInfo).RemoveFromDefaultAudioRoutingGroup = n.GetBoolValue(); } }, {"replacesCallId", (o,n) => { (o as InvitationParticipantInfo).ReplacesCallId = n.GetStringValue(); } }, }; } @@ -31,7 +37,10 @@ public IDictionary> GetFieldDeserializers() { /// public void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("hidden", Hidden); writer.WriteObjectValue("identity", Identity); + writer.WriteStringValue("participantId", ParticipantId); + writer.WriteBoolValue("removeFromDefaultAudioRoutingGroup", RemoveFromDefaultAudioRoutingGroup); writer.WriteStringValue("replacesCallId", ReplacesCallId); writer.WriteAdditionalData(AdditionalData); } diff --git a/src/generated/Models/Microsoft/Graph/IosManagedAppProtection.cs b/src/generated/Models/Microsoft/Graph/IosManagedAppProtection.cs index 1a47c16a66d..14cd3e32f72 100644 --- a/src/generated/Models/Microsoft/Graph/IosManagedAppProtection.cs +++ b/src/generated/Models/Microsoft/Graph/IosManagedAppProtection.cs @@ -9,7 +9,7 @@ public class IosManagedAppProtection : TargetedManagedAppProtection, IParsable { public ManagedAppDataEncryptionType? AppDataEncryptionType { get; set; } /// List of apps to which the policy is deployed. public List Apps { get; set; } - /// A custom browser protocol to open weblink on iOS. When this property is configured, ManagedBrowserToOpenLinksRequired should be true. + /// A custom browser protocol to open weblink on iOS. public string CustomBrowserProtocol { get; set; } /// Count of apps to which the current policy is deployed. public int? DeployedAppCount { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/IosUpdateDeviceStatus.cs b/src/generated/Models/Microsoft/Graph/IosUpdateDeviceStatus.cs index 63a4c833903..0024c748443 100644 --- a/src/generated/Models/Microsoft/Graph/IosUpdateDeviceStatus.cs +++ b/src/generated/Models/Microsoft/Graph/IosUpdateDeviceStatus.cs @@ -13,7 +13,7 @@ public class IosUpdateDeviceStatus : Entity, IParsable { public string DeviceId { get; set; } /// The device model that is being reported public string DeviceModel { get; set; } - /// The installation status of the policy report. Possible values are: success, available, idle, unknown, downloading, downloadFailed, downloadRequiresComputer, downloadInsufficientSpace, downloadInsufficientPower, downloadInsufficientNetwork, installing, installInsufficientSpace, installInsufficientPower, installPhoneCallInProgress, installFailed, notSupportedOperation, sharedDeviceUserLoggedInError, deviceOsHigherThanDesiredOsVersion. + /// The installation status of the policy report. Possible values are: success, available, idle, unknown, mdmClientCrashed, timeout, downloading, downloadFailed, downloadRequiresComputer, downloadInsufficientSpace, downloadInsufficientPower, downloadInsufficientNetwork, installing, installInsufficientSpace, installInsufficientPower, installPhoneCallInProgress, installFailed, notSupportedOperation, sharedDeviceUserLoggedInError, updateError, deviceOsHigherThanDesiredOsVersion, updateScanFailed. public IosUpdatesInstallStatus? InstallStatus { get; set; } /// Last modified date time of the policy report. public DateTimeOffset? LastReportedDateTime { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/KeyCredential.cs b/src/generated/Models/Microsoft/Graph/KeyCredential.cs index 88471760a97..6241e475504 100644 --- a/src/generated/Models/Microsoft/Graph/KeyCredential.cs +++ b/src/generated/Models/Microsoft/Graph/KeyCredential.cs @@ -13,9 +13,9 @@ public class KeyCredential : IParsable { public string DisplayName { get; set; } /// The date and time at which the credential expires.The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. public DateTimeOffset? EndDateTime { get; set; } - /// The certificate's raw data in byte array converted to Base64 string; for example, [System.Convert]::ToBase64String($Cert.GetRawCertData()). + /// Value for the key credential. Should be a base 64 encoded value. public byte[] Key { get; set; } - /// The unique identifier (GUID) for the key. + /// The unique identifier for the key. public string KeyId { get; set; } /// The date and time at which the credential becomes valid.The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. public DateTimeOffset? StartDateTime { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/KeyValue.cs b/src/generated/Models/Microsoft/Graph/KeyValue.cs index f0a9c2bb120..ddd3e49c421 100644 --- a/src/generated/Models/Microsoft/Graph/KeyValue.cs +++ b/src/generated/Models/Microsoft/Graph/KeyValue.cs @@ -7,9 +7,9 @@ namespace ApiSdk.Models.Microsoft.Graph { public class KeyValue : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Key for the key-value pair. + /// Key. public string Key { get; set; } - /// Value for the key-value pair. + /// Value. public string Value { get; set; } /// /// Instantiates a new keyValue and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/LicenseAssignmentState.cs b/src/generated/Models/Microsoft/Graph/LicenseAssignmentState.cs index 5280eeb0a70..a01b1762148 100644 --- a/src/generated/Models/Microsoft/Graph/LicenseAssignmentState.cs +++ b/src/generated/Models/Microsoft/Graph/LicenseAssignmentState.cs @@ -13,6 +13,8 @@ public class LicenseAssignmentState : IParsable { public List DisabledPlans { get; set; } /// License assignment failure error. If the license is assigned successfully, this field will be Null. Read-Only. Possible values: CountViolation, MutuallyExclusiveViolation, DependencyViolation, ProhibitedInUsageLocationViolation, UniquenessViolation, and Others. For more information on how to identify and resolve license assignment errors see here. public string Error { get; set; } + /// The timestamp when the state of the license assignment was last updated. + public DateTimeOffset? LastUpdatedDateTime { get; set; } /// The unique identifier for the SKU. Read-Only. public string SkuId { get; set; } /// Indicate the current state of this assignment. Read-Only. Possible values: Active, ActiveWithError, Disabled and Error. @@ -31,6 +33,7 @@ public IDictionary> GetFieldDeserializers() { {"assignedByGroup", (o,n) => { (o as LicenseAssignmentState).AssignedByGroup = n.GetStringValue(); } }, {"disabledPlans", (o,n) => { (o as LicenseAssignmentState).DisabledPlans = n.GetCollectionOfPrimitiveValues().ToList(); } }, {"error", (o,n) => { (o as LicenseAssignmentState).Error = n.GetStringValue(); } }, + {"lastUpdatedDateTime", (o,n) => { (o as LicenseAssignmentState).LastUpdatedDateTime = n.GetDateTimeOffsetValue(); } }, {"skuId", (o,n) => { (o as LicenseAssignmentState).SkuId = n.GetStringValue(); } }, {"state", (o,n) => { (o as LicenseAssignmentState).State = n.GetStringValue(); } }, }; @@ -44,6 +47,7 @@ public void Serialize(ISerializationWriter writer) { writer.WriteStringValue("assignedByGroup", AssignedByGroup); writer.WriteCollectionOfPrimitiveValues("disabledPlans", DisabledPlans); writer.WriteStringValue("error", Error); + writer.WriteDateTimeOffsetValue("lastUpdatedDateTime", LastUpdatedDateTime); writer.WriteStringValue("skuId", SkuId); writer.WriteStringValue("state", State); writer.WriteAdditionalData(AdditionalData); diff --git a/src/generated/Models/Microsoft/Graph/Location.cs b/src/generated/Models/Microsoft/Graph/Location.cs index 3e04fdc8001..9c075ded0db 100644 --- a/src/generated/Models/Microsoft/Graph/Location.cs +++ b/src/generated/Models/Microsoft/Graph/Location.cs @@ -15,7 +15,7 @@ public class Location : IParsable { public string DisplayName { get; set; } /// Optional email address of the location. public string LocationEmailAddress { get; set; } - /// The type of location. The possible values are: default, conferenceRoom, homeAddress, businessAddress,geoCoordinates, streetAddress, hotel, restaurant, localBusiness, postalAddress. Read-only. + /// The type of location. Possible values are: default, conferenceRoom, homeAddress, businessAddress,geoCoordinates, streetAddress, hotel, restaurant, localBusiness, postalAddress. Read-only. public LocationType? LocationType { get; set; } /// Optional URI representing the location. public string LocationUri { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/MailboxSettings.cs b/src/generated/Models/Microsoft/Graph/MailboxSettings.cs index 8524e29e33b..8a171395f16 100644 --- a/src/generated/Models/Microsoft/Graph/MailboxSettings.cs +++ b/src/generated/Models/Microsoft/Graph/MailboxSettings.cs @@ -7,13 +7,13 @@ namespace ApiSdk.Models.Microsoft.Graph { public class MailboxSettings : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Folder ID of an archive folder for the user. + /// Folder ID of an archive folder for the user. Read only. public string ArchiveFolder { get; set; } /// Configuration settings to automatically notify the sender of an incoming email with a message from the signed-in user. public AutomaticRepliesSetting AutomaticRepliesSetting { get; set; } /// The date format for the user's mailbox. public string DateFormat { get; set; } - /// If the user has a calendar delegate, this specifies whether the delegate, mailbox owner, or both receive meeting messages and meeting responses. Possible values are: sendToDelegateAndInformationToPrincipal, sendToDelegateAndPrincipal, sendToDelegateOnly. + /// If the user has a calendar delegate, this specifies whether the delegate, mailbox owner, or both receive meeting messages and meeting responses. Possible values are: sendToDelegateAndInformationToPrincipal, sendToDelegateAndPrincipal, sendToDelegateOnly. The default is sendToDelegateOnly. public DelegateMeetingMessageDeliveryOptions? DelegateMeetingMessageDeliveryOptions { get; set; } /// The locale information for the user, including the preferred language and country/region. public LocaleInfo Language { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/ManagedDevice.cs b/src/generated/Models/Microsoft/Graph/ManagedDevice.cs index 79c13c061e2..5840c83b8be 100644 --- a/src/generated/Models/Microsoft/Graph/ManagedDevice.cs +++ b/src/generated/Models/Microsoft/Graph/ManagedDevice.cs @@ -29,7 +29,7 @@ public class ManagedDevice : Entity, IParsable { public List DeviceCompliancePolicyStates { get; set; } /// Device configuration states for this device. public List DeviceConfigurationStates { get; set; } - /// Enrollment type of the device. This property is read-only. Possible values are: unknown, userEnrollment, deviceEnrollmentManager, appleBulkWithUser, appleBulkWithoutUser, windowsAzureADJoin, windowsBulkUserless, windowsAutoEnrollment, windowsBulkAzureDomainJoin, windowsCoManagement, windowsAzureADJoinUsingDeviceAuth, appleUserEnrollment, appleUserEnrollmentWithServiceAccount. + /// Enrollment type of the device. This property is read-only. Possible values are: unknown, userEnrollment, deviceEnrollmentManager, appleBulkWithUser, appleBulkWithoutUser, windowsAzureADJoin, windowsBulkUserless, windowsAutoEnrollment, windowsBulkAzureDomainJoin, windowsCoManagement, windowsAzureADJoinUsingDeviceAuth, appleUserEnrollment, appleUserEnrollmentWithServiceAccount, azureAdJoinUsingAzureVmExtension, androidEnterpriseDedicatedDevice, androidEnterpriseFullyManaged, androidEnterpriseCorporateWorkProfile. public DeviceEnrollmentType? DeviceEnrollmentType { get; set; } /// The device health attestation state. This property is read-only. public DeviceHealthAttestationState DeviceHealthAttestationState { get; set; } @@ -73,7 +73,7 @@ public class ManagedDevice : Entity, IParsable { public string ManagedDeviceName { get; set; } /// Ownership of the device. Can be 'company' or 'personal'. Possible values are: unknown, company, personal. public ManagedDeviceOwnerType? ManagedDeviceOwnerType { get; set; } - /// Management channel of the device. Intune, EAS, etc. This property is read-only. Possible values are: eas, mdm, easMdm, intuneClient, easIntuneClient, configurationManagerClient, configurationManagerClientMdm, configurationManagerClientMdmEas, unknown, jamf, googleCloudDevicePolicyController. + /// Management channel of the device. Intune, EAS, etc. This property is read-only. Possible values are: eas, mdm, easMdm, intuneClient, easIntuneClient, configurationManagerClient, configurationManagerClientMdm, configurationManagerClientMdmEas, unknown, jamf, googleCloudDevicePolicyController, microsoft365ManagedMdm, msSense, intuneAosp. public ManagementAgentType? ManagementAgent { get; set; } /// Manufacturer of the device. This property is read-only. public string Manufacturer { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/MediaStream.cs b/src/generated/Models/Microsoft/Graph/MediaStream.cs index 2781b8425c2..0de76258b45 100644 --- a/src/generated/Models/Microsoft/Graph/MediaStream.cs +++ b/src/generated/Models/Microsoft/Graph/MediaStream.cs @@ -13,7 +13,7 @@ public class MediaStream : IParsable { public string Label { get; set; } /// The media type. The possible value are unknown, audio, video, videoBasedScreenSharing, data. public Modality? MediaType { get; set; } - /// If the media is muted by the server. + /// Indicates whether the media is muted by the server. public bool? ServerMuted { get; set; } /// The source ID. public string SourceId { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/MeetingAttendanceReport.cs b/src/generated/Models/Microsoft/Graph/MeetingAttendanceReport.cs new file mode 100644 index 00000000000..df6aded438e --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/MeetingAttendanceReport.cs @@ -0,0 +1,40 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class MeetingAttendanceReport : Entity, IParsable { + /// List of attendance records of an attendance report. Read-only. + public List AttendanceRecords { get; set; } + /// UTC time when the meeting ended. Read-only. + public DateTimeOffset? MeetingEndDateTime { get; set; } + /// UTC time when the meeting started. Read-only. + public DateTimeOffset? MeetingStartDateTime { get; set; } + /// Total number of participants. Read-only. + public int? TotalParticipantCount { get; set; } + /// + /// The deserialization information for the current model + /// + public new IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + {"attendanceRecords", (o,n) => { (o as MeetingAttendanceReport).AttendanceRecords = n.GetCollectionOfObjectValues().ToList(); } }, + {"meetingEndDateTime", (o,n) => { (o as MeetingAttendanceReport).MeetingEndDateTime = n.GetDateTimeOffsetValue(); } }, + {"meetingStartDateTime", (o,n) => { (o as MeetingAttendanceReport).MeetingStartDateTime = n.GetDateTimeOffsetValue(); } }, + {"totalParticipantCount", (o,n) => { (o as MeetingAttendanceReport).TotalParticipantCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public new void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("attendanceRecords", AttendanceRecords); + writer.WriteDateTimeOffsetValue("meetingEndDateTime", MeetingEndDateTime); + writer.WriteDateTimeOffsetValue("meetingStartDateTime", MeetingStartDateTime); + writer.WriteIntValue("totalParticipantCount", TotalParticipantCount); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/MeetingTimeSuggestion.cs b/src/generated/Models/Microsoft/Graph/MeetingTimeSuggestion.cs index da2fb1d0087..02b279d546e 100644 --- a/src/generated/Models/Microsoft/Graph/MeetingTimeSuggestion.cs +++ b/src/generated/Models/Microsoft/Graph/MeetingTimeSuggestion.cs @@ -17,7 +17,7 @@ public class MeetingTimeSuggestion : IParsable { public TimeSlot MeetingTimeSlot { get; set; } /// Order of meeting time suggestions sorted by their computed confidence value from high to low, then by chronology if there are suggestions with the same confidence. public int? Order { get; set; } - /// Availability of the meeting organizer for this meeting suggestion. The possible values are: free, tentative, busy, oof, workingElsewhere, unknown. + /// Availability of the meeting organizer for this meeting suggestion. Possible values are: free, tentative, busy, oof, workingElsewhere, unknown. public FreeBusyStatus? OrganizerAvailability { get; set; } /// Reason for suggesting the meeting time. public string SuggestionReason { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/MeetingTimeSuggestionsResult.cs b/src/generated/Models/Microsoft/Graph/MeetingTimeSuggestionsResult.cs index 52f543180cf..3ff4fd81b68 100644 --- a/src/generated/Models/Microsoft/Graph/MeetingTimeSuggestionsResult.cs +++ b/src/generated/Models/Microsoft/Graph/MeetingTimeSuggestionsResult.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class MeetingTimeSuggestionsResult : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// A reason for not returning any meeting suggestions. The possible values are: attendeesUnavailable, attendeesUnavailableOrUnknown, locationsUnavailable, organizerUnavailable, or unknown. This property is an empty string if the meetingTimeSuggestions property does include any meeting suggestions. + /// A reason for not returning any meeting suggestions. Possible values are: attendeesUnavailable, attendeesUnavailableOrUnknown, locationsUnavailable, organizerUnavailable, or unknown. This property is an empty string if the meetingTimeSuggestions property does include any meeting suggestions. public string EmptySuggestionsReason { get; set; } /// An array of meeting suggestions. public List MeetingTimeSuggestions { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Message.cs b/src/generated/Models/Microsoft/Graph/Message.cs index 7393a7b2fc7..8883276e220 100644 --- a/src/generated/Models/Microsoft/Graph/Message.cs +++ b/src/generated/Models/Microsoft/Graph/Message.cs @@ -11,7 +11,7 @@ public class Message : OutlookItem, IParsable { public List BccRecipients { get; set; } /// The body of the message. It can be in HTML or text format. Find out about safe HTML in a message body. public ItemBody Body { get; set; } - /// The first 255 characters of the message body. It is in text format. + /// The first 255 characters of the message body. It is in text format. If the message contains instances of mention, this property would contain a concatenation of these mentions as well. public string BodyPreview { get; set; } /// The Cc: recipients for the message. public List CcRecipients { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/MessageRuleActions.cs b/src/generated/Models/Microsoft/Graph/MessageRuleActions.cs index cbab4f275ab..63579364fba 100644 --- a/src/generated/Models/Microsoft/Graph/MessageRuleActions.cs +++ b/src/generated/Models/Microsoft/Graph/MessageRuleActions.cs @@ -25,7 +25,7 @@ public class MessageRuleActions : IParsable { public string MoveToFolder { get; set; } /// Indicates whether a message should be permanently deleted and not saved to the Deleted Items folder. public bool? PermanentDelete { get; set; } - /// The email addresses to which a message should be redirected. + /// The email address to which a message should be redirected. public List RedirectTo { get; set; } /// Indicates whether subsequent rules should be evaluated. public bool? StopProcessingRules { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/ModifiedProperty.cs b/src/generated/Models/Microsoft/Graph/ModifiedProperty.cs index 3365dd8a9fd..f4324002fe1 100644 --- a/src/generated/Models/Microsoft/Graph/ModifiedProperty.cs +++ b/src/generated/Models/Microsoft/Graph/ModifiedProperty.cs @@ -7,11 +7,11 @@ namespace ApiSdk.Models.Microsoft.Graph { public class ModifiedProperty : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Indicates the property name of the target attribute that was changed. + /// Name of property that was modified. public string DisplayName { get; set; } - /// Indicates the updated value for the propery. + /// New property value. public string NewValue { get; set; } - /// Indicates the previous value (before the update) for the property. + /// Old property value. public string OldValue { get; set; } /// /// Instantiates a new modifiedProperty and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/NetworkConnection.cs b/src/generated/Models/Microsoft/Graph/NetworkConnection.cs index 13165c37243..2f2b08d55f8 100644 --- a/src/generated/Models/Microsoft/Graph/NetworkConnection.cs +++ b/src/generated/Models/Microsoft/Graph/NetworkConnection.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class NetworkConnection : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Name of the application managing the network connection (for example, Facebook or SMTP). + /// Name of the application managing the network connection (for example, Facebook, SMTP, etc.). public string ApplicationName { get; set; } /// Destination IP address (of the network connection). public string DestinationAddress { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/NotificationMessageTemplate.cs b/src/generated/Models/Microsoft/Graph/NotificationMessageTemplate.cs index a440747edf2..642add5c2f9 100644 --- a/src/generated/Models/Microsoft/Graph/NotificationMessageTemplate.cs +++ b/src/generated/Models/Microsoft/Graph/NotificationMessageTemplate.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class NotificationMessageTemplate : Entity, IParsable { - /// The Message Template Branding Options. Branding is defined in the Intune Admin Console. Possible values are: none, includeCompanyLogo, includeCompanyName, includeContactInformation. + /// The Message Template Branding Options. Branding is defined in the Intune Admin Console. Possible values are: none, includeCompanyLogo, includeCompanyName, includeContactInformation, includeCompanyPortalLink. public NotificationTemplateBrandingOptions? BrandingOptions { get; set; } /// The default locale to fallback onto when the requested locale is not available. public string DefaultLocale { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/OAuth2PermissionGrant.cs b/src/generated/Models/Microsoft/Graph/OAuth2PermissionGrant.cs index 775d39a840e..6f92af42464 100644 --- a/src/generated/Models/Microsoft/Graph/OAuth2PermissionGrant.cs +++ b/src/generated/Models/Microsoft/Graph/OAuth2PermissionGrant.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class OAuth2PermissionGrant : Entity, IParsable { /// The id of the client service principal for the application which is authorized to act on behalf of a signed-in user when accessing an API. Required. Supports $filter (eq only). public string ClientId { get; set; } - /// Indicates if authorization is granted for the client application to impersonate all users or only a specific user. AllPrincipals indicates authorization to impersonate all users. Principal indicates authorization to impersonate a specific user. Consent on behalf of all users can be granted by an administrator. Non-admin users may be authorized to consent on behalf of themselves in some cases, for some delegated permissions. Required. Supports $filter (eq only). + /// Indicates whether authorization is granted for the client application to impersonate all users or only a specific user. AllPrincipals indicates authorization to impersonate all users. Principal indicates authorization to impersonate a specific user. Consent on behalf of all users can be granted by an administrator. Non-admin users may be authorized to consent on behalf of themselves in some cases, for some delegated permissions. Required. Supports $filter (eq only). public string ConsentType { get; set; } /// The id of the user on behalf of whom the client is authorized to access the resource, when consentType is Principal. If consentType is AllPrincipals this value is null. Required when consentType is Principal. public string PrincipalId { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/OfferShiftRequest.cs b/src/generated/Models/Microsoft/Graph/OfferShiftRequest.cs index e29f7d4812c..3cc87e7f623 100644 --- a/src/generated/Models/Microsoft/Graph/OfferShiftRequest.cs +++ b/src/generated/Models/Microsoft/Graph/OfferShiftRequest.cs @@ -9,9 +9,9 @@ public class OfferShiftRequest : ScheduleChangeRequest, IParsable { public DateTimeOffset? RecipientActionDateTime { get; set; } /// Custom message sent by recipient of the offer shift request. public string RecipientActionMessage { get; set; } - /// User ID of the recipient of the offer shift request. + /// User id of the recipient of the offer shift request. public string RecipientUserId { get; set; } - /// User ID of the sender of the offer shift request. + /// User id of the sender of the offer shift request. public string SenderShiftId { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/OfficeGraphInsights.cs b/src/generated/Models/Microsoft/Graph/OfficeGraphInsights.cs index 3df8c288e2a..0e484403372 100644 --- a/src/generated/Models/Microsoft/Graph/OfficeGraphInsights.cs +++ b/src/generated/Models/Microsoft/Graph/OfficeGraphInsights.cs @@ -5,11 +5,11 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class OfficeGraphInsights : Entity, IParsable { - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. public List Shared { get; set; } - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. public List Trending { get; set; } - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. public List Used { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/OnenotePatchContentCommand.cs b/src/generated/Models/Microsoft/Graph/OnenotePatchContentCommand.cs index 2aad1e4f1e7..f757ae2aa7c 100644 --- a/src/generated/Models/Microsoft/Graph/OnenotePatchContentCommand.cs +++ b/src/generated/Models/Microsoft/Graph/OnenotePatchContentCommand.cs @@ -5,15 +5,15 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class OnenotePatchContentCommand : IParsable { - /// The action to perform on the target element. The possible values are: replace, append, delete, insert, or prepend. + /// The action to perform on the target element. Possible values are: replace, append, delete, insert, or prepend. public OnenotePatchActionType? Action { get; set; } /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } /// A string of well-formed HTML to add to the page, and any image or file binary data. If the content contains binary data, the request must be sent using the multipart/form-data content type with a 'Commands' part. public string Content { get; set; } - /// The location to add the supplied content, relative to the target element. The possible values are: after (default) or before. + /// The location to add the supplied content, relative to the target element. Possible values are: after (default) or before. public OnenotePatchInsertPosition? Position { get; set; } - /// The element to update. Must be the # or the generated of the element, or the body or title keyword. + /// The element to update. Must be the # or the generated {id} of the element, or the body or title keyword. public string Target { get; set; } /// /// Instantiates a new onenotePatchContentCommand and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/OnlineMeeting.cs b/src/generated/Models/Microsoft/Graph/OnlineMeeting.cs index 8159338b0bf..39096258f47 100644 --- a/src/generated/Models/Microsoft/Graph/OnlineMeeting.cs +++ b/src/generated/Models/Microsoft/Graph/OnlineMeeting.cs @@ -9,13 +9,15 @@ public class OnlineMeeting : Entity, IParsable { public bool? AllowAttendeeToEnableCamera { get; set; } /// Indicates whether attendees can turn on their microphone. public bool? AllowAttendeeToEnableMic { get; set; } - /// Specifies who can be a presenter in a meeting. Possible values are listed in the following table. + /// Specifies who can be a presenter in a meeting. public OnlineMeetingPresenters? AllowedPresenters { get; set; } /// Specifies the mode of meeting chat. public MeetingChatMode? AllowMeetingChat { get; set; } - /// Indicates whether Teams reactions are enabled for the meeting. + /// Indicates if Teams reactions are enabled for the meeting. public bool? AllowTeamworkReactions { get; set; } - /// The content stream of the attendee report of a Microsoft Teams live event. Read-only. + /// The attendance reports of an online meeting. Read-only. + public List AttendanceReports { get; set; } + /// The content stream of the attendee report of a Teams live event. Read-only. public byte[] AttendeeReport { get; set; } /// The phone access (dial-in) information for an online meeting. Read-only. public AudioConferencing AudioConferencing { get; set; } @@ -29,17 +31,17 @@ public class OnlineMeeting : Entity, IParsable { public DateTimeOffset? EndDateTime { get; set; } /// The external ID. A custom ID. Optional. public string ExternalId { get; set; } - /// Indicates if this is a Teams live event. + /// Indicates whether this is a Teams live event. public bool? IsBroadcast { get; set; } /// Indicates whether to announce when callers join or leave. public bool? IsEntryExitAnnounced { get; set; } - /// The join information in the language and locale variant specified in the Accept-Language request HTTP header. Read-only. + /// The join information in the language and locale variant specified in 'Accept-Language' request HTTP header. Read-only. public ItemBody JoinInformation { get; set; } /// The join URL of the online meeting. Read-only. public string JoinWebUrl { get; set; } - /// Specifies which participants can bypass the meeting lobby. + /// Specifies which participants can bypass the meeting lobby. public LobbyBypassSettings LobbyBypassSettings { get; set; } - /// The participants associated with the online meeting. This includes the organizer and the attendees. + /// The participants associated with the online meeting. This includes the organizer and the attendees. public MeetingParticipants Participants { get; set; } /// Indicates whether to record the meeting automatically. public bool? RecordAutomatically { get; set; } @@ -59,6 +61,7 @@ public class OnlineMeeting : Entity, IParsable { {"allowedPresenters", (o,n) => { (o as OnlineMeeting).AllowedPresenters = n.GetEnumValue(); } }, {"allowMeetingChat", (o,n) => { (o as OnlineMeeting).AllowMeetingChat = n.GetEnumValue(); } }, {"allowTeamworkReactions", (o,n) => { (o as OnlineMeeting).AllowTeamworkReactions = n.GetBoolValue(); } }, + {"attendanceReports", (o,n) => { (o as OnlineMeeting).AttendanceReports = n.GetCollectionOfObjectValues().ToList(); } }, {"attendeeReport", (o,n) => { (o as OnlineMeeting).AttendeeReport = n.GetByteArrayValue(); } }, {"audioConferencing", (o,n) => { (o as OnlineMeeting).AudioConferencing = n.GetObjectValue(); } }, {"broadcastSettings", (o,n) => { (o as OnlineMeeting).BroadcastSettings = n.GetObjectValue(); } }, @@ -90,6 +93,7 @@ public class OnlineMeeting : Entity, IParsable { writer.WriteEnumValue("allowedPresenters", AllowedPresenters); writer.WriteEnumValue("allowMeetingChat", AllowMeetingChat); writer.WriteBoolValue("allowTeamworkReactions", AllowTeamworkReactions); + writer.WriteCollectionOfObjectValues("attendanceReports", AttendanceReports); writer.WriteByteArrayValue("attendeeReport", AttendeeReport); writer.WriteObjectValue("audioConferencing", AudioConferencing); writer.WriteObjectValue("broadcastSettings", BroadcastSettings); diff --git a/src/generated/Models/Microsoft/Graph/Operation.cs b/src/generated/Models/Microsoft/Graph/Operation.cs index 1d1e84358d6..f0d0a70cb5d 100644 --- a/src/generated/Models/Microsoft/Graph/Operation.cs +++ b/src/generated/Models/Microsoft/Graph/Operation.cs @@ -9,7 +9,7 @@ public class Operation : Entity, IParsable { public DateTimeOffset? CreatedDateTime { get; set; } /// The time of the last action of the operation. public DateTimeOffset? LastActionDateTime { get; set; } - /// The current status of the operation: notStarted, running, completed, failed + /// Possible values are: notStarted, running, completed, failed. Read-only. public OperationStatus? Status { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/Organization.cs b/src/generated/Models/Microsoft/Graph/Organization.cs index 7e0a8123bd5..8331bdd5cae 100644 --- a/src/generated/Models/Microsoft/Graph/Organization.cs +++ b/src/generated/Models/Microsoft/Graph/Organization.cs @@ -22,19 +22,19 @@ public class Organization : DirectoryObject, IParsable { public DateTimeOffset? CreatedDateTime { get; set; } /// The display name for the tenant. public string DisplayName { get; set; } - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. public List Extensions { get; set; } /// Not nullable. public List MarketingNotificationEmails { get; set; } /// Mobile device management authority. Possible values are: unknown, intune, sccm, office365. public MdmAuthority? MobileDeviceManagementAuthority { get; set; } - /// The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. + /// The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. public DateTimeOffset? OnPremisesLastSyncDateTime { get; set; } - /// true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). + /// true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced; Nullable. null if this object has never been synced from an on-premises directory (default). public bool? OnPremisesSyncEnabled { get; set; } /// Postal code of the address for the organization. public string PostalCode { get; set; } - /// The preferred language for the organization. Should follow ISO 639-1 Code; for example, en. + /// The preferred language for the organization. Should follow ISO 639-1 Code; for example en. public string PreferredLanguage { get; set; } /// The privacy profile of an organization. public PrivacyProfile PrivacyProfile { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Participant.cs b/src/generated/Models/Microsoft/Graph/Participant.cs index 13aa55767c4..bdbe1442e1b 100644 --- a/src/generated/Models/Microsoft/Graph/Participant.cs +++ b/src/generated/Models/Microsoft/Graph/Participant.cs @@ -14,7 +14,7 @@ public class Participant : Entity, IParsable { public List MediaStreams { get; set; } /// A blob of data provided by the participant in the roster. public string Metadata { get; set; } - /// Information about whether the participant has recording capability. + /// Information on whether the participant has recording capability. public RecordingInfo RecordingInfo { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/ParticipantInfo.cs b/src/generated/Models/Microsoft/Graph/ParticipantInfo.cs index 46050debb39..c2d8524216a 100644 --- a/src/generated/Models/Microsoft/Graph/ParticipantInfo.cs +++ b/src/generated/Models/Microsoft/Graph/ParticipantInfo.cs @@ -16,7 +16,7 @@ public class ParticipantInfo : IParsable { public string LanguageId { get; set; } /// The participant ID of the participant. Read-only. public string ParticipantId { get; set; } - /// The home region of the participant. This can be a country, a continent, or a larger geographic region. This does not change based on the participant's current physical location. Read-only. + /// The home region of the participant. This can be a country, a continent, or a larger geographic region. This does not change based on the participant's current physical location, unlike countryCode. Read-only. public string Region { get; set; } /// /// Instantiates a new participantInfo and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/PatternedRecurrence.cs b/src/generated/Models/Microsoft/Graph/PatternedRecurrence.cs index f7385423230..d8b96fb5384 100644 --- a/src/generated/Models/Microsoft/Graph/PatternedRecurrence.cs +++ b/src/generated/Models/Microsoft/Graph/PatternedRecurrence.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class PatternedRecurrence : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The frequency of an event. Do not specify for a one-time access review. + /// The frequency of an event. Do not specify for a one-time access review. For access reviews: Do not specify this property for a one-time access review. Only interval, dayOfMonth, and type (weekly, absoluteMonthly) properties of recurrencePattern are supported. public RecurrencePattern Pattern { get; set; } /// The duration of an event. public RecurrenceRange Range { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Permission.cs b/src/generated/Models/Microsoft/Graph/Permission.cs index 4f8d9d51b5d..c76fed76d1d 100644 --- a/src/generated/Models/Microsoft/Graph/Permission.cs +++ b/src/generated/Models/Microsoft/Graph/Permission.cs @@ -7,13 +7,13 @@ namespace ApiSdk.Models.Microsoft.Graph { public class Permission : Entity, IParsable { /// A format of yyyy-MM-ddTHH:mm:ssZ of DateTimeOffset indicates the expiration time of the permission. DateTime.MinValue indicates there is no expiration set for this permission. Optional. public DateTimeOffset? ExpirationDateTime { get; set; } - /// For user type permissions, the details of the users & applications for this permission. Read-only. public IdentitySet GrantedTo { get; set; } - /// For link type permissions, the details of the users to whom permission was granted. Read-only. public List GrantedToIdentities { get; set; } + /// For link type permissions, the details of the users to whom permission was granted. Read-only. public List GrantedToIdentitiesV2 { get; set; } + /// For user type permissions, the details of the users and applications for this permission. Read-only. public SharePointIdentitySet GrantedToV2 { get; set; } - /// This indicates whether password is set for this permission, it's only showing in response. Optional and Read-only and for OneDrive Personal only. + /// Indicates whether the password is set for this permission. This property only appears in the response. Optional. Read-only. For OneDrive Personal only. public bool? HasPassword { get; set; } /// Provides a reference to the ancestor of the current permission, if it is inherited from an ancestor. Read-only. public ItemReference InheritedFrom { get; set; } @@ -21,9 +21,9 @@ public class Permission : Entity, IParsable { public SharingInvitation Invitation { get; set; } /// Provides the link details of the current permission, if it is a link type permissions. Read-only. public SharingLink Link { get; set; } - /// The type of permission, e.g. read. See below for the full list of roles. Read-only. + /// The type of permission, for example, read. See below for the full list of roles. Read-only. public List Roles { get; set; } - /// A unique token that can be used to access this shared item via the **shares** API. Read-only. + /// A unique token that can be used to access this shared item via the [shares API][]. Read-only. public string ShareId { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/PermissionGrantConditionSet.cs b/src/generated/Models/Microsoft/Graph/PermissionGrantConditionSet.cs index 0f83e38477b..22080699476 100644 --- a/src/generated/Models/Microsoft/Graph/PermissionGrantConditionSet.cs +++ b/src/generated/Models/Microsoft/Graph/PermissionGrantConditionSet.cs @@ -15,7 +15,7 @@ public class PermissionGrantConditionSet : Entity, IParsable { public List ClientApplicationTenantIds { get; set; } /// The permission classification for the permission being granted, or all to match with any permission classification (including permissions which are not classified). Default is all. public string PermissionClassification { get; set; } - /// The list of id values for the specific permissions to match with, or a list with the single value all to match with any permission. The id of delegated permissions can be found in the oauth2PermissionScopes property of the API's **servicePrincipal** object. The id of application permissions can be found in the appRoles property of the API's **servicePrincipal** object. The id of resource-specific application permissions can be found in the resourceSpecificApplicationPermissions property of the API's **servicePrincipal** object. Default is the single value all. + /// The list of id values for the specific permissions to match with, or a list with the single value all to match with any permission. The id of delegated permissions can be found in the publishedPermissionScopes property of the API's **servicePrincipal** object. The id of application permissions can be found in the appRoles property of the API's **servicePrincipal** object. The id of resource-specific application permissions can be found in the resourceSpecificApplicationPermissions property of the API's **servicePrincipal** object. Default is the single value all. public List Permissions { get; set; } /// The permission type of the permission being granted. Possible values: application for application permissions (e.g. app roles), or delegated for delegated permissions. The value delegatedUserConsentable indicates delegated permissions which have not been configured by the API publisher to require admin consent—this value may be used in built-in permission grant policies, but cannot be used in custom permission grant policies. Required. public PermissionType? PermissionType { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/PermissionScope.cs b/src/generated/Models/Microsoft/Graph/PermissionScope.cs index cf795c60140..ef89c790319 100644 --- a/src/generated/Models/Microsoft/Graph/PermissionScope.cs +++ b/src/generated/Models/Microsoft/Graph/PermissionScope.cs @@ -16,7 +16,7 @@ public class PermissionScope : IParsable { /// When creating or updating a permission, this property must be set to true (which is the default). To delete a permission, this property must first be set to false. At that point, in a subsequent call, the permission may be removed. public bool? IsEnabled { get; set; } public string Origin { get; set; } - /// Specifies whether this delegated permission should be considered safe for non-admin users to consent to on behalf of themselves, or whether an administrator should be required for consent to the permissions. This will be the default behavior, but each customer can choose to customize the behavior in their organization (by allowing, restricting or limiting user consent to this delegated permission.) + /// The possible values are: User and Admin. Specifies whether this delegated permission should be considered safe for non-admin users to consent to on behalf of themselves, or whether an administrator consent should always be required. While Microsoft Graph defines the default consent requirement for each permission, the tenant administrator may override the behavior in their organization (by allowing, restricting, or limiting user consent to this delegated permission). For more information, see Configure how users consent to applications. public string Type { get; set; } /// A description of the delegated permissions, intended to be read by a user granting the permission on their own behalf. This text appears in consent experiences where the user is consenting only on behalf of themselves. public string UserConsentDescription { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Person.cs b/src/generated/Models/Microsoft/Graph/Person.cs index 30675973ecf..7cf78a6b864 100644 --- a/src/generated/Models/Microsoft/Graph/Person.cs +++ b/src/generated/Models/Microsoft/Graph/Person.cs @@ -25,7 +25,7 @@ public class Person : Entity, IParsable { public string OfficeLocation { get; set; } /// Free-form notes that the user has taken about this person. public string PersonNotes { get; set; } - /// The type of person. + /// The type of person, for example distribution list. public PersonType PersonType { get; set; } /// The person's phone numbers. public List Phones { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Phone.cs b/src/generated/Models/Microsoft/Graph/Phone.cs index 19216356d05..fe6a9e7f0af 100644 --- a/src/generated/Models/Microsoft/Graph/Phone.cs +++ b/src/generated/Models/Microsoft/Graph/Phone.cs @@ -11,7 +11,7 @@ public class Phone : IParsable { /// The phone number. public string Number { get; set; } public string Region { get; set; } - /// The type of phone number. The possible values are: home, business, mobile, other, assistant, homeFax, businessFax, otherFax, pager, radio. + /// The type of phone number. Possible values are: home, business, mobile, other, assistant, homeFax, businessFax, otherFax, pager, radio. public PhoneType? Type { get; set; } /// /// Instantiates a new phone and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/Photo.cs b/src/generated/Models/Microsoft/Graph/Photo.cs index 62f4e7e01ea..497868b6ab2 100644 --- a/src/generated/Models/Microsoft/Graph/Photo.cs +++ b/src/generated/Models/Microsoft/Graph/Photo.cs @@ -23,7 +23,7 @@ public class Photo : IParsable { public int? Iso { get; set; } /// The orientation value from the camera. Writable on OneDrive Personal. public int? Orientation { get; set; } - /// Represents the date and time the photo was taken. Read-only. + /// The date and time the photo was taken in UTC time. Read-only. public DateTimeOffset? TakenDateTime { get; set; } /// /// Instantiates a new photo and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/PlannerPlan.cs b/src/generated/Models/Microsoft/Graph/PlannerPlan.cs index 23e6b014d6c..54a9861fb05 100644 --- a/src/generated/Models/Microsoft/Graph/PlannerPlan.cs +++ b/src/generated/Models/Microsoft/Graph/PlannerPlan.cs @@ -5,17 +5,17 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class PlannerPlan : Entity, IParsable { - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. public List Buckets { get; set; } /// Read-only. The user who created the plan. public IdentitySet CreatedBy { get; set; } /// Read-only. Date and time at which the plan is created. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z public DateTimeOffset? CreatedDateTime { get; set; } - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. public PlannerPlanDetails Details { get; set; } /// ID of the Group that owns the plan. A valid group must exist before this field can be set. After it is set, this property can’t be updated. public string Owner { get; set; } - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. public List Tasks { get; set; } /// Required. Title of the plan. public string Title { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/PlannerPlanDetails.cs b/src/generated/Models/Microsoft/Graph/PlannerPlanDetails.cs index 874b7423eb9..c3e916c0637 100644 --- a/src/generated/Models/Microsoft/Graph/PlannerPlanDetails.cs +++ b/src/generated/Models/Microsoft/Graph/PlannerPlanDetails.cs @@ -5,9 +5,9 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class PlannerPlanDetails : Entity, IParsable { - /// An object that specifies the descriptions of the six categories that can be associated with tasks in the plan + /// An object that specifies the descriptions of the 25 categories that can be associated with tasks in the plan public PlannerCategoryDescriptions CategoryDescriptions { get; set; } - /// Set of user ids that this plan is shared with. If you are leveraging Microsoft 365 groups, use the Groups API to manage group membership to share the group's plan. You can also add existing members of the group to this collection though it is not required for them to access the plan owned by the group. + /// The set of user IDs that this plan is shared with. If you are using Microsoft 365 groups, use the groups API to manage group membership to share the group's plan. You can also add existing members of the group to this collection, although it is not required in order for them to access the plan owned by the group. public PlannerUserIds SharedWith { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/PlannerTask.cs b/src/generated/Models/Microsoft/Graph/PlannerTask.cs index bd77d61a9b6..f784f9b0a08 100644 --- a/src/generated/Models/Microsoft/Graph/PlannerTask.cs +++ b/src/generated/Models/Microsoft/Graph/PlannerTask.cs @@ -43,7 +43,7 @@ public class PlannerTask : Entity, IParsable { public int? PercentComplete { get; set; } /// Plan ID to which the task belongs. public string PlanId { get; set; } - /// This sets the type of preview that shows up on the task. The possible values are: automatic, noPreview, checklist, description, reference. + /// This sets the type of preview that shows up on the task. Possible values are: automatic, noPreview, checklist, description, reference. public PlannerPreviewType? PreviewType { get; set; } /// Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress. public PlannerProgressTaskBoardTaskFormat ProgressTaskBoardFormat { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/PlannerTaskDetails.cs b/src/generated/Models/Microsoft/Graph/PlannerTaskDetails.cs index c056d4a95fa..f707d296ad2 100644 --- a/src/generated/Models/Microsoft/Graph/PlannerTaskDetails.cs +++ b/src/generated/Models/Microsoft/Graph/PlannerTaskDetails.cs @@ -9,7 +9,7 @@ public class PlannerTaskDetails : Entity, IParsable { public PlannerChecklistItems Checklist { get; set; } /// Description of the task public string Description { get; set; } - /// This sets the type of preview that shows up on the task. The possible values are: automatic, noPreview, checklist, description, reference. When set to automatic the displayed preview is chosen by the app viewing the task. + /// This sets the type of preview that shows up on the task. Possible values are: automatic, noPreview, checklist, description, reference. When set to automatic the displayed preview is chosen by the app viewing the task. public PlannerPreviewType? PreviewType { get; set; } /// The collection of references on the task. public PlannerExternalReferences References { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/PlannerUser.cs b/src/generated/Models/Microsoft/Graph/PlannerUser.cs index 8706ed95b50..f1e3b5df36f 100644 --- a/src/generated/Models/Microsoft/Graph/PlannerUser.cs +++ b/src/generated/Models/Microsoft/Graph/PlannerUser.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class PlannerUser : Entity, IParsable { /// Read-only. Nullable. Returns the plannerTasks assigned to the user. public List Plans { get; set; } - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. public List Tasks { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/Post.cs b/src/generated/Models/Microsoft/Graph/Post.cs index a723f492886..f57ebd5deeb 100644 --- a/src/generated/Models/Microsoft/Graph/Post.cs +++ b/src/generated/Models/Microsoft/Graph/Post.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class Post : OutlookItem, IParsable { - /// Read-only. Nullable. Supports $expand. + /// The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the post. Read-only. Nullable. Supports $expand. public List Attachments { get; set; } /// The contents of the post. This is a default property. This property can be null. public ItemBody Body { get; set; } @@ -18,7 +18,7 @@ public class Post : OutlookItem, IParsable { public Recipient From { get; set; } /// Indicates whether the post has at least one attachment. This is a default property. public bool? HasAttachments { get; set; } - /// Read-only. Supports $expand. + /// The earlier post that this post is replying to in the conversationThread. Read-only. Supports $expand. public Post InReplyTo { get; set; } /// The collection of multi-value extended properties defined for the post. Read-only. Nullable. public List MultiValueExtendedProperties { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Presence.cs b/src/generated/Models/Microsoft/Graph/Presence.cs index 04f62d36ce1..37e86f6a881 100644 --- a/src/generated/Models/Microsoft/Graph/Presence.cs +++ b/src/generated/Models/Microsoft/Graph/Presence.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class Presence : Entity, IParsable { - /// The supplemental information to a user's availability. Possible values are Available, Away, BeRightBack, Busy, DoNotDisturb, InACall, InAConferenceCall, Inactive, InAMeeting, Offline, OffWork, OutOfOffice, PresenceUnknown, Presenting, UrgentInterruptionsOnly. + /// The supplemental information to a user's availability. Possible values are Available, Away, BeRightBack, Busy, DoNotDisturb, InACall, InAConferenceCall, Inactive,InAMeeting, Offline, OffWork,OutOfOffice, PresenceUnknown,Presenting, UrgentInterruptionsOnly. public string Activity { get; set; } /// The base presence information for a user. Possible values are Available, AvailableIdle, Away, BeRightBack, Busy, BusyIdle, DoNotDisturb, Offline, PresenceUnknown public string Availability { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/PrintJobConfiguration.cs b/src/generated/Models/Microsoft/Graph/PrintJobConfiguration.cs index 958ce825226..4cabc481d70 100644 --- a/src/generated/Models/Microsoft/Graph/PrintJobConfiguration.cs +++ b/src/generated/Models/Microsoft/Graph/PrintJobConfiguration.cs @@ -26,7 +26,7 @@ public class PrintJobConfiguration : IParsable { public string InputBin { get; set; } /// The margin settings to use when printing. public PrintMargin Margin { get; set; } - /// The media size to use when printing. Supports standard size names for ISO and ANSI media sizes. Valid values listed in the printerCapabilities topic. + /// The media sizeto use when printing. Supports standard size names for ISO and ANSI media sizes. Valid values are listed in the printerCapabilities topic. public string MediaSize { get; set; } /// The default media (such as paper) type to print the document on. public string MediaType { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/PrintTask.cs b/src/generated/Models/Microsoft/Graph/PrintTask.cs index 0c74348282c..ddd2442f212 100644 --- a/src/generated/Models/Microsoft/Graph/PrintTask.cs +++ b/src/generated/Models/Microsoft/Graph/PrintTask.cs @@ -6,7 +6,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class PrintTask : Entity, IParsable { public PrintTaskDefinition Definition { get; set; } - /// The URL for the print entity that triggered this task. For example, https://graph.microsoft.com/v1.0/print/printers/{printerId}/jobs/{jobId}. Read-only. + /// The URL for the print entity that triggered this task. For example, https://graph.microsoft.com/beta/print/printers/{printerId}/jobs/{jobId}. Read-only. public string ParentUrl { get; set; } public PrintTaskStatus Status { get; set; } public PrintTaskTrigger Trigger { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/RecordingInfo.cs b/src/generated/Models/Microsoft/Graph/RecordingInfo.cs index ca9abb919b7..ce754e38ea7 100644 --- a/src/generated/Models/Microsoft/Graph/RecordingInfo.cs +++ b/src/generated/Models/Microsoft/Graph/RecordingInfo.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class RecordingInfo : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The identities of the recording initiator. + /// The identities of recording initiator. public IdentitySet Initiator { get; set; } /// Possible values are: unknown, notRecording, recording, or failed. public RecordingStatus? RecordingStatus { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/RecurrencePattern.cs b/src/generated/Models/Microsoft/Graph/RecurrencePattern.cs index 07b70c37db5..3ea479aa315 100644 --- a/src/generated/Models/Microsoft/Graph/RecurrencePattern.cs +++ b/src/generated/Models/Microsoft/Graph/RecurrencePattern.cs @@ -19,7 +19,7 @@ public class RecurrencePattern : IParsable { public int? Interval { get; set; } /// The month in which the event occurs. This is a number from 1 to 12. public int? Month { get; set; } - /// The recurrence pattern type: daily, weekly, absoluteMonthly, relativeMonthly, absoluteYearly, relativeYearly. Required. + /// The recurrence pattern type: daily, weekly, absoluteMonthly, relativeMonthly, absoluteYearly, relativeYearly. Required. For more information, see values of type property. public RecurrencePatternType? Type { get; set; } /// /// Instantiates a new recurrencePattern and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/RecurrenceRange.cs b/src/generated/Models/Microsoft/Graph/RecurrenceRange.cs index 6abace44d30..2f685a1157a 100644 --- a/src/generated/Models/Microsoft/Graph/RecurrenceRange.cs +++ b/src/generated/Models/Microsoft/Graph/RecurrenceRange.cs @@ -15,7 +15,7 @@ public class RecurrenceRange : IParsable { public string RecurrenceTimeZone { get; set; } /// The date to start applying the recurrence pattern. The first occurrence of the meeting may be this date or later, depending on the recurrence pattern of the event. Must be the same value as the start property of the recurring event. Required. public string StartDate { get; set; } - /// The recurrence range. The possible values are: endDate, noEnd, numbered. Required. + /// The recurrence range. Possible values are: endDate, noEnd, numbered. Required. public RecurrenceRangeType? Type { get; set; } /// /// Instantiates a new recurrenceRange and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/RegistrationEnforcement.cs b/src/generated/Models/Microsoft/Graph/RegistrationEnforcement.cs index b172149ad32..607f8789695 100644 --- a/src/generated/Models/Microsoft/Graph/RegistrationEnforcement.cs +++ b/src/generated/Models/Microsoft/Graph/RegistrationEnforcement.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class RegistrationEnforcement : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Run campaigns to remind users to set up targeted authentication methods. + /// Run campaigns to remind users to setup targeted authentication methods. public AuthenticationMethodsRegistrationCampaign AuthenticationMethodsRegistrationCampaign { get; set; } /// /// Instantiates a new registrationEnforcement and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/RelatedContact.cs b/src/generated/Models/Microsoft/Graph/RelatedContact.cs index a4fc8b552ef..ca58aa3f902 100644 --- a/src/generated/Models/Microsoft/Graph/RelatedContact.cs +++ b/src/generated/Models/Microsoft/Graph/RelatedContact.cs @@ -11,11 +11,11 @@ public class RelatedContact : IParsable { public IDictionary AdditionalData { get; set; } /// Name of the contact. Required. public string DisplayName { get; set; } - /// Primary email address of the contact. + /// Email address of the contact. public string EmailAddress { get; set; } /// Mobile phone number of the contact. public string MobilePhone { get; set; } - /// Relationship to the user. Possible values are parent, relative, aide, doctor, guardian, child, other, unknownFutureValue. + /// Relationship to the user. Possible values are: parent, relative, aide, doctor, guardian, child, other, unknownFutureValue. public ContactRelationship? Relationship { get; set; } /// /// Instantiates a new relatedContact and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/Report.cs b/src/generated/Models/Microsoft/Graph/Report.cs index 35c6e54bcc1..d3951bd07af 100644 --- a/src/generated/Models/Microsoft/Graph/Report.cs +++ b/src/generated/Models/Microsoft/Graph/Report.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class Report : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Not yet documented + /// Report content; details vary by report type. public byte[] Content { get; set; } /// /// Instantiates a new report and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/RiskDetection.cs b/src/generated/Models/Microsoft/Graph/RiskDetection.cs new file mode 100644 index 00000000000..4cf408d1279 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/RiskDetection.cs @@ -0,0 +1,100 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class RiskDetection : Entity, IParsable { + /// Indicates the activity type the detected risk is linked to. The possible values are signin, user, unknownFutureValue. + public ActivityType? Activity { get; set; } + /// Date and time that the risky activity occurred. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z + public DateTimeOffset? ActivityDateTime { get; set; } + /// Additional information associated with the risk detection in JSON format. + public string AdditionalInfo { get; set; } + /// Correlation ID of the sign-in associated with the risk detection. This property is null if the risk detection is not associated with a sign-in. + public string CorrelationId { get; set; } + /// Date and time that the risk was detected. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z + public DateTimeOffset? DetectedDateTime { get; set; } + /// Timing of the detected risk (real-time/offline). The possible values are notDefined, realtime, nearRealtime, offline, unknownFutureValue. + public RiskDetectionTimingType? DetectionTimingType { get; set; } + /// Provides the IP address of the client from where the risk occurred. + public string IpAddress { get; set; } + /// Date and time that the risk detection was last updated. + public DateTimeOffset? LastUpdatedDateTime { get; set; } + /// Location of the sign-in. + public SignInLocation Location { get; set; } + /// Request ID of the sign-in associated with the risk detection. This property is null if the risk detection is not associated with a sign-in. + public string RequestId { get; set; } + /// Details of the detected risk. The possible values are none, adminGeneratedTemporaryPassword, userPerformedSecuredPasswordChange, userPerformedSecuredPasswordReset, adminConfirmedSigninSafe, aiConfirmedSigninSafe, userPassedMFADrivenByRiskBasedPolicy, adminDismissedAllRiskForUser, adminConfirmedSigninCompromised, hidden, adminConfirmedUserCompromised, unknownFutureValue. Note: Details for this property are only available for Azure AD Premium P2 customers. P1 customers will be returned hidden. + public RiskDetail? RiskDetail { get; set; } + /// The type of risk event detected. The possible values are unlikelyTravel, anonymizedIPAddress, maliciousIPAddress, unfamiliarFeatures, malwareInfectedIPAddress, suspiciousIPAddress, leakedCredentials, investigationsThreatIntelligence, generic,adminConfirmedUserCompromised, mcasImpossibleTravel, mcasSuspiciousInboxManipulationRules, investigationsThreatIntelligenceSigninLinked, maliciousIPAddressValidCredentialsBlockedIP, and unknownFutureValue. + public string RiskEventType { get; set; } + /// Level of the detected risk. The possible values are low, medium, high, hidden, none, unknownFutureValue. Note: Details for this property are only available for Azure AD Premium P2 customers. P1 customers will be returned hidden. + public RiskLevel? RiskLevel { get; set; } + /// The state of a detected risky user or sign-in. The possible values are none, confirmedSafe, remediated, dismissed, atRisk, confirmedCompromised, and unknownFutureValue. + public RiskState? RiskState { get; set; } + /// Source of the risk detection. For example, activeDirectory. + public string Source { get; set; } + /// Indicates the type of token issuer for the detected sign-in risk. The possible values are AzureAD, ADFederationServices, and unknownFutureValue. + public TokenIssuerType? TokenIssuerType { get; set; } + /// Name of the user. + public string UserDisplayName { get; set; } + /// Unique ID of the user. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z + public string UserId { get; set; } + /// The user principal name (UPN) of the user. + public string UserPrincipalName { get; set; } + /// + /// The deserialization information for the current model + /// + public new IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + {"activity", (o,n) => { (o as RiskDetection).Activity = n.GetEnumValue(); } }, + {"activityDateTime", (o,n) => { (o as RiskDetection).ActivityDateTime = n.GetDateTimeOffsetValue(); } }, + {"additionalInfo", (o,n) => { (o as RiskDetection).AdditionalInfo = n.GetStringValue(); } }, + {"correlationId", (o,n) => { (o as RiskDetection).CorrelationId = n.GetStringValue(); } }, + {"detectedDateTime", (o,n) => { (o as RiskDetection).DetectedDateTime = n.GetDateTimeOffsetValue(); } }, + {"detectionTimingType", (o,n) => { (o as RiskDetection).DetectionTimingType = n.GetEnumValue(); } }, + {"ipAddress", (o,n) => { (o as RiskDetection).IpAddress = n.GetStringValue(); } }, + {"lastUpdatedDateTime", (o,n) => { (o as RiskDetection).LastUpdatedDateTime = n.GetDateTimeOffsetValue(); } }, + {"location", (o,n) => { (o as RiskDetection).Location = n.GetObjectValue(); } }, + {"requestId", (o,n) => { (o as RiskDetection).RequestId = n.GetStringValue(); } }, + {"riskDetail", (o,n) => { (o as RiskDetection).RiskDetail = n.GetEnumValue(); } }, + {"riskEventType", (o,n) => { (o as RiskDetection).RiskEventType = n.GetStringValue(); } }, + {"riskLevel", (o,n) => { (o as RiskDetection).RiskLevel = n.GetEnumValue(); } }, + {"riskState", (o,n) => { (o as RiskDetection).RiskState = n.GetEnumValue(); } }, + {"source", (o,n) => { (o as RiskDetection).Source = n.GetStringValue(); } }, + {"tokenIssuerType", (o,n) => { (o as RiskDetection).TokenIssuerType = n.GetEnumValue(); } }, + {"userDisplayName", (o,n) => { (o as RiskDetection).UserDisplayName = n.GetStringValue(); } }, + {"userId", (o,n) => { (o as RiskDetection).UserId = n.GetStringValue(); } }, + {"userPrincipalName", (o,n) => { (o as RiskDetection).UserPrincipalName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public new void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteEnumValue("activity", Activity); + writer.WriteDateTimeOffsetValue("activityDateTime", ActivityDateTime); + writer.WriteStringValue("additionalInfo", AdditionalInfo); + writer.WriteStringValue("correlationId", CorrelationId); + writer.WriteDateTimeOffsetValue("detectedDateTime", DetectedDateTime); + writer.WriteEnumValue("detectionTimingType", DetectionTimingType); + writer.WriteStringValue("ipAddress", IpAddress); + writer.WriteDateTimeOffsetValue("lastUpdatedDateTime", LastUpdatedDateTime); + writer.WriteObjectValue("location", Location); + writer.WriteStringValue("requestId", RequestId); + writer.WriteEnumValue("riskDetail", RiskDetail); + writer.WriteStringValue("riskEventType", RiskEventType); + writer.WriteEnumValue("riskLevel", RiskLevel); + writer.WriteEnumValue("riskState", RiskState); + writer.WriteStringValue("source", Source); + writer.WriteEnumValue("tokenIssuerType", TokenIssuerType); + writer.WriteStringValue("userDisplayName", UserDisplayName); + writer.WriteStringValue("userId", UserId); + writer.WriteStringValue("userPrincipalName", UserPrincipalName); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/RiskDetectionTimingType.cs b/src/generated/Models/Microsoft/Graph/RiskDetectionTimingType.cs new file mode 100644 index 00000000000..46dff52e3f5 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/RiskDetectionTimingType.cs @@ -0,0 +1,9 @@ +namespace ApiSdk.Models.Microsoft.Graph { + public enum RiskDetectionTimingType { + NotDefined, + Realtime, + NearRealtime, + Offline, + UnknownFutureValue, + } +} diff --git a/src/generated/Models/Microsoft/Graph/RiskUserActivity.cs b/src/generated/Models/Microsoft/Graph/RiskUserActivity.cs new file mode 100644 index 00000000000..759071fc6ba --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/RiskUserActivity.cs @@ -0,0 +1,40 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class RiskUserActivity : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The possible values are none, adminGeneratedTemporaryPassword, userPerformedSecuredPasswordChange, userPerformedSecuredPasswordReset, adminConfirmedSigninSafe, aiConfirmedSigninSafe, userPassedMFADrivenByRiskBasedPolicy, adminDismissedAllRiskForUser, adminConfirmedSigninCompromised, hidden, adminConfirmedUserCompromised, unknownFutureValue. + public RiskDetail? Detail { get; set; } + /// The type of risk event detected. + public List RiskEventTypes { get; set; } + /// + /// Instantiates a new riskUserActivity and sets the default values. + /// + public RiskUserActivity() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"detail", (o,n) => { (o as RiskUserActivity).Detail = n.GetEnumValue(); } }, + {"riskEventTypes", (o,n) => { (o as RiskUserActivity).RiskEventTypes = n.GetCollectionOfPrimitiveValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("detail", Detail); + writer.WriteCollectionOfPrimitiveValues("riskEventTypes", RiskEventTypes); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/RiskyUser.cs b/src/generated/Models/Microsoft/Graph/RiskyUser.cs new file mode 100644 index 00000000000..3920cb0d02b --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/RiskyUser.cs @@ -0,0 +1,60 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class RiskyUser : Entity, IParsable { + /// The activity related to user risk level change + public List History { get; set; } + /// Indicates whether the user is deleted. Possible values are: true, false. + public bool? IsDeleted { get; set; } + /// Indicates whether a user's risky state is being processed by the backend. + public bool? IsProcessing { get; set; } + /// The possible values are none, adminGeneratedTemporaryPassword, userPerformedSecuredPasswordChange, userPerformedSecuredPasswordReset, adminConfirmedSigninSafe, aiConfirmedSigninSafe, userPassedMFADrivenByRiskBasedPolicy, adminDismissedAllRiskForUser, adminConfirmedSigninCompromised, hidden, adminConfirmedUserCompromised, unknownFutureValue. + public RiskDetail? RiskDetail { get; set; } + /// The date and time that the risky user was last updated. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. + public DateTimeOffset? RiskLastUpdatedDateTime { get; set; } + /// Level of the detected risky user. The possible values are low, medium, high, hidden, none, unknownFutureValue. + public RiskLevel? RiskLevel { get; set; } + /// State of the user's risk. Possible values are: none, confirmedSafe, remediated, dismissed, atRisk, confirmedCompromised, unknownFutureValue. + public RiskState? RiskState { get; set; } + /// Risky user display name. + public string UserDisplayName { get; set; } + /// Risky user principal name. + public string UserPrincipalName { get; set; } + /// + /// The deserialization information for the current model + /// + public new IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + {"history", (o,n) => { (o as RiskyUser).History = n.GetCollectionOfObjectValues().ToList(); } }, + {"isDeleted", (o,n) => { (o as RiskyUser).IsDeleted = n.GetBoolValue(); } }, + {"isProcessing", (o,n) => { (o as RiskyUser).IsProcessing = n.GetBoolValue(); } }, + {"riskDetail", (o,n) => { (o as RiskyUser).RiskDetail = n.GetEnumValue(); } }, + {"riskLastUpdatedDateTime", (o,n) => { (o as RiskyUser).RiskLastUpdatedDateTime = n.GetDateTimeOffsetValue(); } }, + {"riskLevel", (o,n) => { (o as RiskyUser).RiskLevel = n.GetEnumValue(); } }, + {"riskState", (o,n) => { (o as RiskyUser).RiskState = n.GetEnumValue(); } }, + {"userDisplayName", (o,n) => { (o as RiskyUser).UserDisplayName = n.GetStringValue(); } }, + {"userPrincipalName", (o,n) => { (o as RiskyUser).UserPrincipalName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public new void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("history", History); + writer.WriteBoolValue("isDeleted", IsDeleted); + writer.WriteBoolValue("isProcessing", IsProcessing); + writer.WriteEnumValue("riskDetail", RiskDetail); + writer.WriteDateTimeOffsetValue("riskLastUpdatedDateTime", RiskLastUpdatedDateTime); + writer.WriteEnumValue("riskLevel", RiskLevel); + writer.WriteEnumValue("riskState", RiskState); + writer.WriteStringValue("userDisplayName", UserDisplayName); + writer.WriteStringValue("userPrincipalName", UserPrincipalName); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/RiskyUserHistoryItem.cs b/src/generated/Models/Microsoft/Graph/RiskyUserHistoryItem.cs new file mode 100644 index 00000000000..0426bd1192e --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/RiskyUserHistoryItem.cs @@ -0,0 +1,36 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class RiskyUserHistoryItem : RiskyUser, IParsable { + /// The activity related to user risk level change. + public RiskUserActivity Activity { get; set; } + /// The id of actor that does the operation. + public string InitiatedBy { get; set; } + /// The id of the user. + public string UserId { get; set; } + /// + /// The deserialization information for the current model + /// + public new IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + {"activity", (o,n) => { (o as RiskyUserHistoryItem).Activity = n.GetObjectValue(); } }, + {"initiatedBy", (o,n) => { (o as RiskyUserHistoryItem).InitiatedBy = n.GetStringValue(); } }, + {"userId", (o,n) => { (o as RiskyUserHistoryItem).UserId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public new void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("activity", Activity); + writer.WriteStringValue("initiatedBy", InitiatedBy); + writer.WriteStringValue("userId", UserId); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/RoleManagement.cs b/src/generated/Models/Microsoft/Graph/RoleManagement.cs index 6b223ff9151..43800930277 100644 --- a/src/generated/Models/Microsoft/Graph/RoleManagement.cs +++ b/src/generated/Models/Microsoft/Graph/RoleManagement.cs @@ -9,7 +9,7 @@ public class RoleManagement : IParsable { public IDictionary AdditionalData { get; set; } /// Read-only. Nullable. public RbacApplication Directory { get; set; } - /// The RbacApplication for Entitlement Management + /// Container for all entitlement management resources in Azure AD identity governance. public RbacApplication EntitlementManagement { get; set; } /// /// Instantiates a new RoleManagement and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/SchemaExtension.cs b/src/generated/Models/Microsoft/Graph/SchemaExtension.cs index 41b407fdc61..0286ed0e996 100644 --- a/src/generated/Models/Microsoft/Graph/SchemaExtension.cs +++ b/src/generated/Models/Microsoft/Graph/SchemaExtension.cs @@ -13,7 +13,7 @@ public class SchemaExtension : Entity, IParsable { public List Properties { get; set; } /// The lifecycle state of the schema extension. Possible states are InDevelopment, Available, and Deprecated. Automatically set to InDevelopment on creation. Schema extensions provides more information on the possible state transitions and behaviors. Supports $filter (eq). public string Status { get; set; } - /// Set of Microsoft Graph types (that can support extensions) that the schema extension can be applied to. Select from contact, device, event, group, message, organization, post, or user. + /// Set of Microsoft Graph types (that can support extensions) that the schema extension can be applied to. Select from administrativeUnit, contact, device, event, group, message, organization, post, or user. public List TargetTypes { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/SecureScoreControlProfile.cs b/src/generated/Models/Microsoft/Graph/SecureScoreControlProfile.cs index 7c079f24616..d3f7fe17c9c 100644 --- a/src/generated/Models/Microsoft/Graph/SecureScoreControlProfile.cs +++ b/src/generated/Models/Microsoft/Graph/SecureScoreControlProfile.cs @@ -13,7 +13,7 @@ public class SecureScoreControlProfile : Entity, IParsable { public string AzureTenantId { get; set; } /// The collection of compliance information associated with secure score control public List ComplianceInformation { get; set; } - /// Control action category (Identity, Data, Device, Apps, Infrastructure). + /// Control action category (Account, Data, Device, Apps, Infrastructure). public string ControlCategory { get; set; } /// Flag to indicate where the tenant has marked a control (ignore, thirdParty, reviewed) (supports update). public List ControlStateUpdates { get; set; } @@ -23,7 +23,7 @@ public class SecureScoreControlProfile : Entity, IParsable { public string ImplementationCost { get; set; } /// Time at which the control profile entity was last modified. The Timestamp type represents date and time public DateTimeOffset? LastModifiedDateTime { get; set; } - /// max attainable score for the control. + /// Current obtained max score on specified date. public double? MaxScore { get; set; } /// Microsoft's stack ranking of control. public int? Rank { get; set; } @@ -33,7 +33,7 @@ public class SecureScoreControlProfile : Entity, IParsable { public string RemediationImpact { get; set; } /// Service that owns the control (Exchange, Sharepoint, Azure AD). public string Service { get; set; } - /// List of threats the control mitigates (accountBreach,dataDeletion,dataExfiltration,dataSpillage, + /// List of threats the control mitigates (accountBreach,dataDeletion,dataExfiltration,dataSpillage,elevationOfPrivilege,maliciousInsider,passwordCracking,phishingOrWhaling,spoofing). public List Threats { get; set; } /// Control tier (Core, Defense in Depth, Advanced.) public string Tier { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Security.cs b/src/generated/Models/Microsoft/Graph/Security.cs index a697ec5e2a3..4b0868d3cd0 100644 --- a/src/generated/Models/Microsoft/Graph/Security.cs +++ b/src/generated/Models/Microsoft/Graph/Security.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class Security : Entity, IParsable { - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. public List Alerts { get; set; } public List SecureScoreControlProfiles { get; set; } public List SecureScores { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/ServiceAnnouncementAttachment.cs b/src/generated/Models/Microsoft/Graph/ServiceAnnouncementAttachment.cs new file mode 100644 index 00000000000..64c1c7b9d4f --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/ServiceAnnouncementAttachment.cs @@ -0,0 +1,39 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class ServiceAnnouncementAttachment : Entity, IParsable { + public byte[] Content { get; set; } + public string ContentType { get; set; } + public DateTimeOffset? LastModifiedDateTime { get; set; } + public string Name { get; set; } + public int? Size { get; set; } + /// + /// The deserialization information for the current model + /// + public new IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + {"content", (o,n) => { (o as ServiceAnnouncementAttachment).Content = n.GetByteArrayValue(); } }, + {"contentType", (o,n) => { (o as ServiceAnnouncementAttachment).ContentType = n.GetStringValue(); } }, + {"lastModifiedDateTime", (o,n) => { (o as ServiceAnnouncementAttachment).LastModifiedDateTime = n.GetDateTimeOffsetValue(); } }, + {"name", (o,n) => { (o as ServiceAnnouncementAttachment).Name = n.GetStringValue(); } }, + {"size", (o,n) => { (o as ServiceAnnouncementAttachment).Size = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public new void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteByteArrayValue("content", Content); + writer.WriteStringValue("contentType", ContentType); + writer.WriteDateTimeOffsetValue("lastModifiedDateTime", LastModifiedDateTime); + writer.WriteStringValue("name", Name); + writer.WriteIntValue("size", Size); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/ServicePlanInfo.cs b/src/generated/Models/Microsoft/Graph/ServicePlanInfo.cs index ea6abbce9b2..791f4b49b63 100644 --- a/src/generated/Models/Microsoft/Graph/ServicePlanInfo.cs +++ b/src/generated/Models/Microsoft/Graph/ServicePlanInfo.cs @@ -9,7 +9,7 @@ public class ServicePlanInfo : IParsable { public IDictionary AdditionalData { get; set; } /// The object the service plan can be assigned to. Possible values:'User' - service plan can be assigned to individual users.'Company' - service plan can be assigned to the entire tenant. public string AppliesTo { get; set; } - /// The provisioning status of the service plan. Possible values:'Success' - Service is fully provisioned.'Disabled' - Service has been disabled.'PendingInput' - Service is not yet provisioned; awaiting service confirmation.'PendingActivation' - Service is provisioned but requires explicit activation by administrator (for example, Intune_O365 service plan)'PendingProvisioning' - Microsoft has added a new service to the product SKU and it has not been activated in the tenant, yet. + /// The provisioning status of the service plan. Possible values:'Success' - Service is fully provisioned.'Disabled' - Service has been disabled.'PendingInput' - Service is not yet provisioned; awaiting service confirmation.'PendingActivation' - Service is provisioned but requires explicit activation by administrator (for example, Intune_O365 service plan).'PendingProvisioning' - Microsoft has added a new service to the product SKU and it has not been activated in the tenant, yet. public string ProvisioningStatus { get; set; } /// The unique identifier of the service plan. public string ServicePlanId { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/ServicePrincipal.cs b/src/generated/Models/Microsoft/Graph/ServicePrincipal.cs index 93193b71a48..a4495aba833 100644 --- a/src/generated/Models/Microsoft/Graph/ServicePrincipal.cs +++ b/src/generated/Models/Microsoft/Graph/ServicePrincipal.cs @@ -19,9 +19,9 @@ public class ServicePrincipal : DirectoryObject, IParsable { public string AppId { get; set; } /// Unique identifier of the applicationTemplate that the servicePrincipal was created from. Read-only. Supports $filter (eq, ne, NOT, startsWith). public string ApplicationTemplateId { get; set; } - /// Contains the tenant id where the application is registered. This is applicable only to service principals backed by applications. Supports $filter (eq, ne, NOT, ge, le). + /// Contains the tenant id where the application is registered. This is applicable only to service principals backed by applications.Supports $filter (eq, ne, NOT, ge, le). public string AppOwnerOrganizationId { get; set; } - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. public List AppRoleAssignedTo { get; set; } /// Specifies whether users or other service principals need to be granted an app role assignment for this service principal before users can sign in or apps can get tokens. The default value is false. Not nullable. Supports $filter (eq, ne, NOT). public bool? AppRoleAssignmentRequired { get; set; } @@ -69,7 +69,7 @@ public class ServicePrincipal : DirectoryObject, IParsable { public List OwnedObjects { get; set; } /// Directory objects that are owners of this servicePrincipal. The owners are a set of non-admin users or servicePrincipals who are allowed to modify this object. Read-only. Nullable. Supports $expand. public List Owners { get; set; } - /// The collection of password credentials associated with the application. Not nullable. + /// The collection of password credentials associated with the service principal. Not nullable. public List PasswordCredentials { get; set; } /// Specifies the single sign-on mode configured for this application. Azure AD uses the preferred single sign-on mode to launch the application from Microsoft 365 or the Azure AD My Apps. The supported values are password, saml, notSupported, and oidc. public string PreferredSingleSignOnMode { get; set; } @@ -81,7 +81,7 @@ public class ServicePrincipal : DirectoryObject, IParsable { public SamlSingleSignOnSettings SamlSingleSignOnSettings { get; set; } /// Contains the list of identifiersUris, copied over from the associated application. Additional values can be added to hybrid applications. These values can be used to identify the permissions exposed by this app within Azure AD. For example,Client apps can specify a resource URI which is based on the values of this property to acquire an access token, which is the URI returned in the 'aud' claim.The any operator is required for filter expressions on multi-valued properties. Not nullable. Supports $filter (eq, not, ge, le, startsWith). public List ServicePrincipalNames { get; set; } - /// Identifies whether the service principal represents an application, a managed identity, or a legacy application. This is set by Azure AD internally. The servicePrincipalType property can be set to three different values: __Application - A service principal that represents an application or service. The appId property identifies the associated app registration, and matches the appId of an application, possibly from a different tenant. If the associated app registration is missing, tokens are not issued for the service principal.__ManagedIdentity - A service principal that represents a managed identity. Service principals representing managed identities can be granted access and permissions, but cannot be updated or modified directly.__Legacy - A service principal that represents an app created before app registrations, or through legacy experiences. Legacy service principal can have credentials, service principal names, reply URLs, and other properties which are editable by an authorized user, but does not have an associated app registration. The appId value does not associate the service principal with an app registration. The service principal can only be used in the tenant where it was created.__SocialIdp - For internal use. + /// Identifies if the service principal represents an application or a managed identity. This is set by Azure AD internally. For a service principal that represents an application this is set as Application. For a service principal that represent a managed identity this is set as ManagedIdentity. The SocialIdp type is for internal use. public string ServicePrincipalType { get; set; } /// Specifies the Microsoft accounts that are supported for the current application. Read-only. Supported values are:AzureADMyOrg: Users with a Microsoft work or school account in my organization’s Azure AD tenant (single-tenant).AzureADMultipleOrgs: Users with a Microsoft work or school account in any organization’s Azure AD tenant (multi-tenant).AzureADandPersonalMicrosoftAccount: Users with a personal Microsoft account, or a work or school account in any organization’s Azure AD tenant.PersonalMicrosoftAccount: Users with a personal Microsoft account only. public string SignInAudience { get; set; } @@ -89,9 +89,9 @@ public class ServicePrincipal : DirectoryObject, IParsable { public List Tags { get; set; } /// Specifies the keyId of a public key from the keyCredentials collection. When configured, Azure AD issues tokens for this application encrypted using the key specified by this property. The application code that receives the encrypted token must use the matching private key to decrypt the token before it can be used for the signed-in user. public string TokenEncryptionKeyId { get; set; } - /// The tokenIssuancePolicies assigned to this service principal. + /// The tokenIssuancePolicies assigned to this service principal. Supports $expand. public List TokenIssuancePolicies { get; set; } - /// The tokenLifetimePolicies assigned to this service principal. + /// The tokenLifetimePolicies assigned to this service principal. Supports $expand. public List TokenLifetimePolicies { get; set; } public List TransitiveMemberOf { get; set; } /// diff --git a/src/generated/Models/Microsoft/Graph/ServiceUpdateMessage.cs b/src/generated/Models/Microsoft/Graph/ServiceUpdateMessage.cs index 7e4588a37c2..7494be01e26 100644 --- a/src/generated/Models/Microsoft/Graph/ServiceUpdateMessage.cs +++ b/src/generated/Models/Microsoft/Graph/ServiceUpdateMessage.cs @@ -7,9 +7,12 @@ namespace ApiSdk.Models.Microsoft.Graph { public class ServiceUpdateMessage : ServiceAnnouncementBase, IParsable { /// The expected deadline of the action for the message. public DateTimeOffset? ActionRequiredByDateTime { get; set; } + public List Attachments { get; set; } + public byte[] AttachmentsArchive { get; set; } public ItemBody Body { get; set; } /// The service message category. Possible values are: preventOrFixIssue, planForChange, stayInformed, unknownFutureValue. public ServiceUpdateCategory? Category { get; set; } + public bool? HasAttachments { get; set; } /// Indicates whether the message describes a major update for the service. public bool? IsMajorChange { get; set; } /// The affected services by the service message. @@ -26,8 +29,11 @@ public class ServiceUpdateMessage : ServiceAnnouncementBase, IParsable { public new IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { {"actionRequiredByDateTime", (o,n) => { (o as ServiceUpdateMessage).ActionRequiredByDateTime = n.GetDateTimeOffsetValue(); } }, + {"attachments", (o,n) => { (o as ServiceUpdateMessage).Attachments = n.GetCollectionOfObjectValues().ToList(); } }, + {"attachmentsArchive", (o,n) => { (o as ServiceUpdateMessage).AttachmentsArchive = n.GetByteArrayValue(); } }, {"body", (o,n) => { (o as ServiceUpdateMessage).Body = n.GetObjectValue(); } }, {"category", (o,n) => { (o as ServiceUpdateMessage).Category = n.GetEnumValue(); } }, + {"hasAttachments", (o,n) => { (o as ServiceUpdateMessage).HasAttachments = n.GetBoolValue(); } }, {"isMajorChange", (o,n) => { (o as ServiceUpdateMessage).IsMajorChange = n.GetBoolValue(); } }, {"services", (o,n) => { (o as ServiceUpdateMessage).Services = n.GetCollectionOfPrimitiveValues().ToList(); } }, {"severity", (o,n) => { (o as ServiceUpdateMessage).Severity = n.GetEnumValue(); } }, @@ -43,8 +49,11 @@ public class ServiceUpdateMessage : ServiceAnnouncementBase, IParsable { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteDateTimeOffsetValue("actionRequiredByDateTime", ActionRequiredByDateTime); + writer.WriteCollectionOfObjectValues("attachments", Attachments); + writer.WriteByteArrayValue("attachmentsArchive", AttachmentsArchive); writer.WriteObjectValue("body", Body); writer.WriteEnumValue("category", Category); + writer.WriteBoolValue("hasAttachments", HasAttachments); writer.WriteBoolValue("isMajorChange", IsMajorChange); writer.WriteCollectionOfPrimitiveValues("services", Services); writer.WriteEnumValue("severity", Severity); diff --git a/src/generated/Models/Microsoft/Graph/SettingTemplateValue.cs b/src/generated/Models/Microsoft/Graph/SettingTemplateValue.cs index d0da4311855..b9b20d02e43 100644 --- a/src/generated/Models/Microsoft/Graph/SettingTemplateValue.cs +++ b/src/generated/Models/Microsoft/Graph/SettingTemplateValue.cs @@ -7,13 +7,13 @@ namespace ApiSdk.Models.Microsoft.Graph { public class SettingTemplateValue : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Default value for the setting. + /// Default value for the setting. Read-only. public string DefaultValue { get; set; } - /// Description of the setting. + /// Description of the setting. Read-only. public string Description { get; set; } - /// Name of the setting. + /// Name of the setting. Read-only. public string Name { get; set; } - /// Type of the setting. + /// Type of the setting. Read-only. public string Type { get; set; } /// /// Instantiates a new settingTemplateValue and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/SettingValue.cs b/src/generated/Models/Microsoft/Graph/SettingValue.cs index 414d239af26..e8c5fe76b39 100644 --- a/src/generated/Models/Microsoft/Graph/SettingValue.cs +++ b/src/generated/Models/Microsoft/Graph/SettingValue.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class SettingValue : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Name of the setting (as defined by the groupSettingTemplate). + /// Name of the setting (as defined by the directorySettingTemplate). public string Name { get; set; } /// Value of the setting. public string Value { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/SharePointIdentity.cs b/src/generated/Models/Microsoft/Graph/SharePointIdentity.cs index bd48688f767..91947fa1371 100644 --- a/src/generated/Models/Microsoft/Graph/SharePointIdentity.cs +++ b/src/generated/Models/Microsoft/Graph/SharePointIdentity.cs @@ -5,6 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class SharePointIdentity : Identity, IParsable { + /// The sign in name of the SharePoint identity. public string LoginName { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/SharePointIdentitySet.cs b/src/generated/Models/Microsoft/Graph/SharePointIdentitySet.cs index fb8b7ce63e5..1b3f156a053 100644 --- a/src/generated/Models/Microsoft/Graph/SharePointIdentitySet.cs +++ b/src/generated/Models/Microsoft/Graph/SharePointIdentitySet.cs @@ -5,8 +5,11 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class SharePointIdentitySet : IdentitySet, IParsable { + /// The group associated with this action. Optional. public ApiSdk.Models.Microsoft.Graph.Identity Group { get; set; } + /// The SharePoint group associated with this action. Optional. public SharePointIdentity SiteGroup { get; set; } + /// The SharePoint user associated with this action. Optional. public SharePointIdentity SiteUser { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/SignIn.cs b/src/generated/Models/Microsoft/Graph/SignIn.cs index 65527264557..fa6c74a359c 100644 --- a/src/generated/Models/Microsoft/Graph/SignIn.cs +++ b/src/generated/Models/Microsoft/Graph/SignIn.cs @@ -5,51 +5,51 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class SignIn : Entity, IParsable { - /// App name displayed in the Azure Portal. Supports $filter (eq and startsWith operators only). + /// The application name displayed in the Azure Portal. Supports $filter (eq and startsWith operators only). public string AppDisplayName { get; set; } - /// Unique GUID representing the app ID in the Azure Active Directory. Supports $filter (eq operator only). + /// The application identifier in Azure Active Directory. Supports $filter (eq operator only). public string AppId { get; set; } /// A list of conditional access policies that are triggered by the corresponding sign-in activity. public List AppliedConditionalAccessPolicies { get; set; } - /// Identifies the legacy client used for sign-in activity. Includes Browser, Exchange Active Sync, modern clients, IMAP, MAPI, SMTP, and POP. Supports $filter (eq operator only). + /// The legacy client used for sign-in activity. For example: Browser, Exchange Active Sync, Modern clients, IMAP, MAPI, SMTP, or POP. Supports $filter (eq operator only). public string ClientAppUsed { get; set; } - /// Reports status of an activated conditional access policy. Possible values are: success, failure, notApplied, and unknownFutureValue. Supports $filter (eq operator only). + /// The status of the conditional access policy triggered. Possible values: success, failure, notApplied, or unknownFutureValue. Supports $filter (eq operator only). public ConditionalAccessStatus? ConditionalAccessStatus { get; set; } - /// The request ID sent from the client when the sign-in is initiated; used to troubleshoot sign-in activity. Supports $filter (eq operator only). + /// The identifier that's sent from the client when sign-in is initiated. This is used for troubleshooting the corresponding sign-in activity when calling for support. Supports $filter (eq operator only). public string CorrelationId { get; set; } - /// Date and time (UTC) the sign-in was initiated. Example: midnight on Jan 1, 2014 is reported as 2014-01-01T00:00:00Z. Supports $orderby and $filter (eq, le, and ge operators only). + /// The date and time the sign-in was initiated. The Timestamp type is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Supports $orderby and $filter (eq, le, and ge operators only). public DateTimeOffset? CreatedDateTime { get; set; } - /// Device information from where the sign-in occurred; includes device ID, operating system, and browser. Supports $filter (eq and startsWith operators only) on browser and operatingSytem properties. + /// The device information from where the sign-in occurred. Includes information such as deviceId, OS, and browser. Supports $filter (eq and startsWith operators only) on browser and operatingSystem properties. public DeviceDetail DeviceDetail { get; set; } - /// IP address of the client used to sign in. Supports $filter (eq and startsWith operators only). + /// The IP address of the client from where the sign-in occurred. Supports $filter (eq and startsWith operators only). public string IpAddress { get; set; } - /// Indicates if a sign-in is interactive or not. + /// Indicates whether a user sign in is interactive. In interactive sign in, the user provides an authentication factor to Azure AD. These factors include passwords, responses to MFA challenges, biometric factors, or QR codes that a user provides to Azure AD or an associated app. In non-interactive sign in, the user doesn't provide an authentication factor. Instead, the client app uses a token or code to authenticate or access a resource on behalf of a user. Non-interactive sign ins are commonly used for a client to sign in on a user's behalf in a process transparent to the user. public bool? IsInteractive { get; set; } - /// Provides the city, state, and country code where the sign-in originated. Supports $filter (eq and startsWith operators only) on city, state, and countryOrRegion properties. + /// The city, state, and 2 letter country code from where the sign-in occurred. Supports $filter (eq and startsWith operators only) on city, state, and countryOrRegion properties. public SignInLocation Location { get; set; } - /// Name of the resource the user signed into. Supports $filter (eq operator only). + /// The name of the resource that the user signed in to. Supports $filter (eq operator only). public string ResourceDisplayName { get; set; } - /// ID of the resource that the user signed into. Supports $filter (eq operator only). + /// The identifier of the resource that the user signed in to. Supports $filter (eq operator only). public string ResourceId { get; set; } - /// Provides the 'reason' behind a specific state of a risky user, sign-in or a risk event. The possible values are: none, adminGeneratedTemporaryPassword, userPerformedSecuredPasswordChange, userPerformedSecuredPasswordReset, adminConfirmedSigninSafe, aiConfirmedSigninSafe, userPassedMFADrivenByRiskBasedPolicy, adminDismissedAllRiskForUser, adminConfirmedSigninCompromised, unknownFutureValue. The value none means that no action has been performed on the user or sign-in so far. Supports $filter (eq operator only).Note: Details for this property require an Azure AD Premium P2 license. Other licenses return the value hidden. + /// The reason behind a specific state of a risky user, sign-in, or a risk event. Possible values: none, adminGeneratedTemporaryPassword, userPerformedSecuredPasswordChange, userPerformedSecuredPasswordReset, adminConfirmedSigninSafe, aiConfirmedSigninSafe, userPassedMFADrivenByRiskBasedPolicy, adminDismissedAllRiskForUser, adminConfirmedSigninCompromised, or unknownFutureValue. The value none means that no action has been performed on the user or sign-in so far. Supports $filter (eq operator only). Note: Details for this property are only available for Azure AD Premium P2 customers. All other customers are returned hidden. public RiskDetail? RiskDetail { get; set; } /// Risk event types associated with the sign-in. The possible values are: unlikelyTravel, anonymizedIPAddress, maliciousIPAddress, unfamiliarFeatures, malwareInfectedIPAddress, suspiciousIPAddress, leakedCredentials, investigationsThreatIntelligence, generic, and unknownFutureValue. Supports $filter (eq operator only). public List RiskEventTypes { get; set; } /// The list of risk event types associated with the sign-in. Possible values: unlikelyTravel, anonymizedIPAddress, maliciousIPAddress, unfamiliarFeatures, malwareInfectedIPAddress, suspiciousIPAddress, leakedCredentials, investigationsThreatIntelligence, generic, or unknownFutureValue. Supports $filter (eq and startsWith operators only). public List RiskEventTypes_v2 { get; set; } - /// Aggregated risk level. The possible values are: none, low, medium, high, hidden, and unknownFutureValue. The value hidden means the user or sign-in was not enabled for Azure AD Identity Protection. Supports $filter (eq operator only). Note: Details for this property are only available for Azure AD Premium P2 customers. All other customers will be returned hidden. + /// The aggregated risk level. Possible values: none, low, medium, high, hidden, or unknownFutureValue. The value hidden means the user or sign-in was not enabled for Azure AD Identity Protection. Supports $filter (eq operator only). Note: Details for this property are only available for Azure AD Premium P2 customers. All other customers are returned hidden. public RiskLevel? RiskLevelAggregated { get; set; } - /// Risk level during sign-in. The possible values are: none, low, medium, high, hidden, and unknownFutureValue. The value hidden means the user or sign-in was not enabled for Azure AD Identity Protection. Supports $filter (eq operator only). Note: Details for this property are only available for Azure AD Premium P2 customers. All other customers will be returned hidden. + /// The risk level during sign-in. Possible values: none, low, medium, high, hidden, or unknownFutureValue. The value hidden means the user or sign-in was not enabled for Azure AD Identity Protection. Supports $filter (eq operator only). Note: Details for this property are only available for Azure AD Premium P2 customers. All other customers are returned hidden. public RiskLevel? RiskLevelDuringSignIn { get; set; } - /// Reports status of the risky user, sign-in, or a risk event. The possible values are: none, confirmedSafe, remediated, dismissed, atRisk, confirmedCompromised, unknownFutureValue. Supports $filter (eq operator only). + /// The risk state of a risky user, sign-in, or a risk event. Possible values: none, confirmedSafe, remediated, dismissed, atRisk, confirmedCompromised, or unknownFutureValue. Supports $filter (eq operator only). public RiskState? RiskState { get; set; } - /// Sign-in status. Includes the error code and description of the error (in case of a sign-in failure). Supports $filter (eq operator only) on errorCode property. + /// The sign-in status. Includes the error code and description of the error (in case of a sign-in failure). Supports $filter (eq operator only) on errorCode property. public SignInStatus Status { get; set; } - /// Display name of the user that initiated the sign-in. Supports $filter (eq and startsWith operators only). + /// The display name of the user. Supports $filter (eq and startsWith operators only). public string UserDisplayName { get; set; } - /// ID of the user that initiated the sign-in. Supports $filter (eq operator only). + /// The identifier of the user. Supports $filter (eq operator only). public string UserId { get; set; } - /// User principal name of the user that initiated the sign-in. Supports $filter (eq and startsWith operators only). + /// The UPN of the user. Supports $filter (eq and startsWith operators only). public string UserPrincipalName { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/Site.cs b/src/generated/Models/Microsoft/Graph/Site.cs index db9997dac90..2cb225804fb 100644 --- a/src/generated/Models/Microsoft/Graph/Site.cs +++ b/src/generated/Models/Microsoft/Graph/Site.cs @@ -21,7 +21,7 @@ public class Site : BaseItem, IParsable { public PublicError Error { get; set; } /// The collection of column definitions available in the site that are referenced from the sites in the parent hierarchy of the current site. public List ExternalColumns { get; set; } - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. public List Items { get; set; } /// The collection of lists under this site. public List Lists { get; set; } @@ -37,7 +37,7 @@ public class Site : BaseItem, IParsable { public SiteCollection SiteCollection { get; set; } /// The collection of the sub-sites under this site. public List Sites { get; set; } - /// The default termStore under this site. + /// The termStore under this site. public Store TermStore { get; set; } /// The collection of termStores under this site. public List TermStores { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Solutions.cs b/src/generated/Models/Microsoft/Graph/Solutions.cs new file mode 100644 index 00000000000..703af8ad9bb --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/Solutions.cs @@ -0,0 +1,38 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class Solutions : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public List BookingBusinesses { get; set; } + public List BookingCurrencies { get; set; } + /// + /// Instantiates a new solutions and sets the default values. + /// + public Solutions() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"bookingBusinesses", (o,n) => { (o as Solutions).BookingBusinesses = n.GetCollectionOfObjectValues().ToList(); } }, + {"bookingCurrencies", (o,n) => { (o as Solutions).BookingCurrencies = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("bookingBusinesses", BookingBusinesses); + writer.WriteCollectionOfObjectValues("bookingCurrencies", BookingCurrencies); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/SolutionsRoot.cs b/src/generated/Models/Microsoft/Graph/SolutionsRoot.cs new file mode 100644 index 00000000000..5d646e840a8 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/SolutionsRoot.cs @@ -0,0 +1,38 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Models.Microsoft.Graph { + public class SolutionsRoot : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public List BookingBusinesses { get; set; } + public List BookingCurrencies { get; set; } + /// + /// Instantiates a new SolutionsRoot and sets the default values. + /// + public SolutionsRoot() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"bookingBusinesses", (o,n) => { (o as SolutionsRoot).BookingBusinesses = n.GetCollectionOfObjectValues().ToList(); } }, + {"bookingCurrencies", (o,n) => { (o as SolutionsRoot).BookingCurrencies = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("bookingBusinesses", BookingBusinesses); + writer.WriteCollectionOfObjectValues("bookingCurrencies", BookingCurrencies); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/Microsoft/Graph/StagedFeatureName.cs b/src/generated/Models/Microsoft/Graph/StagedFeatureName.cs index fec7bc1a099..fe6da6eb3a1 100644 --- a/src/generated/Models/Microsoft/Graph/StagedFeatureName.cs +++ b/src/generated/Models/Microsoft/Graph/StagedFeatureName.cs @@ -5,5 +5,7 @@ public enum StagedFeatureName { PasswordHashSync, EmailAsAlternateId, UnknownFutureValue, + CertificateBasedAuthentication, + MultiFactorAuthentication, } } diff --git a/src/generated/Models/Microsoft/Graph/StoragePlanInformation.cs b/src/generated/Models/Microsoft/Graph/StoragePlanInformation.cs index 10c566db7e7..9714907513b 100644 --- a/src/generated/Models/Microsoft/Graph/StoragePlanInformation.cs +++ b/src/generated/Models/Microsoft/Graph/StoragePlanInformation.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class StoragePlanInformation : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Indicates whether there are higher storage quota plans available. Read-only. + /// Indicates if there are higher storage quota plans available. Read-only. public bool? UpgradeAvailable { get; set; } /// /// Instantiates a new storagePlanInformation and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/Subscription.cs b/src/generated/Models/Microsoft/Graph/Subscription.cs index 3d1321340b9..8f5d42405c1 100644 --- a/src/generated/Models/Microsoft/Graph/Subscription.cs +++ b/src/generated/Models/Microsoft/Graph/Subscription.cs @@ -7,30 +7,30 @@ namespace ApiSdk.Models.Microsoft.Graph { public class Subscription : Entity, IParsable { /// Identifier of the application used to create the subscription. Read-only. public string ApplicationId { get; set; } - /// Required. Indicates the type of change in the subscribed resource that will raise a change notification. The supported values are: created, updated, deleted. Multiple values can be combined using a comma-separated list.Note: Drive root item and list change notifications support only the updated changeType. User and group change notifications support updated and deleted changeType. + /// Required. Indicates the type of change in the subscribed resource that will raise a change notification. The supported values are: created, updated, deleted. Multiple values can be combined using a comma-separated list. Note: Drive root item and list change notifications support only the updated changeType. User and group change notifications support updated and deleted changeType. public string ChangeType { get; set; } - /// Optional. Specifies the value of the clientState property sent by the service in each change notification. The maximum length is 128 characters. The client can check that the change notification came from the service by comparing the value of the clientState property sent with the subscription with the value of the clientState property received with each change notification. + /// Optional. Specifies the value of the clientState property sent by the service in each change notification. The maximum length is 255 characters. The client can check that the change notification came from the service by comparing the value of the clientState property sent with the subscription with the value of the clientState property received with each change notification. public string ClientState { get; set; } - /// Identifier of the user or service principal that created the subscription. If the app used delegated permissions to create the subscription, this field contains the id of the signed-in user the app called on behalf of. If the app used application permissions, this field contains the id of the service principal corresponding to the app. Read-only. + /// Identifier of the user or service principal that created the subscription. If the app used delegated permissions to create the subscription, this field contains the ID of the signed-in user the app called on behalf of. If the app used application permissions, this field contains the ID of the service principal corresponding to the app. Read-only. public string CreatorId { get; set; } - /// A base64-encoded representation of a certificate with a public key used to encrypt resource data in change notifications. Optional. Required when includeResourceData is true. + /// A base64-encoded representation of a certificate with a public key used to encrypt resource data in change notifications. Optional but required when includeResourceData is true. public string EncryptionCertificate { get; set; } - /// A custom app-provided identifier to help identify the certificate needed to decrypt resource data. Optional. + /// Optional. A custom app-provided identifier to help identify the certificate needed to decrypt resource data. Required when includeResourceData is true. public string EncryptionCertificateId { get; set; } - /// Required. Specifies the date and time when the webhook subscription expires. The time is in UTC, and can be an amount of time from subscription creation that varies for the resource subscribed to. See the table below for maximum supported subscription length of time. + /// Required. Specifies the date and time when the webhook subscription expires. The time is in UTC, and can be an amount of time from subscription creation that varies for the resource subscribed to. For the maximum supported subscription length of time, see the table below. public DateTimeOffset? ExpirationDateTime { get; set; } - /// When set to true, change notifications include resource data (such as content of a chat message). Optional. + /// Optional. When set to true, change notifications include resource data (such as content of a chat message). public bool? IncludeResourceData { get; set; } /// Specifies the latest version of Transport Layer Security (TLS) that the notification endpoint, specified by notificationUrl, supports. The possible values are: v1_0, v1_1, v1_2, v1_3. For subscribers whose notification endpoint supports a version lower than the currently recommended version (TLS 1.2), specifying this property by a set timeline allows them to temporarily use their deprecated version of TLS before completing their upgrade to TLS 1.2. For these subscribers, not setting this property per the timeline would result in subscription operations failing. For subscribers whose notification endpoint already supports TLS 1.2, setting this property is optional. In such cases, Microsoft Graph defaults the property to v1_2. public string LatestSupportedTlsVersion { get; set; } - /// The URL of the endpoint that receives lifecycle notifications, including subscriptionRemoved and missed notifications. This URL must make use of the HTTPS protocol. Optional. Read more about how Outlook resources use lifecycle notifications. + /// Optional. The URL of the endpoint that receives lifecycle notifications, including subscriptionRemoved and missed notifications. This URL must make use of the HTTPS protocol. public string LifecycleNotificationUrl { get; set; } - /// OData Query Options for specifying value for the targeting resource. Clients receive notifications when resource reaches the state matching the query options provided here. With this new property in the subscription creation payload along with all existing properties, Webhooks will deliver notifications whenever a resource reaches the desired state mentioned in the notificationQueryOptions property eg when the print job is completed, when a print job resource isFetchable property value becomes true etc. + /// OData query options for specifying the value for the targeting resource. Clients receive notifications when the resource reaches the state matching the query options provided here. With this new property in the subscription creation payload along with all existing properties, Webhooks will deliver notifications whenever a resource reaches the desired state mentioned in the notificationQueryOptions property. For example, when the print job is completed or when a print job resource isFetchable property value becomes true etc. public string NotificationQueryOptions { get; set; } - /// Required. The URL of the endpoint that will receive the change notifications. This URL must make use of the HTTPS protocol. + /// Required. The URL of the endpoint that receives the change notifications. This URL must make use of the HTTPS protocol. public string NotificationUrl { get; set; } public string NotificationUrlAppId { get; set; } - /// Required. Specifies the resource that will be monitored for changes. Do not include the base URL (https://graph.microsoft.com/v1.0/). See the possible resource path values for each supported resource. + /// Required. Specifies the resource that will be monitored for changes. Do not include the base URL (https://graph.microsoft.com/beta/). See the possible resource path values for each supported resource. public string Resource { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/SwapShiftsChangeRequest.cs b/src/generated/Models/Microsoft/Graph/SwapShiftsChangeRequest.cs index b8730821751..e116488e703 100644 --- a/src/generated/Models/Microsoft/Graph/SwapShiftsChangeRequest.cs +++ b/src/generated/Models/Microsoft/Graph/SwapShiftsChangeRequest.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class SwapShiftsChangeRequest : OfferShiftRequest, IParsable { - /// ShiftId for the recipient user with whom the request is to swap. + /// Shift ID for the recipient user with whom the request is to swap. public string RecipientShiftId { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/TargetResource.cs b/src/generated/Models/Microsoft/Graph/TargetResource.cs index 66637d3b033..75b3fddc5c1 100644 --- a/src/generated/Models/Microsoft/Graph/TargetResource.cs +++ b/src/generated/Models/Microsoft/Graph/TargetResource.cs @@ -9,7 +9,7 @@ public class TargetResource : IParsable { public IDictionary AdditionalData { get; set; } /// Indicates the visible name defined for the resource. Typically specified when the resource is created. public string DisplayName { get; set; } - /// When type is set to Group, this indicates the group type. Possible values are: unifiedGroups, azureAD, and unknownFutureValue + /// When type is set to Group, this indicates the group type. Possible values are: unifiedGroups, azureAD, and unknownFutureValue public GroupType? GroupType { get; set; } /// Indicates the unique ID of the resource. public string Id { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/TeamMemberSettings.cs b/src/generated/Models/Microsoft/Graph/TeamMemberSettings.cs index 74723698269..151810365ef 100644 --- a/src/generated/Models/Microsoft/Graph/TeamMemberSettings.cs +++ b/src/generated/Models/Microsoft/Graph/TeamMemberSettings.cs @@ -11,7 +11,7 @@ public class TeamMemberSettings : IParsable { public bool? AllowAddRemoveApps { get; set; } /// If set to true, members can add and update private channels. public bool? AllowCreatePrivateChannels { get; set; } - /// If set to true, members can add and update channels. + /// If set to true, members can add and update any channels. public bool? AllowCreateUpdateChannels { get; set; } /// If set to true, members can add, update, and remove connectors. public bool? AllowCreateUpdateRemoveConnectors { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/TeamsAsyncOperation.cs b/src/generated/Models/Microsoft/Graph/TeamsAsyncOperation.cs index 59ff0c4cdcd..06345649492 100644 --- a/src/generated/Models/Microsoft/Graph/TeamsAsyncOperation.cs +++ b/src/generated/Models/Microsoft/Graph/TeamsAsyncOperation.cs @@ -13,7 +13,7 @@ public class TeamsAsyncOperation : Entity, IParsable { public OperationError Error { get; set; } /// Time when the async operation was last updated. public DateTimeOffset? LastActionDateTime { get; set; } - /// Denotes which type of operation is being described. + /// Denotes the type of operation being described. public TeamsAsyncOperationType? OperationType { get; set; } /// Operation status. public TeamsAsyncOperationStatus? Status { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/TeamsTab.cs b/src/generated/Models/Microsoft/Graph/TeamsTab.cs index 77b8d8e4170..d5710a8a618 100644 --- a/src/generated/Models/Microsoft/Graph/TeamsTab.cs +++ b/src/generated/Models/Microsoft/Graph/TeamsTab.cs @@ -9,7 +9,7 @@ public class TeamsTab : Entity, IParsable { public TeamsTabConfiguration Configuration { get; set; } /// Name of the tab. public string DisplayName { get; set; } - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. public ApiSdk.Models.Microsoft.Graph.TeamsApp TeamsApp { get; set; } /// Deep link URL of the tab instance. Read only. public string WebUrl { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/TeamworkConversationIdentity.cs b/src/generated/Models/Microsoft/Graph/TeamworkConversationIdentity.cs index ed7b2387e77..6d668710c1e 100644 --- a/src/generated/Models/Microsoft/Graph/TeamworkConversationIdentity.cs +++ b/src/generated/Models/Microsoft/Graph/TeamworkConversationIdentity.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class TeamworkConversationIdentity : Identity, IParsable { - /// Type of conversation. Possible values are: team, channel, chat, and unknownFutureValue. + /// Type of conversation. Possible values are: team, channel, and chat. public TeamworkConversationIdentityType? ConversationIdentityType { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/TeamworkHostedContent.cs b/src/generated/Models/Microsoft/Graph/TeamworkHostedContent.cs index adaf06ce47c..006e84934ac 100644 --- a/src/generated/Models/Microsoft/Graph/TeamworkHostedContent.cs +++ b/src/generated/Models/Microsoft/Graph/TeamworkHostedContent.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class TeamworkHostedContent : Entity, IParsable { /// Write only. Bytes for the hosted content (such as images). public byte[] ContentBytes { get; set; } - /// Write only. Content type. sicj as image/png, image/jpg. + /// Write only. Content type, such as image/png, image/jpg. public string ContentType { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/TermColumn.cs b/src/generated/Models/Microsoft/Graph/TermColumn.cs index 80f6f734954..d7b860e0307 100644 --- a/src/generated/Models/Microsoft/Graph/TermColumn.cs +++ b/src/generated/Models/Microsoft/Graph/TermColumn.cs @@ -8,7 +8,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class TermColumn : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Specifies whether the column will allow more than one value. + /// Specifies whether the column will allow more than one value public bool? AllowMultipleValues { get; set; } public Term ParentTerm { get; set; } /// Specifies whether to display the entire term path or only the term label. diff --git a/src/generated/Models/Microsoft/Graph/TermStore/Set.cs b/src/generated/Models/Microsoft/Graph/TermStore/Set.cs index debf07d73cf..08ce1eb16c4 100644 --- a/src/generated/Models/Microsoft/Graph/TermStore/Set.cs +++ b/src/generated/Models/Microsoft/Graph/TermStore/Set.cs @@ -9,7 +9,7 @@ public class Set : Entity, IParsable { public List Children { get; set; } /// Date and time of set creation. Read-only. public DateTimeOffset? CreatedDateTime { get; set; } - /// Description that gives details on the term usage. + /// Description giving details on the term usage. public string Description { get; set; } /// Name of the set for each languageTag. public List LocalizedNames { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/TermsOfUseContainer.cs b/src/generated/Models/Microsoft/Graph/TermsOfUseContainer.cs index 8831d05cbc4..3bdb104d5ce 100644 --- a/src/generated/Models/Microsoft/Graph/TermsOfUseContainer.cs +++ b/src/generated/Models/Microsoft/Graph/TermsOfUseContainer.cs @@ -5,7 +5,9 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class TermsOfUseContainer : Entity, IParsable { + /// Represents the current status of a user's response to a company's customizable terms of use agreement. public List AgreementAcceptances { get; set; } + /// Represents a tenant's customizable terms of use agreement that's created and managed with Azure Active Directory (Azure AD). public List Agreements { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/ThreatAssessmentRequest.cs b/src/generated/Models/Microsoft/Graph/ThreatAssessmentRequest.cs index 07f79645a9a..cd07c69d722 100644 --- a/src/generated/Models/Microsoft/Graph/ThreatAssessmentRequest.cs +++ b/src/generated/Models/Microsoft/Graph/ThreatAssessmentRequest.cs @@ -15,7 +15,7 @@ public class ThreatAssessmentRequest : Entity, IParsable { public DateTimeOffset? CreatedDateTime { get; set; } /// The expected assessment from submitter. Possible values are: block, unblock. public ThreatExpectedAssessment? ExpectedAssessment { get; set; } - /// The source of the threat assessment request. Possible values are: administrator. + /// The source of the threat assessment request. Possible values are: user, administrator. public ThreatAssessmentRequestSource? RequestSource { get; set; } /// A collection of threat assessment results. Read-only. By default, a GET /threatAssessmentRequests/{id} does not return this property unless you apply $expand on it. public List Results { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/ThreatAssessmentResult.cs b/src/generated/Models/Microsoft/Graph/ThreatAssessmentResult.cs index 018e82666c9..78f88526215 100644 --- a/src/generated/Models/Microsoft/Graph/ThreatAssessmentResult.cs +++ b/src/generated/Models/Microsoft/Graph/ThreatAssessmentResult.cs @@ -9,7 +9,7 @@ public class ThreatAssessmentResult : Entity, IParsable { public DateTimeOffset? CreatedDateTime { get; set; } /// The result message for each threat assessment. public string Message { get; set; } - /// The threat assessment result type. Possible values are: checkPolicy, rescan. + /// The threat assessment result type. Possible values are: checkPolicy (only for mail assessment), rescan. public ThreatAssessmentResultType? ResultType { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/TimeConstraint.cs b/src/generated/Models/Microsoft/Graph/TimeConstraint.cs index 12a8ee0aa8b..59b786d1d56 100644 --- a/src/generated/Models/Microsoft/Graph/TimeConstraint.cs +++ b/src/generated/Models/Microsoft/Graph/TimeConstraint.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class TimeConstraint : IParsable { - /// The nature of the activity, optional. The possible values are: work, personal, unrestricted, or unknown. + /// The nature of the activity, optional. Possible values are: work, personal, unrestricted, or unknown. public ActivityDomain? ActivityDomain { get; set; } /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/TokenIssuerType.cs b/src/generated/Models/Microsoft/Graph/TokenIssuerType.cs new file mode 100644 index 00000000000..ca081316f11 --- /dev/null +++ b/src/generated/Models/Microsoft/Graph/TokenIssuerType.cs @@ -0,0 +1,10 @@ +namespace ApiSdk.Models.Microsoft.Graph { + public enum TokenIssuerType { + AzureAD, + ADFederationServices, + UnknownFutureValue, + AzureADBackupAuth, + ADFederationServicesMFAAdapter, + NPSExtension, + } +} diff --git a/src/generated/Models/Microsoft/Graph/UnifiedRoleAssignment.cs b/src/generated/Models/Microsoft/Graph/UnifiedRoleAssignment.cs index 252dd47b872..d6a781d7957 100644 --- a/src/generated/Models/Microsoft/Graph/UnifiedRoleAssignment.cs +++ b/src/generated/Models/Microsoft/Graph/UnifiedRoleAssignment.cs @@ -5,22 +5,22 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class UnifiedRoleAssignment : Entity, IParsable { - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. public ApiSdk.Models.Microsoft.Graph.AppScope AppScope { get; set; } - /// Identifier of the app-specific scope when the assignment scope is app-specific. Either this property or directoryScopeId is required. App scopes are scopes that are defined and understood by this application only. Use / for tenant-wide app scopes. Use directoryScopeId to limit the scope to particular directory objects, for example, administrative units. Supports $filter (eq, in). + /// Identifier of the app specific scope when the assignment scope is app specific. The scope of an assignment determines the set of resources for which the principal has been granted access. Directory scopes are shared scopes stored in the directory that are understood by multiple applications. Use / for tenant-wide scope. App scopes are scopes that are defined and understood by this application only. For the entitlement management provider, use app scopes to specify a catalog, for example /AccessPackageCatalog/beedadfe-01d5-4025-910b-84abb9369997. public string AppScopeId { get; set; } public string Condition { get; set; } - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. public DirectoryObject DirectoryScope { get; set; } - /// Identifier of the directory object representing the scope of the assignment. Either this property or appScopeId is required. The scope of an assignment determines the set of resources for which the principal has been granted access. Directory scopes are shared scopes stored in the directory that are understood by multiple applications. Use / for tenant-wide scope. Use appScopeId to limit the scope to an application only. Supports $filter (eq, in). + /// Identifier of the directory object representing the scope of the assignment. The scope of an assignment determines the set of resources for which the principal has been granted access. Directory scopes are shared scopes stored in the directory that are understood by multiple applications. App scopes are scopes that are defined and understood by this application only. public string DirectoryScopeId { get; set; } - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. public DirectoryObject Principal { get; set; } - /// Identifier of the principal to which the assignment is granted. Supports $filter (eq, in). + /// Identifier of the principal to which the assignment is granted. Supports $filter (eq operator only). public string PrincipalId { get; set; } - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. public UnifiedRoleDefinition RoleDefinition { get; set; } - /// Identifier of the role definition the assignment is for. Read only. Supports $filter (eq, in). + /// Identifier of the unifiedRoleDefinition the assignment is for. Read-only. Supports $filter (eq operator only). public string RoleDefinitionId { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/UnifiedRoleDefinition.cs b/src/generated/Models/Microsoft/Graph/UnifiedRoleDefinition.cs index e9b0970e455..6d45bc0df03 100644 --- a/src/generated/Models/Microsoft/Graph/UnifiedRoleDefinition.cs +++ b/src/generated/Models/Microsoft/Graph/UnifiedRoleDefinition.cs @@ -7,21 +7,21 @@ namespace ApiSdk.Models.Microsoft.Graph { public class UnifiedRoleDefinition : Entity, IParsable { /// The description for the unifiedRoleDefinition. Read-only when isBuiltIn is true. public string Description { get; set; } - /// The display name for the unifiedRoleDefinition. Read-only when isBuiltIn is true. Required. Supports $filter (eq, in). + /// The display name for the unifiedRoleDefinition. Read-only when isBuiltIn is true. Required. Supports $filter (eq and startsWith operators only). public string DisplayName { get; set; } - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. public List InheritsPermissionsFrom { get; set; } - /// Flag indicating whether the role definition is part of the default set included in Azure Active Directory (Azure AD) or a custom definition. Read-only. Supports $filter (eq, in). + /// Flag indicating if the unifiedRoleDefinition is part of the default set included with the product or custom. Read-only. Supports $filter (eq operator only). public bool? IsBuiltIn { get; set; } - /// Flag indicating whether the role is enabled for assignment. If false the role is not available for assignment. Read-only when isBuiltIn is true. + /// Flag indicating if the role is enabled for assignment. If false the role is not available for assignment. Read-only when isBuiltIn is true. public bool? IsEnabled { get; set; } - /// List of the scopes or permissions the role definition applies to. Currently only / is supported. Read-only when isBuiltIn is true. DO NOT USE. This will be deprecated soon. Attach scope to role assignment. + /// List of scopes permissions granted by the role definition apply to. Currently only / is supported. Read-only when isBuiltIn is true. DO NOT USE. This will be deprecated soon. Attach scope to role assignment public List ResourceScopes { get; set; } /// List of permissions included in the role. Read-only when isBuiltIn is true. Required. public List RolePermissions { get; set; } - /// Custom template identifier that can be set when isBuiltIn is false but is read-only when isBuiltIn is true. This identifier is typically used if one needs an identifier to be the same across different directories. + /// Custom template identifier that can be set when isBuiltIn is false. This identifier is typically used if one needs an identifier to be the same across different directories. Read-only when isBuiltIn is true. public string TemplateId { get; set; } - /// Indicates version of the role definition. Read-only when isBuiltIn is true. + /// Indicates version of the unifiedRoleDefinition. Read-only when isBuiltIn is true. public string Version { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/UnifiedRolePermission.cs b/src/generated/Models/Microsoft/Graph/UnifiedRolePermission.cs index f72c6e3b0e7..596b81c21b6 100644 --- a/src/generated/Models/Microsoft/Graph/UnifiedRolePermission.cs +++ b/src/generated/Models/Microsoft/Graph/UnifiedRolePermission.cs @@ -7,7 +7,7 @@ namespace ApiSdk.Models.Microsoft.Graph { public class UnifiedRolePermission : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Set of tasks that can be performed on a resource. Required. + /// Set of tasks that can be performed on a resource. public List AllowedResourceActions { get; set; } /// Optional constraints that must be met for the permission to be effective. public string Condition { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/UploadSession.cs b/src/generated/Models/Microsoft/Graph/UploadSession.cs index a909ce3d644..98ba1c772bb 100644 --- a/src/generated/Models/Microsoft/Graph/UploadSession.cs +++ b/src/generated/Models/Microsoft/Graph/UploadSession.cs @@ -9,7 +9,7 @@ public class UploadSession : IParsable { public IDictionary AdditionalData { get; set; } /// The date and time in UTC that the upload session will expire. The complete file must be uploaded before this expiration time is reached. public DateTimeOffset? ExpirationDateTime { get; set; } - /// A collection of byte ranges that the server is missing for the file. These ranges are zero indexed and of the format 'start-end' (e.g. '0-26' to indicate the first 27 bytes of the file). When uploading files as Outlook attachments, instead of a collection of ranges, this property always indicates a single value '{start}', the location in the file where the next upload should begin. + /// When uploading files to document libraries, this is a collection of byte ranges that the server is missing for the file. These ranges are zero-indexed and of the format, '{start}-{end}' (e.g. '0-26' to indicate the first 27 bytes of the file). When uploading files as Outlook attachments, instead of a collection of ranges, this property always indicates a single value '{start}', the location in the file where the next upload should begin. public List NextExpectedRanges { get; set; } /// The URL endpoint that accepts PUT requests for byte ranges of the file. public string UploadUrl { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/UsageDetails.cs b/src/generated/Models/Microsoft/Graph/UsageDetails.cs index 92fc45a1230..c52ca8885e2 100644 --- a/src/generated/Models/Microsoft/Graph/UsageDetails.cs +++ b/src/generated/Models/Microsoft/Graph/UsageDetails.cs @@ -9,7 +9,7 @@ public class UsageDetails : IParsable { public IDictionary AdditionalData { get; set; } /// The date and time the resource was last accessed by the user. The timestamp represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. public DateTimeOffset? LastAccessedDateTime { get; set; } - /// The date and time the resource was last modified by the user. The timestamp represents date and time information using ISO 8601 format and is always in UTC time.For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. + /// The date and time the resource was last modified by the user. The timestamp represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. public DateTimeOffset? LastModifiedDateTime { get; set; } /// /// Instantiates a new usageDetails and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/User.cs b/src/generated/Models/Microsoft/Graph/User.cs index d6ea53a24d6..11622735cef 100644 --- a/src/generated/Models/Microsoft/Graph/User.cs +++ b/src/generated/Models/Microsoft/Graph/User.cs @@ -7,24 +7,24 @@ namespace ApiSdk.Models.Microsoft.Graph { public class User : DirectoryObject, IParsable { /// A freeform text entry field for the user to describe themselves. Returned only on $select. public string AboutMe { get; set; } - /// true if the account is enabled; otherwise, false. This property is required when a user is created. Returned only on $select. Supports $filter (eq, ne, not, and in). + /// true if the account is enabled; otherwise, false. This property is required when a user is created. Supports $filter (eq, ne, not, and in). public bool? AccountEnabled { get; set; } /// The user's activities across devices. Read-only. Nullable. public List Activities { get; set; } - /// Sets the age group of the user. Allowed values: null, minor, notAdult and adult. Refer to the legal age group property definitions for further information. Returned only on $select. Supports $filter (eq, ne, not, and in). + /// Sets the age group of the user. Allowed values: null, minor, notAdult and adult. Refer to the legal age group property definitions for further information. Supports $filter (eq, ne, not, and in). public string AgeGroup { get; set; } /// The user's terms of use acceptance statuses. Read-only. Nullable. public List AgreementAcceptances { get; set; } /// Represents the app roles a user has been granted for an application. Supports $expand. public List AppRoleAssignments { get; set; } - /// The licenses that are assigned to the user, including inherited (group-based) licenses. Not nullable. Returned only on $select. Supports $filter (eq and not). + /// The licenses that are assigned to the user, including inherited (group-based) licenses. Not nullable. Supports $filter (eq and not). public List AssignedLicenses { get; set; } - /// The plans that are assigned to the user. Read-only. Not nullable. Returned only on $select. Supports $filter (eq and not). + /// The plans that are assigned to the user. Read-only. Not nullable.Supports $filter (eq and not). public List AssignedPlans { get; set; } public ApiSdk.Models.Microsoft.Graph.Authentication Authentication { get; set; } - /// The birthday of the user. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Returned only on $select. + /// The birthday of the user. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z Returned only on $select. public DateTimeOffset? Birthday { get; set; } - /// The telephone numbers for the user. NOTE: Although this is a string collection, only one number can be set for this property. Read-only for users synced from on-premises directory. Returned by default. Supports $filter (eq and not). + /// The telephone numbers for the user. Only one number can be set for this property. Read-only for users synced from on-premises directory. Supports $filter (eq, not, ge, le, startsWith). public List BusinessPhones { get; set; } /// The user's primary calendar. Read-only. public ApiSdk.Models.Microsoft.Graph.Calendar Calendar { get; set; } @@ -35,25 +35,25 @@ public class User : DirectoryObject, IParsable { /// The calendar view for the calendar. Read-only. Nullable. public List<@Event> CalendarView { get; set; } public List Chats { get; set; } - /// The city in which the user is located. Maximum length is 128 characters. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). + /// The city in which the user is located. Maximum length is 128 characters. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). public string City { get; set; } - /// The company name which the user is associated. This property can be useful for describing the company that an external user comes from. The maximum length of the company name is 64 characters.Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). + /// The company name which the user is associated. This property can be useful for describing the company that an external user comes from. The maximum length of the company name is 64 characters.Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). public string CompanyName { get; set; } - /// Sets whether consent has been obtained for minors. Allowed values: null, granted, denied and notRequired. Refer to the legal age group property definitions for further information. Returned only on $select. Supports $filter (eq, ne, not, and in). + /// Sets whether consent has been obtained for minors. Allowed values: null, granted, denied and notRequired. Refer to the legal age group property definitions for further information. Supports $filter (eq, ne, not, and in). public string ConsentProvidedForMinor { get; set; } /// The user's contacts folders. Read-only. Nullable. public List ContactFolders { get; set; } /// The user's contacts. Read-only. Nullable. public List Contacts { get; set; } - /// The country/region in which the user is located; for example, US or UK. Maximum length is 128 characters. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). + /// The country/region in which the user is located; for example, US or UK. Maximum length is 128 characters. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). public string Country { get; set; } - /// The created date of the user object. Read-only. Returned only on $select. Supports $filter (eq, ne, not , ge, le, in). + /// The date and time the user was created. The value cannot be modified and is automatically populated when the entity is created. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. Property is nullable. A null value indicates that an accurate creation time couldn't be determined for the user. Read-only. Supports $filter (eq, ne, not , ge, le, in). public DateTimeOffset? CreatedDateTime { get; set; } /// Directory objects that were created by the user. Read-only. Nullable. public List CreatedObjects { get; set; } - /// Indicates whether the user account was created through one of the following methods: As a regular school or work account (null). As an external account (Invitation). As a local account for an Azure Active Directory B2C tenant (LocalAccount). Through self-service sign-up by an internal user using email verification (EmailVerified). Through self-service sign-up by an external user signing up through a link that is part of a user flow (SelfServiceSignUp). Read-only.Returned only on $select. Supports $filter (eq, ne, not, in). + /// Indicates whether the user account was created through one of the following methods: As a regular school or work account (null). As an external account (Invitation). As a local account for an Azure Active Directory B2C tenant (LocalAccount). Through self-service sign-up by an internal user using email verification (EmailVerified). Through self-service sign-up by an external user signing up through a link that is part of a user flow (SelfServiceSignUp). Read-only.Supports $filter (eq, ne, not, and in). public string CreationType { get; set; } - /// The name for the department in which the user works. Maximum length is 64 characters. Returned only on $select. Supports $filter (eq, ne, not , ge, le, in, and eq on null values). + /// The name for the department in which the user works. Maximum length is 64 characters.Supports $filter (eq, ne, not , ge, le, in, and eq on null values). public string Department { get; set; } /// The limit on the maximum number of devices that the user is permitted to enroll. Allowed values are 5 or 1000. public int? DeviceEnrollmentLimit { get; set; } @@ -61,38 +61,38 @@ public class User : DirectoryObject, IParsable { public List DeviceManagementTroubleshootingEvents { get; set; } /// The users and contacts that report to the user. (The users and contacts that have their manager property set to this user.) Read-only. Nullable. Supports $expand. public List DirectReports { get; set; } - /// The name displayed in the address book for the user. This is usually the combination of the user's first name, middle initial and last name. This property is required when a user is created and it cannot be cleared during updates. Maximum length is 256 characters. Returned by default. Supports $filter (eq, ne, not , ge, le, in, startsWith, and eq on null values), $orderBy, and $search. + /// The name displayed in the address book for the user. This value is usually the combination of the user's first name, middle initial, and last name. This property is required when a user is created and it cannot be cleared during updates. Maximum length is 256 characters. Supports $filter (eq, ne, not , ge, le, in, startsWith, and eq on null values), $orderBy, and $search. public string DisplayName { get; set; } /// The user's OneDrive. Read-only. public ApiSdk.Models.Microsoft.Graph.Drive Drive { get; set; } /// A collection of drives available for this user. Read-only. public List Drives { get; set; } - /// The date and time when the user was hired or will start work in case of a future hire. Returned only on $select. Supports $filter (eq, ne, not , ge, le, in). + /// The date and time when the user was hired or will start work in case of a future hire. Supports $filter (eq, ne, not , ge, le, in). public DateTimeOffset? EmployeeHireDate { get; set; } - /// The employee identifier assigned to the user by the organization. Returned only on $select. Supports $filter (eq, ne, not , ge, le, in, startsWith, and eq on null values). + /// The employee identifier assigned to the user by the organization. Supports $filter (eq, ne, not , ge, le, in, startsWith, and eq on null values). public string EmployeeId { get; set; } - /// Represents organization data (e.g. division and costCenter) associated with a user. Returned only on $select. Supports $filter (eq, ne, not , ge, le, in). + /// Represents organization data (e.g. division and costCenter) associated with a user. Supports $filter (eq, ne, not , ge, le, in). public EmployeeOrgData EmployeeOrgData { get; set; } - /// Captures enterprise worker type. For example, Employee, Contractor, Consultant, or Vendor. Returned only on $select. Supports $filter (eq, ne, not , ge, le, in, startsWith). + /// Captures enterprise worker type. For example, Employee, Contractor, Consultant, or Vendor. Supports $filter (eq, ne, not , ge, le, in, startsWith). public string EmployeeType { get; set; } - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. public List<@Event> Events { get; set; } - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. public List Extensions { get; set; } - /// For an external user invited to the tenant using the invitation API, this property represents the invited user's invitation status. For invited users, the state can be PendingAcceptance or Accepted, or null for all other users. Returned only on $select. Supports $filter (eq, ne, not , in). + /// For an external user invited to the tenant using the invitation API, this property represents the invited user's invitation status. For invited users, the state can be PendingAcceptance or Accepted, or null for all other users. Supports $filter (eq, ne, not , in). public string ExternalUserState { get; set; } - /// Shows the timestamp for the latest change to the externalUserState property. Returned only on $select. Supports $filter (eq, ne, not , in). + /// Shows the timestamp for the latest change to the externalUserState property. Supports $filter (eq, ne, not , in). public DateTimeOffset? ExternalUserStateChangeDateTime { get; set; } - /// The fax number of the user. Returned only on $select. Supports $filter (eq, ne, not , ge, le, in, startsWith, and eq on null values). + /// The fax number of the user. Supports $filter (eq, ne, not , ge, le, in, startsWith, and eq on null values). public string FaxNumber { get; set; } public List FollowedSites { get; set; } - /// The given name (first name) of the user. Maximum length is 64 characters. Returned by default. Supports $filter (eq, ne, not , ge, le, in, startsWith, and eq on null values). + /// The given name (first name) of the user. Maximum length is 64 characters. Supports $filter (eq, ne, not , ge, le, in, startsWith, and eq on null values). public string GivenName { get; set; } - /// The hire date of the user. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Returned only on $select. Note: This property is specific to SharePoint Online. We recommend using the native employeeHireDate property to set and update hire date values using Microsoft Graph APIs. + /// The hire date of the user. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Returned only on $select. Note: This property is specific to SharePoint Online. We recommend using the native employeeHireDate property to set and update hire date values using Microsoft Graph APIs. public DateTimeOffset? HireDate { get; set; } - /// Represents the identities that can be used to sign in to this user account. An identity can be provided by Microsoft (also known as a local account), by organizations, or by social identity providers such as Facebook, Google, and Microsoft, and tied to a user account. May contain multiple items with the same signInType value. Returned only on $select. Supports $filter (eq) including on null values, only where the signInType is not userPrincipalName. + /// Represents the identities that can be used to sign in to this user account. An identity can be provided by Microsoft (also known as a local account), by organizations, or by social identity providers such as Facebook, Google, and Microsoft, and tied to a user account. May contain multiple items with the same signInType value. Supports $filter (eq) including on null values, only where the signInType is not userPrincipalName. public List Identities { get; set; } - /// The instant message voice over IP (VOIP) session initiation protocol (SIP) addresses for the user. Read-only. Returned only on $select. Supports $filter (eq, not, ge, le, startsWith). + /// The instant message voice over IP (VOIP) session initiation protocol (SIP) addresses for the user. Read-only. Supports $filter (eq, not, ge, le, startsWith). public List ImAddresses { get; set; } /// Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance. public ApiSdk.Models.Microsoft.Graph.InferenceClassification InferenceClassification { get; set; } @@ -102,11 +102,11 @@ public class User : DirectoryObject, IParsable { public List Interests { get; set; } /// Do not use – reserved for future use. public bool? IsResourceAccount { get; set; } - /// The user's job title. Maximum length is 128 characters. Returned by default. Supports $filter (eq, ne, not , ge, le, in, startsWith, and eq on null values). + /// The user's job title. Maximum length is 128 characters. Supports $filter (eq, ne, not , ge, le, in, startsWith, and eq on null values). public string JobTitle { get; set; } /// The Microsoft Teams teams that the user is a member of. Read-only. Nullable. public List JoinedTeams { get; set; } - /// The time when this Azure AD user last changed their password or when their password was created, whichever date the latest action was performed. The date and time information uses ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Returned only on $select. + /// The time when this Azure AD user last changed their password or when their password was created, , whichever date the latest action was performed. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. Returned only on $select. public DateTimeOffset? LastPasswordChangeDateTime { get; set; } /// Used by enterprise applications to determine the legal age group of the user. This property is read-only and calculated based on ageGroup and consentProvidedForMinor properties. Allowed values: null, minorWithOutParentalConsent, minorWithParentalConsent, minorNoParentalConsentRequired, notAdult and adult. Refer to the legal age group property definitions for further information. Returned only on $select. public string LegalAgeGroupClassification { get; set; } @@ -114,13 +114,13 @@ public class User : DirectoryObject, IParsable { public List LicenseAssignmentStates { get; set; } /// A collection of this user's license details. Read-only. public List LicenseDetails { get; set; } - /// The SMTP address for the user, for example, jeff@contoso.onmicrosoft.com.Changes to this property will also update the user's proxyAddresses collection to include the value as an SMTP address. For Azure AD B2C accounts, this property can be updated up to only ten times with unique SMTP addresses. This property cannot contain accent characters.Returned by default. Supports $filter (eq, ne, not, ge, le, in, startsWith, endsWith, and eq on null values). + /// The SMTP address for the user, for example, admin@contoso.com. Changes to this property will also update the user's proxyAddresses collection to include the value as an SMTP address. For Azure AD B2C accounts, this property can be updated up to only ten times with unique SMTP addresses. This property cannot contain accent characters. Supports $filter (eq, ne, not, ge, le, in, startsWith, endsWith, and eq on null values). public string Mail { get; set; } - /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale and time zone.Returned only on $select. + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. For more information, see User preferences for languages and regional formats. Returned only on $select. public MailboxSettings MailboxSettings { get; set; } /// The user's mail folders. Read-only. Nullable. public List MailFolders { get; set; } - /// The mail alias for the user. This property must be specified when a user is created. Maximum length is 64 characters. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). + /// The mail alias for the user. This property must be specified when a user is created. Maximum length is 64 characters. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). public string MailNickname { get; set; } /// Zero or more managed app registrations that belong to the user. public List ManagedAppRegistrations { get; set; } @@ -128,72 +128,72 @@ public class User : DirectoryObject, IParsable { public List ManagedDevices { get; set; } /// The user or contact that is this user's manager. Read-only. (HTTP Methods: GET, PUT, DELETE.). Supports $expand. public DirectoryObject Manager { get; set; } - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. public List MemberOf { get; set; } /// The messages in a mailbox or folder. Read-only. Nullable. public List Messages { get; set; } - /// The primary cellular telephone number for the user. Read-only for users synced from on-premises directory. Maximum length is 64 characters. Returned by default. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). + /// The primary cellular telephone number for the user. Read-only for users synced from on-premises directory. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). public string MobilePhone { get; set; } /// The URL for the user's personal site. Returned only on $select. public string MySite { get; set; } public List Oauth2PermissionGrants { get; set; } - /// The office location in the user's place of business. Returned by default. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). + /// The office location in the user's place of business. Maximum length is 128 characters. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). public string OfficeLocation { get; set; } /// Read-only. public ApiSdk.Models.Microsoft.Graph.Onenote Onenote { get; set; } public List OnlineMeetings { get; set; } - /// Contains the on-premises Active Directory distinguished name or DN. The property is only populated for customers who are synchronizing their on-premises directory to Azure Active Directory via Azure AD Connect. Read-only. Returned only on $select. + /// Contains the on-premises Active Directory distinguished name or DN. The property is only populated for customers who are synchronizing their on-premises directory to Azure Active Directory via Azure AD Connect. Read-only. public string OnPremisesDistinguishedName { get; set; } - /// Contains the on-premises domainFQDN, also called dnsDomainName synchronized from the on-premises directory. The property is only populated for customers who are synchronizing their on-premises directory to Azure Active Directory via Azure AD Connect. Read-only. Returned only on $select. + /// Contains the on-premises domainFQDN, also called dnsDomainName synchronized from the on-premises directory. The property is only populated for customers who are synchronizing their on-premises directory to Azure Active Directory via Azure AD Connect. Read-only. public string OnPremisesDomainName { get; set; } - /// Contains extensionAttributes 1-15 for the user. Note that the individual extension attributes are neither selectable nor filterable. For an onPremisesSyncEnabled user, the source of authority for this set of properties is the on-premises and is read-only. For a cloud-only user (where onPremisesSyncEnabled is false), these properties may be set during creation or update. These extension attributes are also known as Exchange custom attributes 1-15. Returned only on $select. Supports $filter (eq, not, ge, le, in, and eq on null values). + /// Contains extensionAttributes1-15 for the user. The individual extension attributes are neither selectable nor filterable. For an onPremisesSyncEnabled user, the source of authority for this set of properties is the on-premises and is read-only. For a cloud-only user (where onPremisesSyncEnabled is false), these properties can be set during creation or update of a user object. For a cloud-only user previously synced from on-premises Active Directory, these properties are read-only in Microsoft Graph but can be fully managed through the Exchange Admin Center or the Exchange Online V2 module in PowerShell. These extension attributes are also known as Exchange custom attributes 1-15. Returned only on $select. public OnPremisesExtensionAttributes OnPremisesExtensionAttributes { get; set; } - /// This property is used to associate an on-premises Active Directory user account to their Azure AD user object. This property must be specified when creating a new user account in the Graph if you are using a federated domain for the user's userPrincipalName (UPN) property. NOTE: The $ and _ characters cannot be used when specifying this property. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in).. + /// This property is used to associate an on-premises Active Directory user account to their Azure AD user object. This property must be specified when creating a new user account in the Graph if you are using a federated domain for the user's userPrincipalName (UPN) property. Note: The $ and _ characters cannot be used when specifying this property. Supports $filter (eq, ne, not, ge, le, in). public string OnPremisesImmutableId { get; set; } - /// Indicates the last time at which the object was synced with the on-premises directory; for example: 2013-02-16T03:04:54Z. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in). + /// Indicates the last time at which the object was synced with the on-premises directory; for example: '2013-02-16T03:04:54Z'. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. Supports $filter (eq, ne, not, ge, le, in). public DateTimeOffset? OnPremisesLastSyncDateTime { get; set; } - /// Errors when using Microsoft synchronization product during provisioning. Returned only on $select. Supports $filter (eq, not, ge, le). + /// Errors when using Microsoft synchronization product during provisioning. Supports $filter (eq, not, ge, le). public List OnPremisesProvisioningErrors { get; set; } - /// Contains the on-premises samAccountName synchronized from the on-premises directory. The property is only populated for customers who are synchronizing their on-premises directory to Azure Active Directory via Azure AD Connect. Read-only. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith). + /// Contains the on-premises sAMAccountName synchronized from the on-premises directory. The property is only populated for customers who are synchronizing their on-premises directory to Azure Active Directory via Azure AD Connect. Read-only. Supports $filter (eq, ne, not, ge, le, in, startsWith). public string OnPremisesSamAccountName { get; set; } - /// Contains the on-premises security identifier (SID) for the user that was synchronized from on-premises to the cloud. Read-only. Returned only on $select. Supports $filter (eq) on null values only. + /// Contains the on-premises security identifier (SID) for the user that was synchronized from on-premises to the cloud. Read-only. Supports $filter (eq) on null values only. public string OnPremisesSecurityIdentifier { get; set; } - /// true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced; null if this object has never been synced from an on-premises directory (default). Read-only. Returned only on $select. Supports $filter (eq, ne, not, in, and eq on null values). + /// true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced; null if this object has never been synced from an on-premises directory (default). Read-only. Supports $filter (eq, ne, not, in, and eq on null values). public bool? OnPremisesSyncEnabled { get; set; } - /// Contains the on-premises userPrincipalName synchronized from the on-premises directory. The property is only populated for customers who are synchronizing their on-premises directory to Azure Active Directory via Azure AD Connect. Read-only. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith). + /// Contains the on-premises userPrincipalName synchronized from the on-premises directory. The property is only populated for customers who are synchronizing their on-premises directory to Azure Active Directory via Azure AD Connect. Read-only. Supports $filter (eq, ne, not, ge, le, in, startsWith). public string OnPremisesUserPrincipalName { get; set; } - /// A list of additional email addresses for the user; for example: ['bob@contoso.com', 'Robert@fabrikam.com']. NOTE: This property cannot contain accent characters. Returned only on $select. Supports $filter (eq, not, ge, le, in, startsWith). + /// A list of additional email addresses for the user; for example: ['bob@contoso.com', 'Robert@fabrikam.com'].NOTE: This property cannot contain accent characters.Supports $filter (eq, not, ge, le, in, startsWith). public List OtherMails { get; set; } - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. public OutlookUser Outlook { get; set; } /// Devices that are owned by the user. Read-only. Nullable. Supports $expand. public List OwnedDevices { get; set; } /// Directory objects that are owned by the user. Read-only. Nullable. Supports $expand. public List OwnedObjects { get; set; } - /// Specifies password policies for the user. This value is an enumeration with one possible value being DisableStrongPassword, which allows weaker passwords than the default policy to be specified. DisablePasswordExpiration can also be specified. The two may be specified together; for example: DisablePasswordExpiration, DisableStrongPassword. Returned only on $select. For more information on the default password policies, see Azure AD pasword policies. Supports $filter (ne, not, and eq on null values). + /// Specifies password policies for the user. This value is an enumeration with one possible value being DisableStrongPassword, which allows weaker passwords than the default policy to be specified. DisablePasswordExpiration can also be specified. The two may be specified together; for example: DisablePasswordExpiration, DisableStrongPassword. For more information on the default password policies, see Azure AD pasword policies. Supports $filter (ne, not, and eq on null values). public string PasswordPolicies { get; set; } - /// Specifies the password profile for the user. The profile contains the user’s password. This property is required when a user is created. The password in the profile must satisfy minimum requirements as specified by the passwordPolicies property. By default, a strong password is required. NOTE: For Azure B2C tenants, the forceChangePasswordNextSignIn property should be set to false and instead use custom policies and user flows to force password reset at first logon. See Force password reset at first logon.Returned only on $select. Supports $filter (eq, ne, not, in, and eq on null values). + /// Specifies the password profile for the user. The profile contains the user's password. This property is required when a user is created. The password in the profile must satisfy minimum requirements as specified by the passwordPolicies property. By default, a strong password is required. NOTE: For Azure B2C tenants, the forceChangePasswordNextSignIn property should be set to false and instead use custom policies and user flows to force password reset at first logon. See Force password reset at first logon. Supports $filter (eq, ne, not, in, and eq on null values). public PasswordProfile PasswordProfile { get; set; } /// A list for the user to enumerate their past projects. Returned only on $select. public List PastProjects { get; set; } - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. public List People { get; set; } /// The user's profile photo. Read-only. public ProfilePhoto Photo { get; set; } /// Read-only. Nullable. public List Photos { get; set; } - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. public PlannerUser Planner { get; set; } - /// The postal code for the user's postal address. The postal code is specific to the user's country/region. In the United States of America, this attribute contains the ZIP code. Maximum length is 40 characters. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). + /// The postal code for the user's postal address. The postal code is specific to the user's country/region. In the United States of America, this attribute contains the ZIP code. Maximum length is 40 characters. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). public string PostalCode { get; set; } - /// The preferred language for the user. Should follow ISO 639-1 Code; for example en-US. Returned by default. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values) + /// The preferred language for the user. Should follow ISO 639-1 Code; for example en-US. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). public string PreferredLanguage { get; set; } /// The preferred name for the user. Returned only on $select. public string PreferredName { get; set; } public ApiSdk.Models.Microsoft.Graph.Presence Presence { get; set; } - /// The plans that are provisioned for the user. Read-only. Not nullable. Returned only on $select. Supports $filter (eq, not, ge, le). + /// The plans that are provisioned for the user. Read-only. Not nullable. Supports $filter (eq, not, ge, le). public List ProvisionedPlans { get; set; } - /// For example: ['SMTP: bob@contoso.com', 'smtp: bob@sales.contoso.com']. For Azure AD B2C accounts, this property has a limit of ten unique addresses. Read-only, Not nullable. Returned only on $select. Supports $filter (eq, not, ge, le, startsWith). + /// For example: ['SMTP: bob@contoso.com', 'smtp: bob@sales.contoso.com']. Changes to the mail property will also update this collection to include the value as an SMTP address. For more information, see mail and proxyAddresses properties. The proxy address prefixed with SMTP (capitalized) is the primary proxy address while those prefixed with smtp are the secondary proxy addresses. For Azure AD B2C accounts, this property has a limit of ten unique addresses. Read-only in Microsoft Graph; you can update this property only through the Microsoft 365 admin center. Not nullable. Supports $filter (eq, not, ge, le, startsWith). public List ProxyAddresses { get; set; } /// Devices that are registered for the user. Read-only. Nullable. Supports $expand. public List RegisteredDevices { get; set; } @@ -205,28 +205,28 @@ public class User : DirectoryObject, IParsable { public List ScopedRoleMemberOf { get; set; } /// Read-only. Nullable. public UserSettings Settings { get; set; } - /// true if the Outlook global address list should contain this user, otherwise false. If not set, this will be treated as true. For users invited through the invitation manager, this property will be set to false. Returned only on $select. Supports $filter (eq, ne, not, in). + /// true if the Outlook global address list should contain this user, otherwise false. If not set, this will be treated as true. For users invited through the invitation manager, this property will be set to false. Supports $filter (eq, ne, not, in). public bool? ShowInAddressList { get; set; } - /// Any refresh tokens or sessions tokens (session cookies) issued before this time are invalid, and applications will get an error when using an invalid refresh or sessions token to acquire a delegated access token (to access APIs such as Microsoft Graph). If this happens, the application will need to acquire a new refresh token by making a request to the authorize endpoint. Read-only. Use revokeSignInSessions to reset. Returned only on $select. + /// Any refresh tokens or sessions tokens (session cookies) issued before this time are invalid, and applications will get an error when using an invalid refresh or sessions token to acquire a delegated access token (to access APIs such as Microsoft Graph). If this happens, the application will need to acquire a new refresh token by making a request to the authorize endpoint. Read-only. Use revokeSignInSessions to reset. public DateTimeOffset? SignInSessionsValidFromDateTime { get; set; } /// A list for the user to enumerate their skills. Returned only on $select. public List Skills { get; set; } - /// The state or province in the user's address. Maximum length is 128 characters. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). + /// The state or province in the user's address. Maximum length is 128 characters. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). public string State { get; set; } - /// The street address of the user's place of business. Maximum length is 1024 characters. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). + /// The street address of the user's place of business. Maximum length is 1024 characters. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). public string StreetAddress { get; set; } - /// The user's surname (family name or last name). Maximum length is 64 characters. Returned by default. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). + /// The user's surname (family name or last name). Maximum length is 64 characters. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). public string Surname { get; set; } /// A container for Microsoft Teams features available for the user. Read-only. Nullable. public UserTeamwork Teamwork { get; set; } /// Represents the To Do services available to a user. public ApiSdk.Models.Microsoft.Graph.Todo Todo { get; set; } public List TransitiveMemberOf { get; set; } - /// A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: US, JP, and GB. Not nullable. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). + /// A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: US, JP, and GB. Not nullable. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). public string UsageLocation { get; set; } - /// The user principal name (UPN) of the user. The UPN is an Internet-style login name for the user based on the Internet standard RFC 822. By convention, this should map to the user's email name. The general format is alias@domain, where domain must be present in the tenant's collection of verified domains. This property is required when a user is created. The verified domains for the tenant can be accessed from the verifiedDomains property of organization.NOTE: This property cannot contain accent characters. Returned by default. Supports $filter (eq, ne, not, ge, le, in, startsWith, endsWith) and $orderBy. + /// The user principal name (UPN) of the user. The UPN is an Internet-style login name for the user based on the Internet standard RFC 822. By convention, this should map to the user's email name. The general format is alias@domain, where domain must be present in the tenant's collection of verified domains. This property is required when a user is created. The verified domains for the tenant can be accessed from the verifiedDomains property of organization.NOTE: This property cannot contain accent characters. Only the following characters are allowed A - Z, a - z, 0 - 9, ' . - _ ! # ^ ~. For the complete list of allowed characters, see username policies. Supports $filter (eq, ne, not, ge, le, in, startsWith, endsWith) and $orderBy. public string UserPrincipalName { get; set; } - /// A string value that can be used to classify user types in your directory, such as Member and Guest. Returned only on $select. Supports $filter (eq, ne, not, in, and eq on null values). NOTE: For more information about the permissions for member and guest users, see What are the default user permissions in Azure Active Directory? + /// A String value that can be used to classify user types in your directory, such as Member and Guest. Supports $filter (eq, ne, not, in, and eq on null values). NOTE: For more information about the permissions for member and guest users, see What are the default user permissions in Azure Active Directory? public string UserType { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/UserAttributeValuesItem.cs b/src/generated/Models/Microsoft/Graph/UserAttributeValuesItem.cs index 94dc941f74d..4f2c9fc1962 100644 --- a/src/generated/Models/Microsoft/Graph/UserAttributeValuesItem.cs +++ b/src/generated/Models/Microsoft/Graph/UserAttributeValuesItem.cs @@ -7,9 +7,9 @@ namespace ApiSdk.Models.Microsoft.Graph { public class UserAttributeValuesItem : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Determines whether the value is set as the default. + /// Used to set the value as the default. public bool? IsDefault { get; set; } - /// The display name of the property displayed to the user in the user flow. + /// The display name of the property displayed to the end user in the user flow. public string Name { get; set; } /// The value that is set when this item is selected. public string Value { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/VerifiedPublisher.cs b/src/generated/Models/Microsoft/Graph/VerifiedPublisher.cs index 490588fa505..6c3fcdf95ac 100644 --- a/src/generated/Models/Microsoft/Graph/VerifiedPublisher.cs +++ b/src/generated/Models/Microsoft/Graph/VerifiedPublisher.cs @@ -9,7 +9,7 @@ public class VerifiedPublisher : IParsable { public DateTimeOffset? AddedDateTime { get; set; } /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The verified publisher name from the app publisher's Partner Center account. + /// The verified publisher name from the app publisher's Microsoft Partner Network (MPN) account. public string DisplayName { get; set; } /// The ID of the verified publisher from the app publisher's Partner Center account. public string VerifiedPublisherId { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/VppToken.cs b/src/generated/Models/Microsoft/Graph/VppToken.cs index 09371d6814d..005921f2413 100644 --- a/src/generated/Models/Microsoft/Graph/VppToken.cs +++ b/src/generated/Models/Microsoft/Graph/VppToken.cs @@ -21,7 +21,7 @@ public class VppToken : Entity, IParsable { public VppTokenSyncStatus? LastSyncStatus { get; set; } /// The organization associated with the Apple Volume Purchase Program Token public string OrganizationName { get; set; } - /// Current state of the Apple Volume Purchase Program Token. Possible values are: unknown, valid, expired, invalid, assignedToExternalMDM. Possible values are: unknown, valid, expired, invalid, assignedToExternalMDM. + /// Current state of the Apple Volume Purchase Program Token. Possible values are: unknown, valid, expired, invalid, assignedToExternalMDM. Possible values are: unknown, valid, expired, invalid, assignedToExternalMDM, duplicateLocationId. public VppTokenState? State { get; set; } /// The Apple Volume Purchase Program Token string downloaded from the Apple Volume Purchase Program. public string Token { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Website.cs b/src/generated/Models/Microsoft/Graph/Website.cs index 641e2bf7db6..c4debd02732 100644 --- a/src/generated/Models/Microsoft/Graph/Website.cs +++ b/src/generated/Models/Microsoft/Graph/Website.cs @@ -11,7 +11,7 @@ public class Website : IParsable { public string Address { get; set; } /// The display name of the web site. public string DisplayName { get; set; } - /// The possible values are: other, home, work, blog, profile. + /// Possible values are: other, home, work, blog, profile. public WebsiteType? Type { get; set; } /// /// Instantiates a new website and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/WindowsAutopilotDeviceIdentity.cs b/src/generated/Models/Microsoft/Graph/WindowsAutopilotDeviceIdentity.cs index 98a80ccb6f3..f98df4babae 100644 --- a/src/generated/Models/Microsoft/Graph/WindowsAutopilotDeviceIdentity.cs +++ b/src/generated/Models/Microsoft/Graph/WindowsAutopilotDeviceIdentity.cs @@ -11,7 +11,7 @@ public class WindowsAutopilotDeviceIdentity : Entity, IParsable { public string AzureActiveDirectoryDeviceId { get; set; } /// Display Name public string DisplayName { get; set; } - /// Intune enrollment state of the Windows autopilot device. Possible values are: unknown, enrolled, pendingReset, failed, notContacted. + /// Intune enrollment state of the Windows autopilot device. Possible values are: unknown, enrolled, pendingReset, failed, notContacted, blocked. public EnrollmentState? EnrollmentState { get; set; } /// Group Tag of the Windows autopilot device. public string GroupTag { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/Workbook.cs b/src/generated/Models/Microsoft/Graph/Workbook.cs index 1875118823c..f53a38a3c62 100644 --- a/src/generated/Models/Microsoft/Graph/Workbook.cs +++ b/src/generated/Models/Microsoft/Graph/Workbook.cs @@ -10,7 +10,7 @@ public class Workbook : Entity, IParsable { public WorkbookFunctions Functions { get; set; } /// Represents a collection of workbooks scoped named items (named ranges and constants). Read-only. public List Names { get; set; } - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. public List Operations { get; set; } /// Represents a collection of tables associated with the workbook. Read-only. public List Tables { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/WorkbookComment.cs b/src/generated/Models/Microsoft/Graph/WorkbookComment.cs index ef7299f3740..2457d0fa755 100644 --- a/src/generated/Models/Microsoft/Graph/WorkbookComment.cs +++ b/src/generated/Models/Microsoft/Graph/WorkbookComment.cs @@ -5,7 +5,7 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class WorkbookComment : Entity, IParsable { - /// The content of comment. + /// The content of the comment. public string Content { get; set; } /// Indicates the type for the comment. public string ContentType { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/WorkbookCommentReply.cs b/src/generated/Models/Microsoft/Graph/WorkbookCommentReply.cs index e1a68c51fc7..7babaa831b1 100644 --- a/src/generated/Models/Microsoft/Graph/WorkbookCommentReply.cs +++ b/src/generated/Models/Microsoft/Graph/WorkbookCommentReply.cs @@ -5,9 +5,9 @@ using System.Linq; namespace ApiSdk.Models.Microsoft.Graph { public class WorkbookCommentReply : Entity, IParsable { - /// The content of a comment reply. + /// The content of replied comment. public string Content { get; set; } - /// Indicates the type for the comment reply. + /// Indicates the type for the replied comment. public string ContentType { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/WorkbookIcon.cs b/src/generated/Models/Microsoft/Graph/WorkbookIcon.cs index 526ca45f9b9..86e42efbc04 100644 --- a/src/generated/Models/Microsoft/Graph/WorkbookIcon.cs +++ b/src/generated/Models/Microsoft/Graph/WorkbookIcon.cs @@ -9,7 +9,7 @@ public class WorkbookIcon : IParsable { public IDictionary AdditionalData { get; set; } /// Represents the index of the icon in the given set. public int? Index { get; set; } - /// Represents the set that the icon is part of. The possible values are: Invalid, ThreeArrows, ThreeArrowsGray, ThreeFlags, ThreeTrafficLights1, ThreeTrafficLights2, ThreeSigns, ThreeSymbols, ThreeSymbols2, FourArrows, FourArrowsGray, FourRedToBlack, FourRating, FourTrafficLights, FiveArrows, FiveArrowsGray, FiveRating, FiveQuarters, ThreeStars, ThreeTriangles, FiveBoxes. + /// Represents the set that the icon is part of. Possible values are: Invalid, ThreeArrows, ThreeArrowsGray, ThreeFlags, ThreeTrafficLights1, ThreeTrafficLights2, ThreeSigns, ThreeSymbols, ThreeSymbols2, FourArrows, FourArrowsGray, FourRedToBlack, FourRating, FourTrafficLights, FiveArrows, FiveArrowsGray, FiveRating, FiveQuarters, ThreeStars, ThreeTriangles, FiveBoxes. public string Set { get; set; } /// /// Instantiates a new workbookIcon and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/WorkbookNamedItem.cs b/src/generated/Models/Microsoft/Graph/WorkbookNamedItem.cs index 0b5ba77e9d4..94a20a47d2a 100644 --- a/src/generated/Models/Microsoft/Graph/WorkbookNamedItem.cs +++ b/src/generated/Models/Microsoft/Graph/WorkbookNamedItem.cs @@ -11,7 +11,7 @@ public class WorkbookNamedItem : Entity, IParsable { public string Name { get; set; } /// Indicates whether the name is scoped to the workbook or to a specific worksheet. Read-only. public string Scope { get; set; } - /// Indicates what type of reference is associated with the name. The possible values are: String, Integer, Double, Boolean, Range. Read-only. + /// Indicates what type of reference is associated with the name. Possible values are: String, Integer, Double, Boolean, Range. Read-only. public string Type { get; set; } /// Represents the formula that the name is defined to refer to. E.g. =Sheet14!$B$2:$H$12, =4.75, etc. Read-only. public Json Value { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/WorkbookOperation.cs b/src/generated/Models/Microsoft/Graph/WorkbookOperation.cs index ede0ad524d9..80bc7decab9 100644 --- a/src/generated/Models/Microsoft/Graph/WorkbookOperation.cs +++ b/src/generated/Models/Microsoft/Graph/WorkbookOperation.cs @@ -9,7 +9,7 @@ public class WorkbookOperation : Entity, IParsable { public WorkbookOperationError Error { get; set; } /// The resource URI for the result. public string ResourceLocation { get; set; } - /// The current status of the operation. Possible values are: NotStarted, Running, Completed, Failed. + /// The current status of the operation. Possible values are: notStarted, running, succeeded, failed. public WorkbookOperationStatus? Status { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/WorkbookRange.cs b/src/generated/Models/Microsoft/Graph/WorkbookRange.cs index 16afd50b550..c7d1cb88436 100644 --- a/src/generated/Models/Microsoft/Graph/WorkbookRange.cs +++ b/src/generated/Models/Microsoft/Graph/WorkbookRange.cs @@ -41,7 +41,7 @@ public class WorkbookRange : Entity, IParsable { public Json Text { get; set; } /// Represents the raw values of the specified range. The data returned could be of type string, number, or a boolean. Cell that contain an error will return the error string. public Json Values { get; set; } - /// Represents the type of data of each cell. The possible values are: Unknown, Empty, String, Integer, Double, Boolean, Error. Read-only. + /// Represents the type of data of each cell. Possible values are: Unknown, Empty, String, Integer, Double, Boolean, Error. Read-only. public Json ValueTypes { get; set; } /// The worksheet containing the current range. Read-only. public WorkbookWorksheet Worksheet { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/WorkbookRangeBorder.cs b/src/generated/Models/Microsoft/Graph/WorkbookRangeBorder.cs index 5504d0f9243..8471cbdcd14 100644 --- a/src/generated/Models/Microsoft/Graph/WorkbookRangeBorder.cs +++ b/src/generated/Models/Microsoft/Graph/WorkbookRangeBorder.cs @@ -7,11 +7,11 @@ namespace ApiSdk.Models.Microsoft.Graph { public class WorkbookRangeBorder : Entity, IParsable { /// HTML color code representing the color of the border line, of the form #RRGGBB (e.g. 'FFA500') or as a named HTML color (e.g. 'orange'). public string Color { get; set; } - /// Constant value that indicates the specific side of the border. The possible values are: EdgeTop, EdgeBottom, EdgeLeft, EdgeRight, InsideVertical, InsideHorizontal, DiagonalDown, DiagonalUp. Read-only. + /// Constant value that indicates the specific side of the border. Possible values are: EdgeTop, EdgeBottom, EdgeLeft, EdgeRight, InsideVertical, InsideHorizontal, DiagonalDown, DiagonalUp. Read-only. public string SideIndex { get; set; } - /// One of the constants of line style specifying the line style for the border. The possible values are: None, Continuous, Dash, DashDot, DashDotDot, Dot, Double, SlantDashDot. + /// One of the constants of line style specifying the line style for the border. Possible values are: None, Continuous, Dash, DashDot, DashDotDot, Dot, Double, SlantDashDot. public string Style { get; set; } - /// Specifies the weight of the border around a range. The possible values are: Hairline, Thin, Medium, Thick. + /// Specifies the weight of the border around a range. Possible values are: Hairline, Thin, Medium, Thick. public string Weight { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/WorkbookRangeFont.cs b/src/generated/Models/Microsoft/Graph/WorkbookRangeFont.cs index 947567fb306..01d08ad060c 100644 --- a/src/generated/Models/Microsoft/Graph/WorkbookRangeFont.cs +++ b/src/generated/Models/Microsoft/Graph/WorkbookRangeFont.cs @@ -15,7 +15,7 @@ public class WorkbookRangeFont : Entity, IParsable { public string Name { get; set; } /// Font size. public double? Size { get; set; } - /// Type of underline applied to the font. The possible values are: None, Single, Double, SingleAccountant, DoubleAccountant. + /// Type of underline applied to the font. Possible values are: None, Single, Double, SingleAccountant, DoubleAccountant. public string Underline { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/WorkbookRangeFormat.cs b/src/generated/Models/Microsoft/Graph/WorkbookRangeFormat.cs index e615f2fff5f..951a2cc5019 100644 --- a/src/generated/Models/Microsoft/Graph/WorkbookRangeFormat.cs +++ b/src/generated/Models/Microsoft/Graph/WorkbookRangeFormat.cs @@ -13,13 +13,13 @@ public class WorkbookRangeFormat : Entity, IParsable { public ApiSdk.Models.Microsoft.Graph.WorkbookRangeFill Fill { get; set; } /// Returns the font object defined on the overall range selected Read-only. public WorkbookRangeFont Font { get; set; } - /// Represents the horizontal alignment for the specified object. The possible values are: General, Left, Center, Right, Fill, Justify, CenterAcrossSelection, Distributed. + /// Represents the horizontal alignment for the specified object. Possible values are: General, Left, Center, Right, Fill, Justify, CenterAcrossSelection, Distributed. public string HorizontalAlignment { get; set; } /// Returns the format protection object for a range. Read-only. public WorkbookFormatProtection Protection { get; set; } /// Gets or sets the height of all rows in the range. If the row heights are not uniform null will be returned. public double? RowHeight { get; set; } - /// Represents the vertical alignment for the specified object. The possible values are: Top, Center, Bottom, Justify, Distributed. + /// Represents the vertical alignment for the specified object. Possible values are: Top, Center, Bottom, Justify, Distributed. public string VerticalAlignment { get; set; } /// Indicates if Excel wraps the text in the object. A null value indicates that the entire range doesn't have uniform wrap setting public bool? WrapText { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/WorkbookRangeView.cs b/src/generated/Models/Microsoft/Graph/WorkbookRangeView.cs index 60403875ab7..07ea336e74e 100644 --- a/src/generated/Models/Microsoft/Graph/WorkbookRangeView.cs +++ b/src/generated/Models/Microsoft/Graph/WorkbookRangeView.cs @@ -27,7 +27,7 @@ public class WorkbookRangeView : Entity, IParsable { public Json Text { get; set; } /// Represents the raw values of the specified range view. The data returned could be of type string, number, or a boolean. Cell that contain an error will return the error string. public Json Values { get; set; } - /// Represents the type of data of each cell. Read-only. The possible values are: Unknown, Empty, String, Integer, Double, Boolean, Error. + /// Represents the type of data of each cell. Read-only. Possible values are: Unknown, Empty, String, Integer, Double, Boolean, Error. public Json ValueTypes { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/WorkbookSortField.cs b/src/generated/Models/Microsoft/Graph/WorkbookSortField.cs index 4d6618486b1..9a092bfe0c7 100644 --- a/src/generated/Models/Microsoft/Graph/WorkbookSortField.cs +++ b/src/generated/Models/Microsoft/Graph/WorkbookSortField.cs @@ -11,13 +11,13 @@ public class WorkbookSortField : IParsable { public IDictionary AdditionalData { get; set; } /// Represents the color that is the target of the condition if the sorting is on font or cell color. public string Color { get; set; } - /// Represents additional sorting options for this field. The possible values are: Normal, TextAsNumber. + /// Represents additional sorting options for this field. Possible values are: Normal, TextAsNumber. public string DataOption { get; set; } /// Represents the icon that is the target of the condition if the sorting is on the cell's icon. public WorkbookIcon Icon { get; set; } /// Represents the column (or row, depending on the sort orientation) that the condition is on. Represented as an offset from the first column (or row). public int? Key { get; set; } - /// Represents the type of sorting of this condition. The possible values are: Value, CellColor, FontColor, Icon. + /// Represents the type of sorting of this condition. Possible values are: Value, CellColor, FontColor, Icon. public string SortOn { get; set; } /// /// Instantiates a new workbookSortField and sets the default values. diff --git a/src/generated/Models/Microsoft/Graph/WorkbookTable.cs b/src/generated/Models/Microsoft/Graph/WorkbookTable.cs index 7248f79424d..66213ba51e6 100644 --- a/src/generated/Models/Microsoft/Graph/WorkbookTable.cs +++ b/src/generated/Models/Microsoft/Graph/WorkbookTable.cs @@ -29,7 +29,7 @@ public class WorkbookTable : Entity, IParsable { public bool? ShowTotals { get; set; } /// Represents the sorting for the table. Read-only. public WorkbookTableSort Sort { get; set; } - /// Constant value that represents the Table style. The possible values are: TableStyleLight1 thru TableStyleLight21, TableStyleMedium1 thru TableStyleMedium28, TableStyleStyleDark1 thru TableStyleStyleDark11. A custom user-defined style present in the workbook can also be specified. + /// Constant value that represents the Table style. Possible values are: TableStyleLight1 thru TableStyleLight21, TableStyleMedium1 thru TableStyleMedium28, TableStyleStyleDark1 thru TableStyleStyleDark11. A custom user-defined style present in the workbook can also be specified. public string Style { get; set; } /// The worksheet containing the current table. Read-only. public WorkbookWorksheet Worksheet { get; set; } diff --git a/src/generated/Models/Microsoft/Graph/WorkbookTableSort.cs b/src/generated/Models/Microsoft/Graph/WorkbookTableSort.cs index 63858396fde..09db7cf478a 100644 --- a/src/generated/Models/Microsoft/Graph/WorkbookTableSort.cs +++ b/src/generated/Models/Microsoft/Graph/WorkbookTableSort.cs @@ -9,7 +9,7 @@ public class WorkbookTableSort : Entity, IParsable { public List Fields { get; set; } /// Represents whether the casing impacted the last sort of the table. Read-only. public bool? MatchCase { get; set; } - /// Represents Chinese character ordering method last used to sort the table. The possible values are: PinYin, StrokeCount. Read-only. + /// Represents Chinese character ordering method last used to sort the table. Possible values are: PinYin, StrokeCount. Read-only. public string Method { get; set; } /// /// The deserialization information for the current model diff --git a/src/generated/Models/Microsoft/Graph/WorkforceIntegration.cs b/src/generated/Models/Microsoft/Graph/WorkforceIntegration.cs index ffd3d142822..6a57483bb11 100644 --- a/src/generated/Models/Microsoft/Graph/WorkforceIntegration.cs +++ b/src/generated/Models/Microsoft/Graph/WorkforceIntegration.cs @@ -13,7 +13,7 @@ public class WorkforceIntegration : ChangeTrackedEntity, IParsable { public WorkforceIntegrationEncryption Encryption { get; set; } /// Indicates whether this workforce integration is currently active and available. public bool? IsActive { get; set; } - /// The Shifts entities supported for synchronous change notifications. Shifts will make a call back to the url provided on client changes on those entities added here. By default, no entities are supported for change notifications. Possible values are: none, shift, swapRequest, userShiftPreferences, openshift, openShiftRequest, offerShiftRequest, unknownFutureValue. + /// This property has replaced supports in v1.0. We recommend that you use this property instead of supports. The supports property is still supported in beta for the time being. The possible values are: none, shift, swapRequest, openshift, openShiftRequest, userShiftPreferences, offerShiftRequest, unknownFutureValue, timeCard, timeOffReason, timeOff, timeOffRequest. Note that you must use the Prefer: include-unknown-enum-members request header to get the following values in this evolvable enum: timeCard, timeOffReason, timeOff, timeOffRequest. If selecting more than one value, all values must start with the first letter in uppercase. public WorkforceIntegrationSupportedEntities? SupportedEntities { get; set; } /// Workforce Integration URL for callbacks from the Shifts service. public string Url { get; set; } diff --git a/src/generated/Oauth2PermissionGrants/Delta/DeltaRequestBuilder.cs b/src/generated/Oauth2PermissionGrants/Delta/DeltaRequestBuilder.cs index 80bbd48befa..6681d942bf5 100644 --- a/src/generated/Oauth2PermissionGrants/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Oauth2PermissionGrants/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Oauth2PermissionGrants/Item/OAuth2PermissionGrantRequestBuilder.cs b/src/generated/Oauth2PermissionGrants/Item/OAuth2PermissionGrantRequestBuilder.cs index 8fe6a3e0b00..b8af0af6b30 100644 --- a/src/generated/Oauth2PermissionGrants/Item/OAuth2PermissionGrantRequestBuilder.cs +++ b/src/generated/Oauth2PermissionGrants/Item/OAuth2PermissionGrantRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from oauth2PermissionGrants"; // Create options for all the parameters - command.AddOption(new Option("--oauth2permissiongrant-id", description: "key: id of oAuth2PermissionGrant")); + var oAuth2PermissionGrantIdOption = new Option("--oauth2permissiongrant-id", description: "key: id of oAuth2PermissionGrant"); + oAuth2PermissionGrantIdOption.IsRequired = true; + command.AddOption(oAuth2PermissionGrantIdOption); command.Handler = CommandHandler.Create(async (oAuth2PermissionGrantId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(oAuth2PermissionGrantId)) requestInfo.PathParameters.Add("oAuth2PermissionGrant_id", oAuth2PermissionGrantId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from oauth2PermissionGrants by key"; // Create options for all the parameters - command.AddOption(new Option("--oauth2permissiongrant-id", description: "key: id of oAuth2PermissionGrant")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (oAuth2PermissionGrantId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(oAuth2PermissionGrantId)) requestInfo.PathParameters.Add("oAuth2PermissionGrant_id", oAuth2PermissionGrantId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var oAuth2PermissionGrantIdOption = new Option("--oauth2permissiongrant-id", description: "key: id of oAuth2PermissionGrant"); + oAuth2PermissionGrantIdOption.IsRequired = true; + command.AddOption(oAuth2PermissionGrantIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (oAuth2PermissionGrantId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in oauth2PermissionGrants"; // Create options for all the parameters - command.AddOption(new Option("--oauth2permissiongrant-id", description: "key: id of oAuth2PermissionGrant")); - command.AddOption(new Option("--body")); + var oAuth2PermissionGrantIdOption = new Option("--oauth2permissiongrant-id", description: "key: id of oAuth2PermissionGrant"); + oAuth2PermissionGrantIdOption.IsRequired = true; + command.AddOption(oAuth2PermissionGrantIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (oAuth2PermissionGrantId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(oAuth2PermissionGrantId)) requestInfo.PathParameters.Add("oAuth2PermissionGrant_id", oAuth2PermissionGrantId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs b/src/generated/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs index e3e1dfde4b2..03709cce8f5 100644 --- a/src/generated/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs +++ b/src/generated/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to oauth2PermissionGrants"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from oauth2PermissionGrants"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Organization/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs b/src/generated/Organization/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs index aea2a4a585d..323ce5541ca 100644 --- a/src/generated/Organization/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs +++ b/src/generated/Organization/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getAvailableExtensionProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Organization/GetByIds/GetByIdsRequestBuilder.cs b/src/generated/Organization/GetByIds/GetByIdsRequestBuilder.cs index de2aeef01cd..2e8a1eaaeae 100644 --- a/src/generated/Organization/GetByIds/GetByIdsRequestBuilder.cs +++ b/src/generated/Organization/GetByIds/GetByIdsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getByIds"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Organization/Item/Branding/BrandingRequestBuilder.cs b/src/generated/Organization/Item/Branding/BrandingRequestBuilder.cs index c75d111d651..1daf5d5b2dc 100644 --- a/src/generated/Organization/Item/Branding/BrandingRequestBuilder.cs +++ b/src/generated/Organization/Item/Branding/BrandingRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property branding for organization"; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); command.Handler = CommandHandler.Create(async (organizationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get branding from organization"; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (organizationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (organizationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property branding in organization"; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--body")); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (organizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Organization/Item/CertificateBasedAuthConfiguration/@Ref/RefRequestBuilder.cs b/src/generated/Organization/Item/CertificateBasedAuthConfiguration/@Ref/RefRequestBuilder.cs index 63f08cca06b..bfbc627f82b 100644 --- a/src/generated/Organization/Item/CertificateBasedAuthConfiguration/@Ref/RefRequestBuilder.cs +++ b/src/generated/Organization/Item/CertificateBasedAuthConfiguration/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Navigation property to manage certificate-based authentication configuration. Only a single instance of certificateBasedAuthConfiguration can be created in the collection."; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (organizationId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (organizationId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Navigation property to manage certificate-based authentication configuration. Only a single instance of certificateBasedAuthConfiguration can be created in the collection."; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--body")); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (organizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Organization/Item/CertificateBasedAuthConfiguration/CertificateBasedAuthConfigurationRequestBuilder.cs b/src/generated/Organization/Item/CertificateBasedAuthConfiguration/CertificateBasedAuthConfigurationRequestBuilder.cs index dc3eeb76e39..0a10f12e623 100644 --- a/src/generated/Organization/Item/CertificateBasedAuthConfiguration/CertificateBasedAuthConfigurationRequestBuilder.cs +++ b/src/generated/Organization/Item/CertificateBasedAuthConfiguration/CertificateBasedAuthConfigurationRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Navigation property to manage certificate-based authentication configuration. Only a single instance of certificateBasedAuthConfiguration can be created in the collection."; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (organizationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (organizationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Organization/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs b/src/generated/Organization/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs index 9d0ed0498c2..eb858f04da0 100644 --- a/src/generated/Organization/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs +++ b/src/generated/Organization/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--body")); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (organizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Organization/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs b/src/generated/Organization/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs index 193600be0b5..3622d8f84bc 100644 --- a/src/generated/Organization/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs +++ b/src/generated/Organization/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--body")); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (organizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Organization/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Organization/Item/Extensions/ExtensionsRequestBuilder.cs index fed84926cc7..46e1c4686cf 100644 --- a/src/generated/Organization/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Organization/Item/Extensions/ExtensionsRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The collection of open extensions defined for the organization. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the organization resource. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--body")); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (organizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,32 +60,53 @@ public Command BuildCreateCommand() { return command; } /// - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The collection of open extensions defined for the organization. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the organization resource. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (organizationId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (organizationId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,7 +132,7 @@ public ExtensionsRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// Request headers /// Request options /// Request query parameters @@ -128,7 +153,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// /// Request headers /// Request options @@ -146,7 +171,7 @@ public RequestInformation CreatePostRequestInformation(Extension body, Action - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -158,7 +183,7 @@ public async Task GetAsync(Action q = de return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -170,7 +195,7 @@ public async Task PostAsync(Extension model, Action(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Organization/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Organization/Item/Extensions/Item/ExtensionRequestBuilder.cs index 85ff7069d09..cc5f2bac884 100644 --- a/src/generated/Organization/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Organization/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -20,18 +20,21 @@ public class ExtensionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The collection of open extensions defined for the organization. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the organization resource. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (organizationId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The collection of open extensions defined for the organization. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the organization resource. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (organizationId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (organizationId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The collection of open extensions defined for the organization. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the organization resource. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (organizationId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public ExtensionRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(Extension body, Action - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = default, Ac return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(Extension model, Action var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for the organization. Read-only. Nullable. + /// The collection of open extensions defined for the organization resource. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Organization/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs b/src/generated/Organization/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs index 1e50b25bd23..8c1cc70d0d9 100644 --- a/src/generated/Organization/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs +++ b/src/generated/Organization/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--body")); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (organizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Organization/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs b/src/generated/Organization/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs index e67c11d3d91..07b55b92106 100644 --- a/src/generated/Organization/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs +++ b/src/generated/Organization/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--body")); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (organizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Organization/Item/OrganizationRequestBuilder.cs b/src/generated/Organization/Item/OrganizationRequestBuilder.cs index eb014e13929..4a47bcd0c13 100644 --- a/src/generated/Organization/Item/OrganizationRequestBuilder.cs +++ b/src/generated/Organization/Item/OrganizationRequestBuilder.cs @@ -62,10 +62,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from organization"; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); command.Handler = CommandHandler.Create(async (organizationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -86,14 +88,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from organization by key"; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (organizationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (organizationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -124,14 +134,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in organization"; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); - command.AddOption(new Option("--body")); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (organizationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Organization/Item/Restore/RestoreRequestBuilder.cs b/src/generated/Organization/Item/Restore/RestoreRequestBuilder.cs index e0127bbc311..cd541e78bca 100644 --- a/src/generated/Organization/Item/Restore/RestoreRequestBuilder.cs +++ b/src/generated/Organization/Item/Restore/RestoreRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restore"; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); command.Handler = CommandHandler.Create(async (organizationId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Organization/Item/SetMobileDeviceManagementAuthority/SetMobileDeviceManagementAuthorityRequestBuilder.cs b/src/generated/Organization/Item/SetMobileDeviceManagementAuthority/SetMobileDeviceManagementAuthorityRequestBuilder.cs index 99a8d3fa366..3a41fe34c31 100644 --- a/src/generated/Organization/Item/SetMobileDeviceManagementAuthority/SetMobileDeviceManagementAuthorityRequestBuilder.cs +++ b/src/generated/Organization/Item/SetMobileDeviceManagementAuthority/SetMobileDeviceManagementAuthorityRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Set mobile device management authority"; // Create options for all the parameters - command.AddOption(new Option("--organization-id", description: "key: id of organization")); + var organizationIdOption = new Option("--organization-id", description: "key: id of organization"); + organizationIdOption.IsRequired = true; + command.AddOption(organizationIdOption); command.Handler = CommandHandler.Create(async (organizationId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(organizationId)) requestInfo.PathParameters.Add("organization_id", organizationId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Organization/OrganizationRequestBuilder.cs b/src/generated/Organization/OrganizationRequestBuilder.cs index c18bef745c2..61f013b10f0 100644 --- a/src/generated/Organization/OrganizationRequestBuilder.cs +++ b/src/generated/Organization/OrganizationRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to organization"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,24 +79,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from organization"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Organization/ValidateProperties/ValidatePropertiesRequestBuilder.cs b/src/generated/Organization/ValidateProperties/ValidatePropertiesRequestBuilder.cs index 8b4e95f6860..a99ea43f74c 100644 --- a/src/generated/Organization/ValidateProperties/ValidatePropertiesRequestBuilder.cs +++ b/src/generated/Organization/ValidateProperties/ValidatePropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validateProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/PermissionGrants/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs b/src/generated/PermissionGrants/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs index 9e31fccdd82..36a3f229ed9 100644 --- a/src/generated/PermissionGrants/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs +++ b/src/generated/PermissionGrants/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getAvailableExtensionProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/PermissionGrants/GetByIds/GetByIdsRequestBuilder.cs b/src/generated/PermissionGrants/GetByIds/GetByIdsRequestBuilder.cs index 372789b6122..2fd075eca87 100644 --- a/src/generated/PermissionGrants/GetByIds/GetByIdsRequestBuilder.cs +++ b/src/generated/PermissionGrants/GetByIds/GetByIdsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getByIds"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/PermissionGrants/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs b/src/generated/PermissionGrants/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs index 7b6abffa739..f149108fc9c 100644 --- a/src/generated/PermissionGrants/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs +++ b/src/generated/PermissionGrants/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant")); - command.AddOption(new Option("--body")); + var resourceSpecificPermissionGrantIdOption = new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant"); + resourceSpecificPermissionGrantIdOption.IsRequired = true; + command.AddOption(resourceSpecificPermissionGrantIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (resourceSpecificPermissionGrantId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(resourceSpecificPermissionGrantId)) requestInfo.PathParameters.Add("resourceSpecificPermissionGrant_id", resourceSpecificPermissionGrantId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/PermissionGrants/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs b/src/generated/PermissionGrants/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs index a8d6845f39b..1cfbb0ef6d8 100644 --- a/src/generated/PermissionGrants/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs +++ b/src/generated/PermissionGrants/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant")); - command.AddOption(new Option("--body")); + var resourceSpecificPermissionGrantIdOption = new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant"); + resourceSpecificPermissionGrantIdOption.IsRequired = true; + command.AddOption(resourceSpecificPermissionGrantIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (resourceSpecificPermissionGrantId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(resourceSpecificPermissionGrantId)) requestInfo.PathParameters.Add("resourceSpecificPermissionGrant_id", resourceSpecificPermissionGrantId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/PermissionGrants/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs b/src/generated/PermissionGrants/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs index 57ae9c38863..aae3115d573 100644 --- a/src/generated/PermissionGrants/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs +++ b/src/generated/PermissionGrants/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant")); - command.AddOption(new Option("--body")); + var resourceSpecificPermissionGrantIdOption = new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant"); + resourceSpecificPermissionGrantIdOption.IsRequired = true; + command.AddOption(resourceSpecificPermissionGrantIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (resourceSpecificPermissionGrantId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(resourceSpecificPermissionGrantId)) requestInfo.PathParameters.Add("resourceSpecificPermissionGrant_id", resourceSpecificPermissionGrantId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/PermissionGrants/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs b/src/generated/PermissionGrants/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs index af31f621fcf..cbe94c3cb92 100644 --- a/src/generated/PermissionGrants/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs +++ b/src/generated/PermissionGrants/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant")); - command.AddOption(new Option("--body")); + var resourceSpecificPermissionGrantIdOption = new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant"); + resourceSpecificPermissionGrantIdOption.IsRequired = true; + command.AddOption(resourceSpecificPermissionGrantIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (resourceSpecificPermissionGrantId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(resourceSpecificPermissionGrantId)) requestInfo.PathParameters.Add("resourceSpecificPermissionGrant_id", resourceSpecificPermissionGrantId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/PermissionGrants/Item/ResourceSpecificPermissionGrantRequestBuilder.cs b/src/generated/PermissionGrants/Item/ResourceSpecificPermissionGrantRequestBuilder.cs index 172493f802e..c63324c874a 100644 --- a/src/generated/PermissionGrants/Item/ResourceSpecificPermissionGrantRequestBuilder.cs +++ b/src/generated/PermissionGrants/Item/ResourceSpecificPermissionGrantRequestBuilder.cs @@ -43,10 +43,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from permissionGrants"; // Create options for all the parameters - command.AddOption(new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant")); + var resourceSpecificPermissionGrantIdOption = new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant"); + resourceSpecificPermissionGrantIdOption.IsRequired = true; + command.AddOption(resourceSpecificPermissionGrantIdOption); command.Handler = CommandHandler.Create(async (resourceSpecificPermissionGrantId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(resourceSpecificPermissionGrantId)) requestInfo.PathParameters.Add("resourceSpecificPermissionGrant_id", resourceSpecificPermissionGrantId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -60,14 +62,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from permissionGrants by key"; // Create options for all the parameters - command.AddOption(new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (resourceSpecificPermissionGrantId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(resourceSpecificPermissionGrantId)) requestInfo.PathParameters.Add("resourceSpecificPermissionGrant_id", resourceSpecificPermissionGrantId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var resourceSpecificPermissionGrantIdOption = new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant"); + resourceSpecificPermissionGrantIdOption.IsRequired = true; + command.AddOption(resourceSpecificPermissionGrantIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (resourceSpecificPermissionGrantId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,14 +108,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in permissionGrants"; // Create options for all the parameters - command.AddOption(new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant")); - command.AddOption(new Option("--body")); + var resourceSpecificPermissionGrantIdOption = new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant"); + resourceSpecificPermissionGrantIdOption.IsRequired = true; + command.AddOption(resourceSpecificPermissionGrantIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (resourceSpecificPermissionGrantId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(resourceSpecificPermissionGrantId)) requestInfo.PathParameters.Add("resourceSpecificPermissionGrant_id", resourceSpecificPermissionGrantId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/PermissionGrants/Item/Restore/RestoreRequestBuilder.cs b/src/generated/PermissionGrants/Item/Restore/RestoreRequestBuilder.cs index fce1090f5fc..78cd25aa88e 100644 --- a/src/generated/PermissionGrants/Item/Restore/RestoreRequestBuilder.cs +++ b/src/generated/PermissionGrants/Item/Restore/RestoreRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restore"; // Create options for all the parameters - command.AddOption(new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant")); + var resourceSpecificPermissionGrantIdOption = new Option("--resourcespecificpermissiongrant-id", description: "key: id of resourceSpecificPermissionGrant"); + resourceSpecificPermissionGrantIdOption.IsRequired = true; + command.AddOption(resourceSpecificPermissionGrantIdOption); command.Handler = CommandHandler.Create(async (resourceSpecificPermissionGrantId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(resourceSpecificPermissionGrantId)) requestInfo.PathParameters.Add("resourceSpecificPermissionGrant_id", resourceSpecificPermissionGrantId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/PermissionGrants/PermissionGrantsRequestBuilder.cs b/src/generated/PermissionGrants/PermissionGrantsRequestBuilder.cs index 2d1dd0c60ff..5effc197364 100644 --- a/src/generated/PermissionGrants/PermissionGrantsRequestBuilder.cs +++ b/src/generated/PermissionGrants/PermissionGrantsRequestBuilder.cs @@ -44,12 +44,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to permissionGrants"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,18 +83,32 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from permissionGrants"; // Create options for all the parameters - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (search, filter, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (search, filter, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/PermissionGrants/ValidateProperties/ValidatePropertiesRequestBuilder.cs b/src/generated/PermissionGrants/ValidateProperties/ValidatePropertiesRequestBuilder.cs index 18329c1738c..987599b49b2 100644 --- a/src/generated/PermissionGrants/ValidateProperties/ValidatePropertiesRequestBuilder.cs +++ b/src/generated/PermissionGrants/ValidateProperties/ValidatePropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validateProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Places/Item/PlaceRequestBuilder.cs b/src/generated/Places/Item/PlaceRequestBuilder.cs index 754bdfe8e4e..5797351aa83 100644 --- a/src/generated/Places/Item/PlaceRequestBuilder.cs +++ b/src/generated/Places/Item/PlaceRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from places"; // Create options for all the parameters - command.AddOption(new Option("--place-id", description: "key: id of place")); + var placeIdOption = new Option("--place-id", description: "key: id of place"); + placeIdOption.IsRequired = true; + command.AddOption(placeIdOption); command.Handler = CommandHandler.Create(async (placeId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(placeId)) requestInfo.PathParameters.Add("place_id", placeId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from places by key"; // Create options for all the parameters - command.AddOption(new Option("--place-id", description: "key: id of place")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (placeId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(placeId)) requestInfo.PathParameters.Add("place_id", placeId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var placeIdOption = new Option("--place-id", description: "key: id of place"); + placeIdOption.IsRequired = true; + command.AddOption(placeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (placeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in places"; // Create options for all the parameters - command.AddOption(new Option("--place-id", description: "key: id of place")); - command.AddOption(new Option("--body")); + var placeIdOption = new Option("--place-id", description: "key: id of place"); + placeIdOption.IsRequired = true; + command.AddOption(placeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (placeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(placeId)) requestInfo.PathParameters.Add("place_id", placeId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Places/PlacesRequestBuilder.cs b/src/generated/Places/PlacesRequestBuilder.cs index 24515e8733f..67e2d0f0b8a 100644 --- a/src/generated/Places/PlacesRequestBuilder.cs +++ b/src/generated/Places/PlacesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to places"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from places"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Planner/Buckets/BucketsRequestBuilder.cs b/src/generated/Planner/Buckets/BucketsRequestBuilder.cs index de062575d6c..c4042964e02 100644 --- a/src/generated/Planner/Buckets/BucketsRequestBuilder.cs +++ b/src/generated/Planner/Buckets/BucketsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable. Returns a collection of the specified buckets"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable. Returns a collection of the specified buckets"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Planner/Buckets/Item/PlannerBucketRequestBuilder.cs b/src/generated/Planner/Buckets/Item/PlannerBucketRequestBuilder.cs index cf6365a5791..d53a2a23cd2 100644 --- a/src/generated/Planner/Buckets/Item/PlannerBucketRequestBuilder.cs +++ b/src/generated/Planner/Buckets/Item/PlannerBucketRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Returns a collection of the specified buckets"; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); command.Handler = CommandHandler.Create(async (plannerBucketId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Returns a collection of the specified buckets"; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerBucketId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerBucketId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,14 +80,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Returns a collection of the specified buckets"; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--body")); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerBucketId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs b/src/generated/Planner/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs index d12d33af828..137201bd1c4 100644 --- a/src/generated/Planner/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Planner/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs b/src/generated/Planner/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs index c776c1a933d..6ce03e08c1d 100644 --- a/src/generated/Planner/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Planner/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs b/src/generated/Planner/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs index 6598aae805c..9c483f49612 100644 --- a/src/generated/Planner/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Planner/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs b/src/generated/Planner/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs index ca9a6158dea..c7a9e93a9b0 100644 --- a/src/generated/Planner/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs +++ b/src/generated/Planner/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs @@ -46,12 +46,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -73,16 +76,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -101,16 +113,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs b/src/generated/Planner/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs index 12815ab567c..0fd97cce661 100644 --- a/src/generated/Planner/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Planner/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Buckets/Item/Tasks/TasksRequestBuilder.cs b/src/generated/Planner/Buckets/Item/Tasks/TasksRequestBuilder.cs index 745d5a7f09f..a481c350e3c 100644 --- a/src/generated/Planner/Buckets/Item/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Planner/Buckets/Item/Tasks/TasksRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--body")); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerBucketId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +70,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerBucketId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerBucketId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Planner/PlannerRequestBuilder.cs b/src/generated/Planner/PlannerRequestBuilder.cs index 39de98bc8fe..fbfff394d7c 100644 --- a/src/generated/Planner/PlannerRequestBuilder.cs +++ b/src/generated/Planner/PlannerRequestBuilder.cs @@ -36,12 +36,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get planner"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,12 +67,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update planner"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs b/src/generated/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs index 67967f24b08..7d8a8b28642 100644 --- a/src/generated/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs @@ -31,20 +31,24 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,32 +61,53 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,7 +133,7 @@ public BucketsRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -129,7 +154,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -147,7 +172,7 @@ public RequestInformation CreatePostRequestInformation(PlannerBucket body, Actio return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -159,7 +184,7 @@ public async Task GetAsync(Action q = defau return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -171,7 +196,7 @@ public async Task PostAsync(PlannerBucket model, Action(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs b/src/generated/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs index e65be41373f..a9c210a5aaf 100644 --- a/src/generated/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs @@ -21,18 +21,21 @@ public class PlannerBucketRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -40,22 +43,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,22 +80,27 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -111,7 +128,7 @@ public PlannerBucketRequestBuilder(Dictionary pathParameters, IR RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Request headers /// Request options /// @@ -126,7 +143,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -147,7 +164,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -165,7 +182,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerBucket body, Acti return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -176,7 +193,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -188,7 +205,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -200,7 +217,7 @@ public async Task PatchAsync(PlannerBucket model, ActionRead-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs b/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs index d7b80a0ec68..6a4ae4cd1be 100644 --- a/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs b/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs index 75f02fa05f5..414fca9475a 100644 --- a/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs b/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs index a73478c6af0..7fced22e1e8 100644 --- a/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs b/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs index 456bbf9b1f0..de374948786 100644 --- a/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs @@ -46,14 +46,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -75,18 +79,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -105,18 +119,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs b/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs index 8bf8ce50520..d372e4ba5a6 100644 --- a/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs b/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs index ee25551b3a8..4705b9ef0c3 100644 --- a/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerBucketId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Planner/Plans/Item/Details/DetailsRequestBuilder.cs b/src/generated/Planner/Plans/Item/Details/DetailsRequestBuilder.cs index f70dca5d55a..1bd64f773eb 100644 --- a/src/generated/Planner/Plans/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Details/DetailsRequestBuilder.cs @@ -20,16 +20,18 @@ public class DetailsRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Additional details about the plan."; + command.Description = "Additional details about the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -37,20 +39,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Additional details about the plan."; + command.Description = "Additional details about the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,20 +73,24 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Additional details about the plan."; + command.Description = "Additional details about the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -97,7 +111,7 @@ public DetailsRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Request headers /// Request options /// @@ -112,7 +126,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -133,7 +147,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -151,7 +165,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerPlanDetails body, return requestInfo; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +176,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +188,7 @@ public async Task GetAsync(Action q = de return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -186,7 +200,7 @@ public async Task PatchAsync(PlannerPlanDetails model, ActionRead-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Planner/Plans/Item/PlannerPlanRequestBuilder.cs b/src/generated/Planner/Plans/Item/PlannerPlanRequestBuilder.cs index d893d1c6443..42d927ab6b8 100644 --- a/src/generated/Planner/Plans/Item/PlannerPlanRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/PlannerPlanRequestBuilder.cs @@ -36,10 +36,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Returns a collection of the specified plans"; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,14 +63,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Returns a collection of the specified plans"; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,14 +97,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Returns a collection of the specified plans"; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs b/src/generated/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs index 6fd985fae55..0f43cee13a7 100644 --- a/src/generated/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs b/src/generated/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs index 319f732b425..0a2c8795080 100644 --- a/src/generated/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs b/src/generated/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs index 0d7069addc6..2ee85143091 100644 --- a/src/generated/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs b/src/generated/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs index 744abc81e8b..a7dbadc1375 100644 --- a/src/generated/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs @@ -40,18 +40,21 @@ public Command BuildBucketTaskBoardFormatCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,22 +70,31 @@ public Command BuildDetailsCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,22 +107,27 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -139,7 +156,7 @@ public PlannerTaskRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Request headers /// Request options /// @@ -154,7 +171,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -175,7 +192,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -193,7 +210,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerTask body, Action return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -204,7 +221,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -216,7 +233,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -228,7 +245,7 @@ public async Task PatchAsync(PlannerTask model, ActionRead-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs b/src/generated/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs index efc097dac6d..dabbdd5916c 100644 --- a/src/generated/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs b/src/generated/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs index e35df9bfc18..5c828c2c21a 100644 --- a/src/generated/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs @@ -34,20 +34,24 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,32 +64,53 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -111,7 +136,7 @@ public TasksRequestBuilder(Dictionary pathParameters, IRequestAd RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -132,7 +157,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -150,7 +175,7 @@ public RequestInformation CreatePostRequestInformation(PlannerTask body, Action< return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +187,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -174,7 +199,7 @@ public async Task PostAsync(PlannerTask model, Action(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Planner/Plans/PlansRequestBuilder.cs b/src/generated/Planner/Plans/PlansRequestBuilder.cs index 5e0b2b3a941..f536c53e97d 100644 --- a/src/generated/Planner/Plans/PlansRequestBuilder.cs +++ b/src/generated/Planner/Plans/PlansRequestBuilder.cs @@ -39,12 +39,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable. Returns a collection of the specified plans"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,24 +66,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable. Returns a collection of the specified plans"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Planner/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs b/src/generated/Planner/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs index 5df610b677d..60c5907f471 100644 --- a/src/generated/Planner/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Planner/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs b/src/generated/Planner/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs index 959d81c0208..aa949b2307e 100644 --- a/src/generated/Planner/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Planner/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Tasks/Item/Details/DetailsRequestBuilder.cs b/src/generated/Planner/Tasks/Item/Details/DetailsRequestBuilder.cs index a1aee979b3d..38e59384912 100644 --- a/src/generated/Planner/Tasks/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Planner/Tasks/Item/Details/DetailsRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Tasks/Item/PlannerTaskRequestBuilder.cs b/src/generated/Planner/Tasks/Item/PlannerTaskRequestBuilder.cs index fbb7937bc24..7c441692e53 100644 --- a/src/generated/Planner/Tasks/Item/PlannerTaskRequestBuilder.cs +++ b/src/generated/Planner/Tasks/Item/PlannerTaskRequestBuilder.cs @@ -46,10 +46,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Returns a collection of the specified tasks"; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -71,14 +73,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Returns a collection of the specified tasks"; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,14 +107,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Returns a collection of the specified tasks"; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs b/src/generated/Planner/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs index 931f0224690..0e697c6c4fd 100644 --- a/src/generated/Planner/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Planner/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Planner/Tasks/TasksRequestBuilder.cs b/src/generated/Planner/Tasks/TasksRequestBuilder.cs index 3463c34366e..a55bfa6599a 100644 --- a/src/generated/Planner/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Planner/Tasks/TasksRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable. Returns a collection of the specified tasks"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +67,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable. Returns a collection of the specified tasks"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Policies/ActivityBasedTimeoutPolicies/ActivityBasedTimeoutPoliciesRequestBuilder.cs b/src/generated/Policies/ActivityBasedTimeoutPolicies/ActivityBasedTimeoutPoliciesRequestBuilder.cs index 8010b71e7bd..6ee29e00594 100644 --- a/src/generated/Policies/ActivityBasedTimeoutPolicies/ActivityBasedTimeoutPoliciesRequestBuilder.cs +++ b/src/generated/Policies/ActivityBasedTimeoutPolicies/ActivityBasedTimeoutPoliciesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The policy that controls the idle time out for web sessions for applications."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The policy that controls the idle time out for web sessions for applications."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Policies/ActivityBasedTimeoutPolicies/Item/ActivityBasedTimeoutPolicyRequestBuilder.cs b/src/generated/Policies/ActivityBasedTimeoutPolicies/Item/ActivityBasedTimeoutPolicyRequestBuilder.cs index 65ef1a54f41..f07d200dca9 100644 --- a/src/generated/Policies/ActivityBasedTimeoutPolicies/Item/ActivityBasedTimeoutPolicyRequestBuilder.cs +++ b/src/generated/Policies/ActivityBasedTimeoutPolicies/Item/ActivityBasedTimeoutPolicyRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The policy that controls the idle time out for web sessions for applications."; // Create options for all the parameters - command.AddOption(new Option("--activitybasedtimeoutpolicy-id", description: "key: id of activityBasedTimeoutPolicy")); + var activityBasedTimeoutPolicyIdOption = new Option("--activitybasedtimeoutpolicy-id", description: "key: id of activityBasedTimeoutPolicy"); + activityBasedTimeoutPolicyIdOption.IsRequired = true; + command.AddOption(activityBasedTimeoutPolicyIdOption); command.Handler = CommandHandler.Create(async (activityBasedTimeoutPolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(activityBasedTimeoutPolicyId)) requestInfo.PathParameters.Add("activityBasedTimeoutPolicy_id", activityBasedTimeoutPolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The policy that controls the idle time out for web sessions for applications."; // Create options for all the parameters - command.AddOption(new Option("--activitybasedtimeoutpolicy-id", description: "key: id of activityBasedTimeoutPolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (activityBasedTimeoutPolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(activityBasedTimeoutPolicyId)) requestInfo.PathParameters.Add("activityBasedTimeoutPolicy_id", activityBasedTimeoutPolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var activityBasedTimeoutPolicyIdOption = new Option("--activitybasedtimeoutpolicy-id", description: "key: id of activityBasedTimeoutPolicy"); + activityBasedTimeoutPolicyIdOption.IsRequired = true; + command.AddOption(activityBasedTimeoutPolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (activityBasedTimeoutPolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The policy that controls the idle time out for web sessions for applications."; // Create options for all the parameters - command.AddOption(new Option("--activitybasedtimeoutpolicy-id", description: "key: id of activityBasedTimeoutPolicy")); - command.AddOption(new Option("--body")); + var activityBasedTimeoutPolicyIdOption = new Option("--activitybasedtimeoutpolicy-id", description: "key: id of activityBasedTimeoutPolicy"); + activityBasedTimeoutPolicyIdOption.IsRequired = true; + command.AddOption(activityBasedTimeoutPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (activityBasedTimeoutPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(activityBasedTimeoutPolicyId)) requestInfo.PathParameters.Add("activityBasedTimeoutPolicy_id", activityBasedTimeoutPolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/AdminConsentRequestPolicy/AdminConsentRequestPolicyRequestBuilder.cs b/src/generated/Policies/AdminConsentRequestPolicy/AdminConsentRequestPolicyRequestBuilder.cs index d4e4f299bd6..9e9497d0c15 100644 --- a/src/generated/Policies/AdminConsentRequestPolicy/AdminConsentRequestPolicyRequestBuilder.cs +++ b/src/generated/Policies/AdminConsentRequestPolicy/AdminConsentRequestPolicyRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildDeleteCommand() { command.Description = "The policy by which consent requests are created and managed for the entire tenant."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,12 +42,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The policy by which consent requests are created and managed for the entire tenant."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,12 +73,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The policy by which consent requests are created and managed for the entire tenant."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/AuthenticationFlowsPolicy/AuthenticationFlowsPolicyRequestBuilder.cs b/src/generated/Policies/AuthenticationFlowsPolicy/AuthenticationFlowsPolicyRequestBuilder.cs index e5bd420d45b..72cf6f14230 100644 --- a/src/generated/Policies/AuthenticationFlowsPolicy/AuthenticationFlowsPolicyRequestBuilder.cs +++ b/src/generated/Policies/AuthenticationFlowsPolicy/AuthenticationFlowsPolicyRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildDeleteCommand() { command.Description = "The policy configuration of the self-service sign-up experience of external users."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,12 +42,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The policy configuration of the self-service sign-up experience of external users."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,12 +73,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The policy configuration of the self-service sign-up experience of external users."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/AuthenticationMethodsPolicy/AuthenticationMethodsPolicyRequestBuilder.cs b/src/generated/Policies/AuthenticationMethodsPolicy/AuthenticationMethodsPolicyRequestBuilder.cs index baad93b85d6..643d09e7209 100644 --- a/src/generated/Policies/AuthenticationMethodsPolicy/AuthenticationMethodsPolicyRequestBuilder.cs +++ b/src/generated/Policies/AuthenticationMethodsPolicy/AuthenticationMethodsPolicyRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildDeleteCommand() { command.Description = "The authentication methods and the users that are allowed to use them to sign in and perform multi-factor authentication (MFA) in Azure Active Directory (Azure AD)."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,12 +42,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The authentication methods and the users that are allowed to use them to sign in and perform multi-factor authentication (MFA) in Azure Active Directory (Azure AD)."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,12 +73,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The authentication methods and the users that are allowed to use them to sign in and perform multi-factor authentication (MFA) in Azure Active Directory (Azure AD)."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/AuthorizationPolicy/AuthorizationPolicyRequestBuilder.cs b/src/generated/Policies/AuthorizationPolicy/AuthorizationPolicyRequestBuilder.cs index e3b3ef812e0..2a01c1ebb2e 100644 --- a/src/generated/Policies/AuthorizationPolicy/AuthorizationPolicyRequestBuilder.cs +++ b/src/generated/Policies/AuthorizationPolicy/AuthorizationPolicyRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildDeleteCommand() { command.Description = "The policy that controls Azure AD authorization settings."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,12 +42,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The policy that controls Azure AD authorization settings."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,12 +73,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The policy that controls Azure AD authorization settings."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/ClaimsMappingPolicies/ClaimsMappingPoliciesRequestBuilder.cs b/src/generated/Policies/ClaimsMappingPolicies/ClaimsMappingPoliciesRequestBuilder.cs index 6b20416e8bf..0a85061603d 100644 --- a/src/generated/Policies/ClaimsMappingPolicies/ClaimsMappingPoliciesRequestBuilder.cs +++ b/src/generated/Policies/ClaimsMappingPolicies/ClaimsMappingPoliciesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The claim-mapping policies for WS-Fed, SAML, OAuth 2.0, and OpenID Connect protocols, for tokens issued to a specific application."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The claim-mapping policies for WS-Fed, SAML, OAuth 2.0, and OpenID Connect protocols, for tokens issued to a specific application."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Policies/ClaimsMappingPolicies/Item/ClaimsMappingPolicyRequestBuilder.cs b/src/generated/Policies/ClaimsMappingPolicies/Item/ClaimsMappingPolicyRequestBuilder.cs index 9231765e45d..d021d7e4ef8 100644 --- a/src/generated/Policies/ClaimsMappingPolicies/Item/ClaimsMappingPolicyRequestBuilder.cs +++ b/src/generated/Policies/ClaimsMappingPolicies/Item/ClaimsMappingPolicyRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The claim-mapping policies for WS-Fed, SAML, OAuth 2.0, and OpenID Connect protocols, for tokens issued to a specific application."; // Create options for all the parameters - command.AddOption(new Option("--claimsmappingpolicy-id", description: "key: id of claimsMappingPolicy")); + var claimsMappingPolicyIdOption = new Option("--claimsmappingpolicy-id", description: "key: id of claimsMappingPolicy"); + claimsMappingPolicyIdOption.IsRequired = true; + command.AddOption(claimsMappingPolicyIdOption); command.Handler = CommandHandler.Create(async (claimsMappingPolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(claimsMappingPolicyId)) requestInfo.PathParameters.Add("claimsMappingPolicy_id", claimsMappingPolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The claim-mapping policies for WS-Fed, SAML, OAuth 2.0, and OpenID Connect protocols, for tokens issued to a specific application."; // Create options for all the parameters - command.AddOption(new Option("--claimsmappingpolicy-id", description: "key: id of claimsMappingPolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (claimsMappingPolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(claimsMappingPolicyId)) requestInfo.PathParameters.Add("claimsMappingPolicy_id", claimsMappingPolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var claimsMappingPolicyIdOption = new Option("--claimsmappingpolicy-id", description: "key: id of claimsMappingPolicy"); + claimsMappingPolicyIdOption.IsRequired = true; + command.AddOption(claimsMappingPolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (claimsMappingPolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The claim-mapping policies for WS-Fed, SAML, OAuth 2.0, and OpenID Connect protocols, for tokens issued to a specific application."; // Create options for all the parameters - command.AddOption(new Option("--claimsmappingpolicy-id", description: "key: id of claimsMappingPolicy")); - command.AddOption(new Option("--body")); + var claimsMappingPolicyIdOption = new Option("--claimsmappingpolicy-id", description: "key: id of claimsMappingPolicy"); + claimsMappingPolicyIdOption.IsRequired = true; + command.AddOption(claimsMappingPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (claimsMappingPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(claimsMappingPolicyId)) requestInfo.PathParameters.Add("claimsMappingPolicy_id", claimsMappingPolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/ConditionalAccessPolicies/ConditionalAccessPoliciesRequestBuilder.cs b/src/generated/Policies/ConditionalAccessPolicies/ConditionalAccessPoliciesRequestBuilder.cs index 05b408e2387..d5f8149f7e6 100644 --- a/src/generated/Policies/ConditionalAccessPolicies/ConditionalAccessPoliciesRequestBuilder.cs +++ b/src/generated/Policies/ConditionalAccessPolicies/ConditionalAccessPoliciesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The custom rules that define an access scenario."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The custom rules that define an access scenario."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Policies/ConditionalAccessPolicies/Item/ConditionalAccessPolicyRequestBuilder.cs b/src/generated/Policies/ConditionalAccessPolicies/Item/ConditionalAccessPolicyRequestBuilder.cs index c1358d22bf8..d288ace557f 100644 --- a/src/generated/Policies/ConditionalAccessPolicies/Item/ConditionalAccessPolicyRequestBuilder.cs +++ b/src/generated/Policies/ConditionalAccessPolicies/Item/ConditionalAccessPolicyRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The custom rules that define an access scenario."; // Create options for all the parameters - command.AddOption(new Option("--conditionalaccesspolicy-id", description: "key: id of conditionalAccessPolicy")); + var conditionalAccessPolicyIdOption = new Option("--conditionalaccesspolicy-id", description: "key: id of conditionalAccessPolicy"); + conditionalAccessPolicyIdOption.IsRequired = true; + command.AddOption(conditionalAccessPolicyIdOption); command.Handler = CommandHandler.Create(async (conditionalAccessPolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(conditionalAccessPolicyId)) requestInfo.PathParameters.Add("conditionalAccessPolicy_id", conditionalAccessPolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The custom rules that define an access scenario."; // Create options for all the parameters - command.AddOption(new Option("--conditionalaccesspolicy-id", description: "key: id of conditionalAccessPolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (conditionalAccessPolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(conditionalAccessPolicyId)) requestInfo.PathParameters.Add("conditionalAccessPolicy_id", conditionalAccessPolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var conditionalAccessPolicyIdOption = new Option("--conditionalaccesspolicy-id", description: "key: id of conditionalAccessPolicy"); + conditionalAccessPolicyIdOption.IsRequired = true; + command.AddOption(conditionalAccessPolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (conditionalAccessPolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The custom rules that define an access scenario."; // Create options for all the parameters - command.AddOption(new Option("--conditionalaccesspolicy-id", description: "key: id of conditionalAccessPolicy")); - command.AddOption(new Option("--body")); + var conditionalAccessPolicyIdOption = new Option("--conditionalaccesspolicy-id", description: "key: id of conditionalAccessPolicy"); + conditionalAccessPolicyIdOption.IsRequired = true; + command.AddOption(conditionalAccessPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (conditionalAccessPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(conditionalAccessPolicyId)) requestInfo.PathParameters.Add("conditionalAccessPolicy_id", conditionalAccessPolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/FeatureRolloutPolicies/FeatureRolloutPoliciesRequestBuilder.cs b/src/generated/Policies/FeatureRolloutPolicies/FeatureRolloutPoliciesRequestBuilder.cs index af568ff72b2..e8685364e52 100644 --- a/src/generated/Policies/FeatureRolloutPolicies/FeatureRolloutPoliciesRequestBuilder.cs +++ b/src/generated/Policies/FeatureRolloutPolicies/FeatureRolloutPoliciesRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The feature rollout policy associated with a directory object."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The feature rollout policy associated with a directory object."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Policies/FeatureRolloutPolicies/Item/AppliesTo/AppliesToRequestBuilder.cs b/src/generated/Policies/FeatureRolloutPolicies/Item/AppliesTo/AppliesToRequestBuilder.cs index 0a870457e6c..382b569c382 100644 --- a/src/generated/Policies/FeatureRolloutPolicies/Item/AppliesTo/AppliesToRequestBuilder.cs +++ b/src/generated/Policies/FeatureRolloutPolicies/Item/AppliesTo/AppliesToRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Nullable. Specifies a list of directoryObjects that feature is enabled for."; // Create options for all the parameters - command.AddOption(new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy")); - command.AddOption(new Option("--body")); + var featureRolloutPolicyIdOption = new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy"); + featureRolloutPolicyIdOption.IsRequired = true; + command.AddOption(featureRolloutPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (featureRolloutPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(featureRolloutPolicyId)) requestInfo.PathParameters.Add("featureRolloutPolicy_id", featureRolloutPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Nullable. Specifies a list of directoryObjects that feature is enabled for."; // Create options for all the parameters - command.AddOption(new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (featureRolloutPolicyId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(featureRolloutPolicyId)) requestInfo.PathParameters.Add("featureRolloutPolicy_id", featureRolloutPolicyId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var featureRolloutPolicyIdOption = new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy"); + featureRolloutPolicyIdOption.IsRequired = true; + command.AddOption(featureRolloutPolicyIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (featureRolloutPolicyId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Policies/FeatureRolloutPolicies/Item/AppliesTo/Item/DirectoryObjectRequestBuilder.cs b/src/generated/Policies/FeatureRolloutPolicies/Item/AppliesTo/Item/DirectoryObjectRequestBuilder.cs index e991f518a08..b5339279d07 100644 --- a/src/generated/Policies/FeatureRolloutPolicies/Item/AppliesTo/Item/DirectoryObjectRequestBuilder.cs +++ b/src/generated/Policies/FeatureRolloutPolicies/Item/AppliesTo/Item/DirectoryObjectRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Nullable. Specifies a list of directoryObjects that feature is enabled for."; // Create options for all the parameters - command.AddOption(new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy")); - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); + var featureRolloutPolicyIdOption = new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy"); + featureRolloutPolicyIdOption.IsRequired = true; + command.AddOption(featureRolloutPolicyIdOption); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); command.Handler = CommandHandler.Create(async (featureRolloutPolicyId, directoryObjectId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(featureRolloutPolicyId)) requestInfo.PathParameters.Add("featureRolloutPolicy_id", featureRolloutPolicyId); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Nullable. Specifies a list of directoryObjects that feature is enabled for."; // Create options for all the parameters - command.AddOption(new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy")); - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (featureRolloutPolicyId, directoryObjectId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(featureRolloutPolicyId)) requestInfo.PathParameters.Add("featureRolloutPolicy_id", featureRolloutPolicyId); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var featureRolloutPolicyIdOption = new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy"); + featureRolloutPolicyIdOption.IsRequired = true; + command.AddOption(featureRolloutPolicyIdOption); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (featureRolloutPolicyId, directoryObjectId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Nullable. Specifies a list of directoryObjects that feature is enabled for."; // Create options for all the parameters - command.AddOption(new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy")); - command.AddOption(new Option("--directoryobject-id", description: "key: id of directoryObject")); - command.AddOption(new Option("--body")); + var featureRolloutPolicyIdOption = new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy"); + featureRolloutPolicyIdOption.IsRequired = true; + command.AddOption(featureRolloutPolicyIdOption); + var directoryObjectIdOption = new Option("--directoryobject-id", description: "key: id of directoryObject"); + directoryObjectIdOption.IsRequired = true; + command.AddOption(directoryObjectIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (featureRolloutPolicyId, directoryObjectId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(featureRolloutPolicyId)) requestInfo.PathParameters.Add("featureRolloutPolicy_id", featureRolloutPolicyId); - if (!String.IsNullOrEmpty(directoryObjectId)) requestInfo.PathParameters.Add("directoryObject_id", directoryObjectId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/FeatureRolloutPolicies/Item/FeatureRolloutPolicyRequestBuilder.cs b/src/generated/Policies/FeatureRolloutPolicies/Item/FeatureRolloutPolicyRequestBuilder.cs index 0766e71439d..00f3dfe8716 100644 --- a/src/generated/Policies/FeatureRolloutPolicies/Item/FeatureRolloutPolicyRequestBuilder.cs +++ b/src/generated/Policies/FeatureRolloutPolicies/Item/FeatureRolloutPolicyRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The feature rollout policy associated with a directory object."; // Create options for all the parameters - command.AddOption(new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy")); + var featureRolloutPolicyIdOption = new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy"); + featureRolloutPolicyIdOption.IsRequired = true; + command.AddOption(featureRolloutPolicyIdOption); command.Handler = CommandHandler.Create(async (featureRolloutPolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(featureRolloutPolicyId)) requestInfo.PathParameters.Add("featureRolloutPolicy_id", featureRolloutPolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The feature rollout policy associated with a directory object."; // Create options for all the parameters - command.AddOption(new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (featureRolloutPolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(featureRolloutPolicyId)) requestInfo.PathParameters.Add("featureRolloutPolicy_id", featureRolloutPolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var featureRolloutPolicyIdOption = new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy"); + featureRolloutPolicyIdOption.IsRequired = true; + command.AddOption(featureRolloutPolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (featureRolloutPolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The feature rollout policy associated with a directory object."; // Create options for all the parameters - command.AddOption(new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy")); - command.AddOption(new Option("--body")); + var featureRolloutPolicyIdOption = new Option("--featurerolloutpolicy-id", description: "key: id of featureRolloutPolicy"); + featureRolloutPolicyIdOption.IsRequired = true; + command.AddOption(featureRolloutPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (featureRolloutPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(featureRolloutPolicyId)) requestInfo.PathParameters.Add("featureRolloutPolicy_id", featureRolloutPolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/HomeRealmDiscoveryPolicies/HomeRealmDiscoveryPoliciesRequestBuilder.cs b/src/generated/Policies/HomeRealmDiscoveryPolicies/HomeRealmDiscoveryPoliciesRequestBuilder.cs index e9c33dfeed8..1a5bc37cb4c 100644 --- a/src/generated/Policies/HomeRealmDiscoveryPolicies/HomeRealmDiscoveryPoliciesRequestBuilder.cs +++ b/src/generated/Policies/HomeRealmDiscoveryPolicies/HomeRealmDiscoveryPoliciesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The policy to control Azure AD authentication behavior for federated users."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The policy to control Azure AD authentication behavior for federated users."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Policies/HomeRealmDiscoveryPolicies/Item/HomeRealmDiscoveryPolicyRequestBuilder.cs b/src/generated/Policies/HomeRealmDiscoveryPolicies/Item/HomeRealmDiscoveryPolicyRequestBuilder.cs index 3f418bcbc5d..cb3ee5fca42 100644 --- a/src/generated/Policies/HomeRealmDiscoveryPolicies/Item/HomeRealmDiscoveryPolicyRequestBuilder.cs +++ b/src/generated/Policies/HomeRealmDiscoveryPolicies/Item/HomeRealmDiscoveryPolicyRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The policy to control Azure AD authentication behavior for federated users."; // Create options for all the parameters - command.AddOption(new Option("--homerealmdiscoverypolicy-id", description: "key: id of homeRealmDiscoveryPolicy")); + var homeRealmDiscoveryPolicyIdOption = new Option("--homerealmdiscoverypolicy-id", description: "key: id of homeRealmDiscoveryPolicy"); + homeRealmDiscoveryPolicyIdOption.IsRequired = true; + command.AddOption(homeRealmDiscoveryPolicyIdOption); command.Handler = CommandHandler.Create(async (homeRealmDiscoveryPolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(homeRealmDiscoveryPolicyId)) requestInfo.PathParameters.Add("homeRealmDiscoveryPolicy_id", homeRealmDiscoveryPolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The policy to control Azure AD authentication behavior for federated users."; // Create options for all the parameters - command.AddOption(new Option("--homerealmdiscoverypolicy-id", description: "key: id of homeRealmDiscoveryPolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (homeRealmDiscoveryPolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(homeRealmDiscoveryPolicyId)) requestInfo.PathParameters.Add("homeRealmDiscoveryPolicy_id", homeRealmDiscoveryPolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var homeRealmDiscoveryPolicyIdOption = new Option("--homerealmdiscoverypolicy-id", description: "key: id of homeRealmDiscoveryPolicy"); + homeRealmDiscoveryPolicyIdOption.IsRequired = true; + command.AddOption(homeRealmDiscoveryPolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (homeRealmDiscoveryPolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The policy to control Azure AD authentication behavior for federated users."; // Create options for all the parameters - command.AddOption(new Option("--homerealmdiscoverypolicy-id", description: "key: id of homeRealmDiscoveryPolicy")); - command.AddOption(new Option("--body")); + var homeRealmDiscoveryPolicyIdOption = new Option("--homerealmdiscoverypolicy-id", description: "key: id of homeRealmDiscoveryPolicy"); + homeRealmDiscoveryPolicyIdOption.IsRequired = true; + command.AddOption(homeRealmDiscoveryPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (homeRealmDiscoveryPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(homeRealmDiscoveryPolicyId)) requestInfo.PathParameters.Add("homeRealmDiscoveryPolicy_id", homeRealmDiscoveryPolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/IdentitySecurityDefaultsEnforcementPolicy/IdentitySecurityDefaultsEnforcementPolicyRequestBuilder.cs b/src/generated/Policies/IdentitySecurityDefaultsEnforcementPolicy/IdentitySecurityDefaultsEnforcementPolicyRequestBuilder.cs index c4c8c74fa07..a965efadafc 100644 --- a/src/generated/Policies/IdentitySecurityDefaultsEnforcementPolicy/IdentitySecurityDefaultsEnforcementPolicyRequestBuilder.cs +++ b/src/generated/Policies/IdentitySecurityDefaultsEnforcementPolicy/IdentitySecurityDefaultsEnforcementPolicyRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildDeleteCommand() { command.Description = "The policy that represents the security defaults that protect against common attacks."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,12 +42,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The policy that represents the security defaults that protect against common attacks."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,12 +73,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The policy that represents the security defaults that protect against common attacks."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/PermissionGrantPolicies/Item/Excludes/ExcludesRequestBuilder.cs b/src/generated/Policies/PermissionGrantPolicies/Item/Excludes/ExcludesRequestBuilder.cs index 9dd07ee69aa..0a125c8ae9b 100644 --- a/src/generated/Policies/PermissionGrantPolicies/Item/Excludes/ExcludesRequestBuilder.cs +++ b/src/generated/Policies/PermissionGrantPolicies/Item/Excludes/ExcludesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Condition sets which are excluded in this permission grant policy. Automatically expanded on GET."; // Create options for all the parameters - command.AddOption(new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy")); - command.AddOption(new Option("--body")); + var permissionGrantPolicyIdOption = new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy"); + permissionGrantPolicyIdOption.IsRequired = true; + command.AddOption(permissionGrantPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(permissionGrantPolicyId)) requestInfo.PathParameters.Add("permissionGrantPolicy_id", permissionGrantPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Condition sets which are excluded in this permission grant policy. Automatically expanded on GET."; // Create options for all the parameters - command.AddOption(new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(permissionGrantPolicyId)) requestInfo.PathParameters.Add("permissionGrantPolicy_id", permissionGrantPolicyId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var permissionGrantPolicyIdOption = new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy"); + permissionGrantPolicyIdOption.IsRequired = true; + command.AddOption(permissionGrantPolicyIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Policies/PermissionGrantPolicies/Item/Excludes/Item/PermissionGrantConditionSetRequestBuilder.cs b/src/generated/Policies/PermissionGrantPolicies/Item/Excludes/Item/PermissionGrantConditionSetRequestBuilder.cs index 8fc9e9a032b..9840f6a2063 100644 --- a/src/generated/Policies/PermissionGrantPolicies/Item/Excludes/Item/PermissionGrantConditionSetRequestBuilder.cs +++ b/src/generated/Policies/PermissionGrantPolicies/Item/Excludes/Item/PermissionGrantConditionSetRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Condition sets which are excluded in this permission grant policy. Automatically expanded on GET."; // Create options for all the parameters - command.AddOption(new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy")); - command.AddOption(new Option("--permissiongrantconditionset-id", description: "key: id of permissionGrantConditionSet")); + var permissionGrantPolicyIdOption = new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy"); + permissionGrantPolicyIdOption.IsRequired = true; + command.AddOption(permissionGrantPolicyIdOption); + var permissionGrantConditionSetIdOption = new Option("--permissiongrantconditionset-id", description: "key: id of permissionGrantConditionSet"); + permissionGrantConditionSetIdOption.IsRequired = true; + command.AddOption(permissionGrantConditionSetIdOption); command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, permissionGrantConditionSetId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(permissionGrantPolicyId)) requestInfo.PathParameters.Add("permissionGrantPolicy_id", permissionGrantPolicyId); - if (!String.IsNullOrEmpty(permissionGrantConditionSetId)) requestInfo.PathParameters.Add("permissionGrantConditionSet_id", permissionGrantConditionSetId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Condition sets which are excluded in this permission grant policy. Automatically expanded on GET."; // Create options for all the parameters - command.AddOption(new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy")); - command.AddOption(new Option("--permissiongrantconditionset-id", description: "key: id of permissionGrantConditionSet")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, permissionGrantConditionSetId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(permissionGrantPolicyId)) requestInfo.PathParameters.Add("permissionGrantPolicy_id", permissionGrantPolicyId); - if (!String.IsNullOrEmpty(permissionGrantConditionSetId)) requestInfo.PathParameters.Add("permissionGrantConditionSet_id", permissionGrantConditionSetId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var permissionGrantPolicyIdOption = new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy"); + permissionGrantPolicyIdOption.IsRequired = true; + command.AddOption(permissionGrantPolicyIdOption); + var permissionGrantConditionSetIdOption = new Option("--permissiongrantconditionset-id", description: "key: id of permissionGrantConditionSet"); + permissionGrantConditionSetIdOption.IsRequired = true; + command.AddOption(permissionGrantConditionSetIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, permissionGrantConditionSetId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Condition sets which are excluded in this permission grant policy. Automatically expanded on GET."; // Create options for all the parameters - command.AddOption(new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy")); - command.AddOption(new Option("--permissiongrantconditionset-id", description: "key: id of permissionGrantConditionSet")); - command.AddOption(new Option("--body")); + var permissionGrantPolicyIdOption = new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy"); + permissionGrantPolicyIdOption.IsRequired = true; + command.AddOption(permissionGrantPolicyIdOption); + var permissionGrantConditionSetIdOption = new Option("--permissiongrantconditionset-id", description: "key: id of permissionGrantConditionSet"); + permissionGrantConditionSetIdOption.IsRequired = true; + command.AddOption(permissionGrantConditionSetIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, permissionGrantConditionSetId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(permissionGrantPolicyId)) requestInfo.PathParameters.Add("permissionGrantPolicy_id", permissionGrantPolicyId); - if (!String.IsNullOrEmpty(permissionGrantConditionSetId)) requestInfo.PathParameters.Add("permissionGrantConditionSet_id", permissionGrantConditionSetId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/PermissionGrantPolicies/Item/Includes/IncludesRequestBuilder.cs b/src/generated/Policies/PermissionGrantPolicies/Item/Includes/IncludesRequestBuilder.cs index 490211df9ba..ee30531e211 100644 --- a/src/generated/Policies/PermissionGrantPolicies/Item/Includes/IncludesRequestBuilder.cs +++ b/src/generated/Policies/PermissionGrantPolicies/Item/Includes/IncludesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Condition sets which are included in this permission grant policy. Automatically expanded on GET."; // Create options for all the parameters - command.AddOption(new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy")); - command.AddOption(new Option("--body")); + var permissionGrantPolicyIdOption = new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy"); + permissionGrantPolicyIdOption.IsRequired = true; + command.AddOption(permissionGrantPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(permissionGrantPolicyId)) requestInfo.PathParameters.Add("permissionGrantPolicy_id", permissionGrantPolicyId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Condition sets which are included in this permission grant policy. Automatically expanded on GET."; // Create options for all the parameters - command.AddOption(new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(permissionGrantPolicyId)) requestInfo.PathParameters.Add("permissionGrantPolicy_id", permissionGrantPolicyId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var permissionGrantPolicyIdOption = new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy"); + permissionGrantPolicyIdOption.IsRequired = true; + command.AddOption(permissionGrantPolicyIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Policies/PermissionGrantPolicies/Item/Includes/Item/PermissionGrantConditionSetRequestBuilder.cs b/src/generated/Policies/PermissionGrantPolicies/Item/Includes/Item/PermissionGrantConditionSetRequestBuilder.cs index f2f22efdf19..33fb0531690 100644 --- a/src/generated/Policies/PermissionGrantPolicies/Item/Includes/Item/PermissionGrantConditionSetRequestBuilder.cs +++ b/src/generated/Policies/PermissionGrantPolicies/Item/Includes/Item/PermissionGrantConditionSetRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Condition sets which are included in this permission grant policy. Automatically expanded on GET."; // Create options for all the parameters - command.AddOption(new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy")); - command.AddOption(new Option("--permissiongrantconditionset-id", description: "key: id of permissionGrantConditionSet")); + var permissionGrantPolicyIdOption = new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy"); + permissionGrantPolicyIdOption.IsRequired = true; + command.AddOption(permissionGrantPolicyIdOption); + var permissionGrantConditionSetIdOption = new Option("--permissiongrantconditionset-id", description: "key: id of permissionGrantConditionSet"); + permissionGrantConditionSetIdOption.IsRequired = true; + command.AddOption(permissionGrantConditionSetIdOption); command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, permissionGrantConditionSetId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(permissionGrantPolicyId)) requestInfo.PathParameters.Add("permissionGrantPolicy_id", permissionGrantPolicyId); - if (!String.IsNullOrEmpty(permissionGrantConditionSetId)) requestInfo.PathParameters.Add("permissionGrantConditionSet_id", permissionGrantConditionSetId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Condition sets which are included in this permission grant policy. Automatically expanded on GET."; // Create options for all the parameters - command.AddOption(new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy")); - command.AddOption(new Option("--permissiongrantconditionset-id", description: "key: id of permissionGrantConditionSet")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, permissionGrantConditionSetId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(permissionGrantPolicyId)) requestInfo.PathParameters.Add("permissionGrantPolicy_id", permissionGrantPolicyId); - if (!String.IsNullOrEmpty(permissionGrantConditionSetId)) requestInfo.PathParameters.Add("permissionGrantConditionSet_id", permissionGrantConditionSetId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var permissionGrantPolicyIdOption = new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy"); + permissionGrantPolicyIdOption.IsRequired = true; + command.AddOption(permissionGrantPolicyIdOption); + var permissionGrantConditionSetIdOption = new Option("--permissiongrantconditionset-id", description: "key: id of permissionGrantConditionSet"); + permissionGrantConditionSetIdOption.IsRequired = true; + command.AddOption(permissionGrantConditionSetIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, permissionGrantConditionSetId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Condition sets which are included in this permission grant policy. Automatically expanded on GET."; // Create options for all the parameters - command.AddOption(new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy")); - command.AddOption(new Option("--permissiongrantconditionset-id", description: "key: id of permissionGrantConditionSet")); - command.AddOption(new Option("--body")); + var permissionGrantPolicyIdOption = new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy"); + permissionGrantPolicyIdOption.IsRequired = true; + command.AddOption(permissionGrantPolicyIdOption); + var permissionGrantConditionSetIdOption = new Option("--permissiongrantconditionset-id", description: "key: id of permissionGrantConditionSet"); + permissionGrantConditionSetIdOption.IsRequired = true; + command.AddOption(permissionGrantConditionSetIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, permissionGrantConditionSetId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(permissionGrantPolicyId)) requestInfo.PathParameters.Add("permissionGrantPolicy_id", permissionGrantPolicyId); - if (!String.IsNullOrEmpty(permissionGrantConditionSetId)) requestInfo.PathParameters.Add("permissionGrantConditionSet_id", permissionGrantConditionSetId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/PermissionGrantPolicies/Item/PermissionGrantPolicyRequestBuilder.cs b/src/generated/Policies/PermissionGrantPolicies/Item/PermissionGrantPolicyRequestBuilder.cs index 22ae0813d6f..894c38ae2b8 100644 --- a/src/generated/Policies/PermissionGrantPolicies/Item/PermissionGrantPolicyRequestBuilder.cs +++ b/src/generated/Policies/PermissionGrantPolicies/Item/PermissionGrantPolicyRequestBuilder.cs @@ -28,10 +28,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The policy that specifies the conditions under which consent can be granted."; // Create options for all the parameters - command.AddOption(new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy")); + var permissionGrantPolicyIdOption = new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy"); + permissionGrantPolicyIdOption.IsRequired = true; + command.AddOption(permissionGrantPolicyIdOption); command.Handler = CommandHandler.Create(async (permissionGrantPolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(permissionGrantPolicyId)) requestInfo.PathParameters.Add("permissionGrantPolicy_id", permissionGrantPolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,14 +54,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The policy that specifies the conditions under which consent can be granted."; // Create options for all the parameters - command.AddOption(new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(permissionGrantPolicyId)) requestInfo.PathParameters.Add("permissionGrantPolicy_id", permissionGrantPolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var permissionGrantPolicyIdOption = new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy"); + permissionGrantPolicyIdOption.IsRequired = true; + command.AddOption(permissionGrantPolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,14 +95,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The policy that specifies the conditions under which consent can be granted."; // Create options for all the parameters - command.AddOption(new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy")); - command.AddOption(new Option("--body")); + var permissionGrantPolicyIdOption = new Option("--permissiongrantpolicy-id", description: "key: id of permissionGrantPolicy"); + permissionGrantPolicyIdOption.IsRequired = true; + command.AddOption(permissionGrantPolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (permissionGrantPolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(permissionGrantPolicyId)) requestInfo.PathParameters.Add("permissionGrantPolicy_id", permissionGrantPolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/PermissionGrantPolicies/PermissionGrantPoliciesRequestBuilder.cs b/src/generated/Policies/PermissionGrantPolicies/PermissionGrantPoliciesRequestBuilder.cs index 9f2dcd29e68..0bb3ea58f8a 100644 --- a/src/generated/Policies/PermissionGrantPolicies/PermissionGrantPoliciesRequestBuilder.cs +++ b/src/generated/Policies/PermissionGrantPolicies/PermissionGrantPoliciesRequestBuilder.cs @@ -38,12 +38,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The policy that specifies the conditions under which consent can be granted."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +65,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The policy that specifies the conditions under which consent can be granted."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Policies/PoliciesRequestBuilder.cs b/src/generated/Policies/PoliciesRequestBuilder.cs index e8bf8ace2ae..5997f4da5ab 100644 --- a/src/generated/Policies/PoliciesRequestBuilder.cs +++ b/src/generated/Policies/PoliciesRequestBuilder.cs @@ -99,12 +99,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get policies"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -138,12 +145,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update policies"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/TokenIssuancePolicies/Item/TokenIssuancePolicyRequestBuilder.cs b/src/generated/Policies/TokenIssuancePolicies/Item/TokenIssuancePolicyRequestBuilder.cs index be1845eb3f9..42a7c0019e2 100644 --- a/src/generated/Policies/TokenIssuancePolicies/Item/TokenIssuancePolicyRequestBuilder.cs +++ b/src/generated/Policies/TokenIssuancePolicies/Item/TokenIssuancePolicyRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The policy that specifies the characteristics of SAML tokens issued by Azure AD."; // Create options for all the parameters - command.AddOption(new Option("--tokenissuancepolicy-id", description: "key: id of tokenIssuancePolicy")); + var tokenIssuancePolicyIdOption = new Option("--tokenissuancepolicy-id", description: "key: id of tokenIssuancePolicy"); + tokenIssuancePolicyIdOption.IsRequired = true; + command.AddOption(tokenIssuancePolicyIdOption); command.Handler = CommandHandler.Create(async (tokenIssuancePolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(tokenIssuancePolicyId)) requestInfo.PathParameters.Add("tokenIssuancePolicy_id", tokenIssuancePolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The policy that specifies the characteristics of SAML tokens issued by Azure AD."; // Create options for all the parameters - command.AddOption(new Option("--tokenissuancepolicy-id", description: "key: id of tokenIssuancePolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (tokenIssuancePolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(tokenIssuancePolicyId)) requestInfo.PathParameters.Add("tokenIssuancePolicy_id", tokenIssuancePolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var tokenIssuancePolicyIdOption = new Option("--tokenissuancepolicy-id", description: "key: id of tokenIssuancePolicy"); + tokenIssuancePolicyIdOption.IsRequired = true; + command.AddOption(tokenIssuancePolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (tokenIssuancePolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The policy that specifies the characteristics of SAML tokens issued by Azure AD."; // Create options for all the parameters - command.AddOption(new Option("--tokenissuancepolicy-id", description: "key: id of tokenIssuancePolicy")); - command.AddOption(new Option("--body")); + var tokenIssuancePolicyIdOption = new Option("--tokenissuancepolicy-id", description: "key: id of tokenIssuancePolicy"); + tokenIssuancePolicyIdOption.IsRequired = true; + command.AddOption(tokenIssuancePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (tokenIssuancePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(tokenIssuancePolicyId)) requestInfo.PathParameters.Add("tokenIssuancePolicy_id", tokenIssuancePolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/TokenIssuancePolicies/TokenIssuancePoliciesRequestBuilder.cs b/src/generated/Policies/TokenIssuancePolicies/TokenIssuancePoliciesRequestBuilder.cs index ceb00647852..ab614499e4f 100644 --- a/src/generated/Policies/TokenIssuancePolicies/TokenIssuancePoliciesRequestBuilder.cs +++ b/src/generated/Policies/TokenIssuancePolicies/TokenIssuancePoliciesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The policy that specifies the characteristics of SAML tokens issued by Azure AD."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The policy that specifies the characteristics of SAML tokens issued by Azure AD."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Policies/TokenLifetimePolicies/Item/TokenLifetimePolicyRequestBuilder.cs b/src/generated/Policies/TokenLifetimePolicies/Item/TokenLifetimePolicyRequestBuilder.cs index a76baacab5a..2651e66e733 100644 --- a/src/generated/Policies/TokenLifetimePolicies/Item/TokenLifetimePolicyRequestBuilder.cs +++ b/src/generated/Policies/TokenLifetimePolicies/Item/TokenLifetimePolicyRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The policy that controls the lifetime of a JWT access token, an ID token, or a SAML 1.1/2.0 token issued by Azure AD."; // Create options for all the parameters - command.AddOption(new Option("--tokenlifetimepolicy-id", description: "key: id of tokenLifetimePolicy")); + var tokenLifetimePolicyIdOption = new Option("--tokenlifetimepolicy-id", description: "key: id of tokenLifetimePolicy"); + tokenLifetimePolicyIdOption.IsRequired = true; + command.AddOption(tokenLifetimePolicyIdOption); command.Handler = CommandHandler.Create(async (tokenLifetimePolicyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(tokenLifetimePolicyId)) requestInfo.PathParameters.Add("tokenLifetimePolicy_id", tokenLifetimePolicyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The policy that controls the lifetime of a JWT access token, an ID token, or a SAML 1.1/2.0 token issued by Azure AD."; // Create options for all the parameters - command.AddOption(new Option("--tokenlifetimepolicy-id", description: "key: id of tokenLifetimePolicy")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (tokenLifetimePolicyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(tokenLifetimePolicyId)) requestInfo.PathParameters.Add("tokenLifetimePolicy_id", tokenLifetimePolicyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var tokenLifetimePolicyIdOption = new Option("--tokenlifetimepolicy-id", description: "key: id of tokenLifetimePolicy"); + tokenLifetimePolicyIdOption.IsRequired = true; + command.AddOption(tokenLifetimePolicyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (tokenLifetimePolicyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The policy that controls the lifetime of a JWT access token, an ID token, or a SAML 1.1/2.0 token issued by Azure AD."; // Create options for all the parameters - command.AddOption(new Option("--tokenlifetimepolicy-id", description: "key: id of tokenLifetimePolicy")); - command.AddOption(new Option("--body")); + var tokenLifetimePolicyIdOption = new Option("--tokenlifetimepolicy-id", description: "key: id of tokenLifetimePolicy"); + tokenLifetimePolicyIdOption.IsRequired = true; + command.AddOption(tokenLifetimePolicyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (tokenLifetimePolicyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(tokenLifetimePolicyId)) requestInfo.PathParameters.Add("tokenLifetimePolicy_id", tokenLifetimePolicyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Policies/TokenLifetimePolicies/TokenLifetimePoliciesRequestBuilder.cs b/src/generated/Policies/TokenLifetimePolicies/TokenLifetimePoliciesRequestBuilder.cs index cefb3a195b1..da0d857593a 100644 --- a/src/generated/Policies/TokenLifetimePolicies/TokenLifetimePoliciesRequestBuilder.cs +++ b/src/generated/Policies/TokenLifetimePolicies/TokenLifetimePoliciesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The policy that controls the lifetime of a JWT access token, an ID token, or a SAML 1.1/2.0 token issued by Azure AD."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The policy that controls the lifetime of a JWT access token, an ID token, or a SAML 1.1/2.0 token issued by Azure AD."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Connectors/ConnectorsRequestBuilder.cs b/src/generated/Print/Connectors/ConnectorsRequestBuilder.cs index b32c6458d04..89cb7373284 100644 --- a/src/generated/Print/Connectors/ConnectorsRequestBuilder.cs +++ b/src/generated/Print/Connectors/ConnectorsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of available print connectors."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of available print connectors."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Connectors/Item/PrintConnectorRequestBuilder.cs b/src/generated/Print/Connectors/Item/PrintConnectorRequestBuilder.cs index 5a5f8fdca68..7a733104bf9 100644 --- a/src/generated/Print/Connectors/Item/PrintConnectorRequestBuilder.cs +++ b/src/generated/Print/Connectors/Item/PrintConnectorRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of available print connectors."; // Create options for all the parameters - command.AddOption(new Option("--printconnector-id", description: "key: id of printConnector")); + var printConnectorIdOption = new Option("--printconnector-id", description: "key: id of printConnector"); + printConnectorIdOption.IsRequired = true; + command.AddOption(printConnectorIdOption); command.Handler = CommandHandler.Create(async (printConnectorId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printConnectorId)) requestInfo.PathParameters.Add("printConnector_id", printConnectorId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of available print connectors."; // Create options for all the parameters - command.AddOption(new Option("--printconnector-id", description: "key: id of printConnector")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printConnectorId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printConnectorId)) requestInfo.PathParameters.Add("printConnector_id", printConnectorId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printConnectorIdOption = new Option("--printconnector-id", description: "key: id of printConnector"); + printConnectorIdOption.IsRequired = true; + command.AddOption(printConnectorIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printConnectorId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of available print connectors."; // Create options for all the parameters - command.AddOption(new Option("--printconnector-id", description: "key: id of printConnector")); - command.AddOption(new Option("--body")); + var printConnectorIdOption = new Option("--printconnector-id", description: "key: id of printConnector"); + printConnectorIdOption.IsRequired = true; + command.AddOption(printConnectorIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printConnectorId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(printConnectorId)) requestInfo.PathParameters.Add("printConnector_id", printConnectorId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/Operations/Item/PrintOperationRequestBuilder.cs b/src/generated/Print/Operations/Item/PrintOperationRequestBuilder.cs index 2ab8ca00ff6..870cf2b12c2 100644 --- a/src/generated/Print/Operations/Item/PrintOperationRequestBuilder.cs +++ b/src/generated/Print/Operations/Item/PrintOperationRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of print long running operations."; // Create options for all the parameters - command.AddOption(new Option("--printoperation-id", description: "key: id of printOperation")); + var printOperationIdOption = new Option("--printoperation-id", description: "key: id of printOperation"); + printOperationIdOption.IsRequired = true; + command.AddOption(printOperationIdOption); command.Handler = CommandHandler.Create(async (printOperationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printOperationId)) requestInfo.PathParameters.Add("printOperation_id", printOperationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of print long running operations."; // Create options for all the parameters - command.AddOption(new Option("--printoperation-id", description: "key: id of printOperation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printOperationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printOperationId)) requestInfo.PathParameters.Add("printOperation_id", printOperationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printOperationIdOption = new Option("--printoperation-id", description: "key: id of printOperation"); + printOperationIdOption.IsRequired = true; + command.AddOption(printOperationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printOperationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of print long running operations."; // Create options for all the parameters - command.AddOption(new Option("--printoperation-id", description: "key: id of printOperation")); - command.AddOption(new Option("--body")); + var printOperationIdOption = new Option("--printoperation-id", description: "key: id of printOperation"); + printOperationIdOption.IsRequired = true; + command.AddOption(printOperationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printOperationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(printOperationId)) requestInfo.PathParameters.Add("printOperation_id", printOperationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/Operations/OperationsRequestBuilder.cs b/src/generated/Print/Operations/OperationsRequestBuilder.cs index 7c70532b3ee..3f803ba8170 100644 --- a/src/generated/Print/Operations/OperationsRequestBuilder.cs +++ b/src/generated/Print/Operations/OperationsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of print long running operations."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of print long running operations."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/PrintRequestBuilder.cs b/src/generated/Print/PrintRequestBuilder.cs index 5a1bce149ff..c3c8f749d3e 100644 --- a/src/generated/Print/PrintRequestBuilder.cs +++ b/src/generated/Print/PrintRequestBuilder.cs @@ -39,12 +39,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get print"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,12 +77,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update print"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/Printers/Create/CreateRequestBuilder.cs b/src/generated/Print/Printers/Create/CreateRequestBuilder.cs index 7c5fc79b22c..aeb3eaf977e 100644 --- a/src/generated/Print/Printers/Create/CreateRequestBuilder.cs +++ b/src/generated/Print/Printers/Create/CreateRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action create"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/Printers/Item/Connectors/@Ref/RefRequestBuilder.cs b/src/generated/Print/Printers/Item/Connectors/@Ref/RefRequestBuilder.cs index 74b1930b31b..f0a5af66dc0 100644 --- a/src/generated/Print/Printers/Item/Connectors/@Ref/RefRequestBuilder.cs +++ b/src/generated/Print/Printers/Item/Connectors/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The connectors that are associated with the printer."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (printerId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (printerId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The connectors that are associated with the printer."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--body")); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printerId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Printers/Item/Connectors/ConnectorsRequestBuilder.cs b/src/generated/Print/Printers/Item/Connectors/ConnectorsRequestBuilder.cs index 6fb07e6f77d..8c59e026f18 100644 --- a/src/generated/Print/Printers/Item/Connectors/ConnectorsRequestBuilder.cs +++ b/src/generated/Print/Printers/Item/Connectors/ConnectorsRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The connectors that are associated with the printer."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printerId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printerId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Printers/Item/PrinterRequestBuilder.cs b/src/generated/Print/Printers/Item/PrinterRequestBuilder.cs index 6a2de2e2eeb..52d270e0ef0 100644 --- a/src/generated/Print/Printers/Item/PrinterRequestBuilder.cs +++ b/src/generated/Print/Printers/Item/PrinterRequestBuilder.cs @@ -37,10 +37,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of printers registered in the tenant."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); command.Handler = CommandHandler.Create(async (printerId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,14 +56,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of printers registered in the tenant."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printerId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printerId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,14 +90,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of printers registered in the tenant."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--body")); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printerId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/Printers/Item/RestoreFactoryDefaults/RestoreFactoryDefaultsRequestBuilder.cs b/src/generated/Print/Printers/Item/RestoreFactoryDefaults/RestoreFactoryDefaultsRequestBuilder.cs index 9acd3cbd3d9..ee82562995b 100644 --- a/src/generated/Print/Printers/Item/RestoreFactoryDefaults/RestoreFactoryDefaultsRequestBuilder.cs +++ b/src/generated/Print/Printers/Item/RestoreFactoryDefaults/RestoreFactoryDefaultsRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restoreFactoryDefaults"; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); command.Handler = CommandHandler.Create(async (printerId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/Printers/Item/Shares/@Ref/RefRequestBuilder.cs b/src/generated/Print/Printers/Item/Shares/@Ref/RefRequestBuilder.cs index e38b04ccf83..8be8bdb099f 100644 --- a/src/generated/Print/Printers/Item/Shares/@Ref/RefRequestBuilder.cs +++ b/src/generated/Print/Printers/Item/Shares/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of printerShares that are associated with the printer. Currently, only one printerShare can be associated with the printer. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (printerId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (printerId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The list of printerShares that are associated with the printer. Currently, only one printerShare can be associated with the printer. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--body")); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printerId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Printers/Item/Shares/SharesRequestBuilder.cs b/src/generated/Print/Printers/Item/Shares/SharesRequestBuilder.cs index fba1c377a43..e57211f4788 100644 --- a/src/generated/Print/Printers/Item/Shares/SharesRequestBuilder.cs +++ b/src/generated/Print/Printers/Item/Shares/SharesRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of printerShares that are associated with the printer. Currently, only one printerShare can be associated with the printer. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printerId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printerId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Printers/Item/TaskTriggers/Item/Definition/@Ref/RefRequestBuilder.cs b/src/generated/Print/Printers/Item/TaskTriggers/Item/Definition/@Ref/RefRequestBuilder.cs index d94f8ba9386..4c390af2d5b 100644 --- a/src/generated/Print/Printers/Item/TaskTriggers/Item/Definition/@Ref/RefRequestBuilder.cs +++ b/src/generated/Print/Printers/Item/TaskTriggers/Item/Definition/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "An abstract definition that will be used to create a printTask when triggered by a print event. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--printtasktrigger-id", description: "key: id of printTaskTrigger")); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var printTaskTriggerIdOption = new Option("--printtasktrigger-id", description: "key: id of printTaskTrigger"); + printTaskTriggerIdOption.IsRequired = true; + command.AddOption(printTaskTriggerIdOption); command.Handler = CommandHandler.Create(async (printerId, printTaskTriggerId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); - if (!String.IsNullOrEmpty(printTaskTriggerId)) requestInfo.PathParameters.Add("printTaskTrigger_id", printTaskTriggerId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "An abstract definition that will be used to create a printTask when triggered by a print event. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--printtasktrigger-id", description: "key: id of printTaskTrigger")); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var printTaskTriggerIdOption = new Option("--printtasktrigger-id", description: "key: id of printTaskTrigger"); + printTaskTriggerIdOption.IsRequired = true; + command.AddOption(printTaskTriggerIdOption); command.Handler = CommandHandler.Create(async (printerId, printTaskTriggerId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); - if (!String.IsNullOrEmpty(printTaskTriggerId)) requestInfo.PathParameters.Add("printTaskTrigger_id", printTaskTriggerId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "An abstract definition that will be used to create a printTask when triggered by a print event. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--printtasktrigger-id", description: "key: id of printTaskTrigger")); - command.AddOption(new Option("--body")); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var printTaskTriggerIdOption = new Option("--printtasktrigger-id", description: "key: id of printTaskTrigger"); + printTaskTriggerIdOption.IsRequired = true; + command.AddOption(printTaskTriggerIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printerId, printTaskTriggerId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); - if (!String.IsNullOrEmpty(printTaskTriggerId)) requestInfo.PathParameters.Add("printTaskTrigger_id", printTaskTriggerId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/Printers/Item/TaskTriggers/Item/Definition/DefinitionRequestBuilder.cs b/src/generated/Print/Printers/Item/TaskTriggers/Item/Definition/DefinitionRequestBuilder.cs index b1eeb1ed2cb..bff9d0c1a9e 100644 --- a/src/generated/Print/Printers/Item/TaskTriggers/Item/Definition/DefinitionRequestBuilder.cs +++ b/src/generated/Print/Printers/Item/TaskTriggers/Item/Definition/DefinitionRequestBuilder.cs @@ -27,16 +27,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "An abstract definition that will be used to create a printTask when triggered by a print event. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--printtasktrigger-id", description: "key: id of printTaskTrigger")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printerId, printTaskTriggerId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); - if (!String.IsNullOrEmpty(printTaskTriggerId)) requestInfo.PathParameters.Add("printTaskTrigger_id", printTaskTriggerId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var printTaskTriggerIdOption = new Option("--printtasktrigger-id", description: "key: id of printTaskTrigger"); + printTaskTriggerIdOption.IsRequired = true; + command.AddOption(printTaskTriggerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printerId, printTaskTriggerId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Printers/Item/TaskTriggers/Item/PrintTaskTriggerRequestBuilder.cs b/src/generated/Print/Printers/Item/TaskTriggers/Item/PrintTaskTriggerRequestBuilder.cs index 05d0ab6e15f..dbd5e265dc0 100644 --- a/src/generated/Print/Printers/Item/TaskTriggers/Item/PrintTaskTriggerRequestBuilder.cs +++ b/src/generated/Print/Printers/Item/TaskTriggers/Item/PrintTaskTriggerRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A list of task triggers that are associated with the printer."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--printtasktrigger-id", description: "key: id of printTaskTrigger")); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var printTaskTriggerIdOption = new Option("--printtasktrigger-id", description: "key: id of printTaskTrigger"); + printTaskTriggerIdOption.IsRequired = true; + command.AddOption(printTaskTriggerIdOption); command.Handler = CommandHandler.Create(async (printerId, printTaskTriggerId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); - if (!String.IsNullOrEmpty(printTaskTriggerId)) requestInfo.PathParameters.Add("printTaskTrigger_id", printTaskTriggerId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A list of task triggers that are associated with the printer."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--printtasktrigger-id", description: "key: id of printTaskTrigger")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printerId, printTaskTriggerId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); - if (!String.IsNullOrEmpty(printTaskTriggerId)) requestInfo.PathParameters.Add("printTaskTrigger_id", printTaskTriggerId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var printTaskTriggerIdOption = new Option("--printtasktrigger-id", description: "key: id of printTaskTrigger"); + printTaskTriggerIdOption.IsRequired = true; + command.AddOption(printTaskTriggerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printerId, printTaskTriggerId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A list of task triggers that are associated with the printer."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--printtasktrigger-id", description: "key: id of printTaskTrigger")); - command.AddOption(new Option("--body")); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var printTaskTriggerIdOption = new Option("--printtasktrigger-id", description: "key: id of printTaskTrigger"); + printTaskTriggerIdOption.IsRequired = true; + command.AddOption(printTaskTriggerIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printerId, printTaskTriggerId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); - if (!String.IsNullOrEmpty(printTaskTriggerId)) requestInfo.PathParameters.Add("printTaskTrigger_id", printTaskTriggerId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/Printers/Item/TaskTriggers/TaskTriggersRequestBuilder.cs b/src/generated/Print/Printers/Item/TaskTriggers/TaskTriggersRequestBuilder.cs index 0955ca617f8..0b4cb3e6f23 100644 --- a/src/generated/Print/Printers/Item/TaskTriggers/TaskTriggersRequestBuilder.cs +++ b/src/generated/Print/Printers/Item/TaskTriggers/TaskTriggersRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A list of task triggers that are associated with the printer."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--body")); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printerId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A list of task triggers that are associated with the printer."; // Create options for all the parameters - command.AddOption(new Option("--printer-id", description: "key: id of printer")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printerId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printer_id", printerId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printerIdOption = new Option("--printer-id", description: "key: id of printer"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printerId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Printers/PrintersRequestBuilder.cs b/src/generated/Print/Printers/PrintersRequestBuilder.cs index f1de495814a..a33fa3866dd 100644 --- a/src/generated/Print/Printers/PrintersRequestBuilder.cs +++ b/src/generated/Print/Printers/PrintersRequestBuilder.cs @@ -47,24 +47,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of printers registered in the tenant."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Services/Item/Endpoints/EndpointsRequestBuilder.cs b/src/generated/Print/Services/Item/Endpoints/EndpointsRequestBuilder.cs index 0912aaa953f..54109badd43 100644 --- a/src/generated/Print/Services/Item/Endpoints/EndpointsRequestBuilder.cs +++ b/src/generated/Print/Services/Item/Endpoints/EndpointsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Endpoints that can be used to access the service. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--printservice-id", description: "key: id of printService")); - command.AddOption(new Option("--body")); + var printServiceIdOption = new Option("--printservice-id", description: "key: id of printService"); + printServiceIdOption.IsRequired = true; + command.AddOption(printServiceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printServiceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(printServiceId)) requestInfo.PathParameters.Add("printService_id", printServiceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Endpoints that can be used to access the service. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--printservice-id", description: "key: id of printService")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printServiceId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printServiceId)) requestInfo.PathParameters.Add("printService_id", printServiceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printServiceIdOption = new Option("--printservice-id", description: "key: id of printService"); + printServiceIdOption.IsRequired = true; + command.AddOption(printServiceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printServiceId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Services/Item/Endpoints/Item/PrintServiceEndpointRequestBuilder.cs b/src/generated/Print/Services/Item/Endpoints/Item/PrintServiceEndpointRequestBuilder.cs index f497fa10aef..5753706a3fb 100644 --- a/src/generated/Print/Services/Item/Endpoints/Item/PrintServiceEndpointRequestBuilder.cs +++ b/src/generated/Print/Services/Item/Endpoints/Item/PrintServiceEndpointRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Endpoints that can be used to access the service. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--printservice-id", description: "key: id of printService")); - command.AddOption(new Option("--printserviceendpoint-id", description: "key: id of printServiceEndpoint")); + var printServiceIdOption = new Option("--printservice-id", description: "key: id of printService"); + printServiceIdOption.IsRequired = true; + command.AddOption(printServiceIdOption); + var printServiceEndpointIdOption = new Option("--printserviceendpoint-id", description: "key: id of printServiceEndpoint"); + printServiceEndpointIdOption.IsRequired = true; + command.AddOption(printServiceEndpointIdOption); command.Handler = CommandHandler.Create(async (printServiceId, printServiceEndpointId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printServiceId)) requestInfo.PathParameters.Add("printService_id", printServiceId); - if (!String.IsNullOrEmpty(printServiceEndpointId)) requestInfo.PathParameters.Add("printServiceEndpoint_id", printServiceEndpointId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Endpoints that can be used to access the service. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--printservice-id", description: "key: id of printService")); - command.AddOption(new Option("--printserviceendpoint-id", description: "key: id of printServiceEndpoint")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printServiceId, printServiceEndpointId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printServiceId)) requestInfo.PathParameters.Add("printService_id", printServiceId); - if (!String.IsNullOrEmpty(printServiceEndpointId)) requestInfo.PathParameters.Add("printServiceEndpoint_id", printServiceEndpointId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printServiceIdOption = new Option("--printservice-id", description: "key: id of printService"); + printServiceIdOption.IsRequired = true; + command.AddOption(printServiceIdOption); + var printServiceEndpointIdOption = new Option("--printserviceendpoint-id", description: "key: id of printServiceEndpoint"); + printServiceEndpointIdOption.IsRequired = true; + command.AddOption(printServiceEndpointIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printServiceId, printServiceEndpointId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Endpoints that can be used to access the service. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--printservice-id", description: "key: id of printService")); - command.AddOption(new Option("--printserviceendpoint-id", description: "key: id of printServiceEndpoint")); - command.AddOption(new Option("--body")); + var printServiceIdOption = new Option("--printservice-id", description: "key: id of printService"); + printServiceIdOption.IsRequired = true; + command.AddOption(printServiceIdOption); + var printServiceEndpointIdOption = new Option("--printserviceendpoint-id", description: "key: id of printServiceEndpoint"); + printServiceEndpointIdOption.IsRequired = true; + command.AddOption(printServiceEndpointIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printServiceId, printServiceEndpointId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(printServiceId)) requestInfo.PathParameters.Add("printService_id", printServiceId); - if (!String.IsNullOrEmpty(printServiceEndpointId)) requestInfo.PathParameters.Add("printServiceEndpoint_id", printServiceEndpointId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/Services/Item/PrintServiceRequestBuilder.cs b/src/generated/Print/Services/Item/PrintServiceRequestBuilder.cs index dc2bcdc801d..5ba8b90a7cf 100644 --- a/src/generated/Print/Services/Item/PrintServiceRequestBuilder.cs +++ b/src/generated/Print/Services/Item/PrintServiceRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of available Universal Print service endpoints."; // Create options for all the parameters - command.AddOption(new Option("--printservice-id", description: "key: id of printService")); + var printServiceIdOption = new Option("--printservice-id", description: "key: id of printService"); + printServiceIdOption.IsRequired = true; + command.AddOption(printServiceIdOption); command.Handler = CommandHandler.Create(async (printServiceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printServiceId)) requestInfo.PathParameters.Add("printService_id", printServiceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of available Universal Print service endpoints."; // Create options for all the parameters - command.AddOption(new Option("--printservice-id", description: "key: id of printService")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printServiceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printServiceId)) requestInfo.PathParameters.Add("printService_id", printServiceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printServiceIdOption = new Option("--printservice-id", description: "key: id of printService"); + printServiceIdOption.IsRequired = true; + command.AddOption(printServiceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printServiceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of available Universal Print service endpoints."; // Create options for all the parameters - command.AddOption(new Option("--printservice-id", description: "key: id of printService")); - command.AddOption(new Option("--body")); + var printServiceIdOption = new Option("--printservice-id", description: "key: id of printService"); + printServiceIdOption.IsRequired = true; + command.AddOption(printServiceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printServiceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(printServiceId)) requestInfo.PathParameters.Add("printService_id", printServiceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/Services/ServicesRequestBuilder.cs b/src/generated/Print/Services/ServicesRequestBuilder.cs index 2bb7a0eb4e5..0fcdab993e9 100644 --- a/src/generated/Print/Services/ServicesRequestBuilder.cs +++ b/src/generated/Print/Services/ServicesRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of available Universal Print service endpoints."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of available Universal Print service endpoints."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Shares/Item/AllowedGroups/@Ref/RefRequestBuilder.cs b/src/generated/Print/Shares/Item/AllowedGroups/@Ref/RefRequestBuilder.cs index be3da67cb6a..c5d438d7fb0 100644 --- a/src/generated/Print/Shares/Item/AllowedGroups/@Ref/RefRequestBuilder.cs +++ b/src/generated/Print/Shares/Item/AllowedGroups/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The groups whose users have access to print using the printer."; // Create options for all the parameters - command.AddOption(new Option("--printershare-id", description: "key: id of printerShare")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (printerShareId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerShareId)) requestInfo.PathParameters.Add("printerShare_id", printerShareId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var printerShareIdOption = new Option("--printershare-id", description: "key: id of printerShare"); + printerShareIdOption.IsRequired = true; + command.AddOption(printerShareIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (printerShareId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The groups whose users have access to print using the printer."; // Create options for all the parameters - command.AddOption(new Option("--printershare-id", description: "key: id of printerShare")); - command.AddOption(new Option("--body")); + var printerShareIdOption = new Option("--printershare-id", description: "key: id of printerShare"); + printerShareIdOption.IsRequired = true; + command.AddOption(printerShareIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printerShareId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(printerShareId)) requestInfo.PathParameters.Add("printerShare_id", printerShareId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Shares/Item/AllowedGroups/AllowedGroupsRequestBuilder.cs b/src/generated/Print/Shares/Item/AllowedGroups/AllowedGroupsRequestBuilder.cs index bd96ff227ec..4e2968b0dd2 100644 --- a/src/generated/Print/Shares/Item/AllowedGroups/AllowedGroupsRequestBuilder.cs +++ b/src/generated/Print/Shares/Item/AllowedGroups/AllowedGroupsRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The groups whose users have access to print using the printer."; // Create options for all the parameters - command.AddOption(new Option("--printershare-id", description: "key: id of printerShare")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printerShareId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerShareId)) requestInfo.PathParameters.Add("printerShare_id", printerShareId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printerShareIdOption = new Option("--printershare-id", description: "key: id of printerShare"); + printerShareIdOption.IsRequired = true; + command.AddOption(printerShareIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printerShareId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Shares/Item/AllowedUsers/@Ref/RefRequestBuilder.cs b/src/generated/Print/Shares/Item/AllowedUsers/@Ref/RefRequestBuilder.cs index 9e00e01c7bb..8de24715a31 100644 --- a/src/generated/Print/Shares/Item/AllowedUsers/@Ref/RefRequestBuilder.cs +++ b/src/generated/Print/Shares/Item/AllowedUsers/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The users who have access to print using the printer."; // Create options for all the parameters - command.AddOption(new Option("--printershare-id", description: "key: id of printerShare")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (printerShareId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerShareId)) requestInfo.PathParameters.Add("printerShare_id", printerShareId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var printerShareIdOption = new Option("--printershare-id", description: "key: id of printerShare"); + printerShareIdOption.IsRequired = true; + command.AddOption(printerShareIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (printerShareId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The users who have access to print using the printer."; // Create options for all the parameters - command.AddOption(new Option("--printershare-id", description: "key: id of printerShare")); - command.AddOption(new Option("--body")); + var printerShareIdOption = new Option("--printershare-id", description: "key: id of printerShare"); + printerShareIdOption.IsRequired = true; + command.AddOption(printerShareIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printerShareId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(printerShareId)) requestInfo.PathParameters.Add("printerShare_id", printerShareId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Shares/Item/AllowedUsers/AllowedUsersRequestBuilder.cs b/src/generated/Print/Shares/Item/AllowedUsers/AllowedUsersRequestBuilder.cs index e1346363cf0..ad9cf9a786b 100644 --- a/src/generated/Print/Shares/Item/AllowedUsers/AllowedUsersRequestBuilder.cs +++ b/src/generated/Print/Shares/Item/AllowedUsers/AllowedUsersRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The users who have access to print using the printer."; // Create options for all the parameters - command.AddOption(new Option("--printershare-id", description: "key: id of printerShare")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printerShareId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerShareId)) requestInfo.PathParameters.Add("printerShare_id", printerShareId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printerShareIdOption = new Option("--printershare-id", description: "key: id of printerShare"); + printerShareIdOption.IsRequired = true; + command.AddOption(printerShareIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printerShareId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Shares/Item/Printer/@Ref/RefRequestBuilder.cs b/src/generated/Print/Shares/Item/Printer/@Ref/RefRequestBuilder.cs index 0b76d3d0edd..c37ac3741f0 100644 --- a/src/generated/Print/Shares/Item/Printer/@Ref/RefRequestBuilder.cs +++ b/src/generated/Print/Shares/Item/Printer/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The printer that this printer share is related to."; // Create options for all the parameters - command.AddOption(new Option("--printershare-id", description: "key: id of printerShare")); + var printerShareIdOption = new Option("--printershare-id", description: "key: id of printerShare"); + printerShareIdOption.IsRequired = true; + command.AddOption(printerShareIdOption); command.Handler = CommandHandler.Create(async (printerShareId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printerShareId)) requestInfo.PathParameters.Add("printerShare_id", printerShareId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The printer that this printer share is related to."; // Create options for all the parameters - command.AddOption(new Option("--printershare-id", description: "key: id of printerShare")); + var printerShareIdOption = new Option("--printershare-id", description: "key: id of printerShare"); + printerShareIdOption.IsRequired = true; + command.AddOption(printerShareIdOption); command.Handler = CommandHandler.Create(async (printerShareId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerShareId)) requestInfo.PathParameters.Add("printerShare_id", printerShareId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The printer that this printer share is related to."; // Create options for all the parameters - command.AddOption(new Option("--printershare-id", description: "key: id of printerShare")); - command.AddOption(new Option("--body")); + var printerShareIdOption = new Option("--printershare-id", description: "key: id of printerShare"); + printerShareIdOption.IsRequired = true; + command.AddOption(printerShareIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printerShareId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(printerShareId)) requestInfo.PathParameters.Add("printerShare_id", printerShareId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/Shares/Item/Printer/PrinterRequestBuilder.cs b/src/generated/Print/Shares/Item/Printer/PrinterRequestBuilder.cs index e30c09a6244..1f266f39f62 100644 --- a/src/generated/Print/Shares/Item/Printer/PrinterRequestBuilder.cs +++ b/src/generated/Print/Shares/Item/Printer/PrinterRequestBuilder.cs @@ -28,14 +28,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The printer that this printer share is related to."; // Create options for all the parameters - command.AddOption(new Option("--printershare-id", description: "key: id of printerShare")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printerShareId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerShareId)) requestInfo.PathParameters.Add("printerShare_id", printerShareId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printerShareIdOption = new Option("--printershare-id", description: "key: id of printerShare"); + printerShareIdOption.IsRequired = true; + command.AddOption(printerShareIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printerShareId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/Shares/Item/Printer/RestoreFactoryDefaults/RestoreFactoryDefaultsRequestBuilder.cs b/src/generated/Print/Shares/Item/Printer/RestoreFactoryDefaults/RestoreFactoryDefaultsRequestBuilder.cs index 6500b07668a..7a3634df23b 100644 --- a/src/generated/Print/Shares/Item/Printer/RestoreFactoryDefaults/RestoreFactoryDefaultsRequestBuilder.cs +++ b/src/generated/Print/Shares/Item/Printer/RestoreFactoryDefaults/RestoreFactoryDefaultsRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restoreFactoryDefaults"; // Create options for all the parameters - command.AddOption(new Option("--printershare-id", description: "key: id of printerShare")); + var printerShareIdOption = new Option("--printershare-id", description: "key: id of printerShare"); + printerShareIdOption.IsRequired = true; + command.AddOption(printerShareIdOption); command.Handler = CommandHandler.Create(async (printerShareId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(printerShareId)) requestInfo.PathParameters.Add("printerShare_id", printerShareId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/Shares/Item/PrinterShareRequestBuilder.cs b/src/generated/Print/Shares/Item/PrinterShareRequestBuilder.cs index a1898dcdbb0..6f489c18a9e 100644 --- a/src/generated/Print/Shares/Item/PrinterShareRequestBuilder.cs +++ b/src/generated/Print/Shares/Item/PrinterShareRequestBuilder.cs @@ -43,10 +43,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of printer shares registered in the tenant."; // Create options for all the parameters - command.AddOption(new Option("--printershare-id", description: "key: id of printerShare")); + var printerShareIdOption = new Option("--printershare-id", description: "key: id of printerShare"); + printerShareIdOption.IsRequired = true; + command.AddOption(printerShareIdOption); command.Handler = CommandHandler.Create(async (printerShareId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printerShareId)) requestInfo.PathParameters.Add("printerShare_id", printerShareId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -60,14 +62,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of printer shares registered in the tenant."; // Create options for all the parameters - command.AddOption(new Option("--printershare-id", description: "key: id of printerShare")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printerShareId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerShareId)) requestInfo.PathParameters.Add("printerShare_id", printerShareId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printerShareIdOption = new Option("--printershare-id", description: "key: id of printerShare"); + printerShareIdOption.IsRequired = true; + command.AddOption(printerShareIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printerShareId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,14 +96,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of printer shares registered in the tenant."; // Create options for all the parameters - command.AddOption(new Option("--printershare-id", description: "key: id of printerShare")); - command.AddOption(new Option("--body")); + var printerShareIdOption = new Option("--printershare-id", description: "key: id of printerShare"); + printerShareIdOption.IsRequired = true; + command.AddOption(printerShareIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printerShareId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(printerShareId)) requestInfo.PathParameters.Add("printerShare_id", printerShareId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/Shares/SharesRequestBuilder.cs b/src/generated/Print/Shares/SharesRequestBuilder.cs index 51695404f10..4df454a763d 100644 --- a/src/generated/Print/Shares/SharesRequestBuilder.cs +++ b/src/generated/Print/Shares/SharesRequestBuilder.cs @@ -39,12 +39,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of printer shares registered in the tenant."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,24 +66,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of printer shares registered in the tenant."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/TaskDefinitions/Item/PrintTaskDefinitionRequestBuilder.cs b/src/generated/Print/TaskDefinitions/Item/PrintTaskDefinitionRequestBuilder.cs index 6c49e863369..80e49bc7f23 100644 --- a/src/generated/Print/TaskDefinitions/Item/PrintTaskDefinitionRequestBuilder.cs +++ b/src/generated/Print/TaskDefinitions/Item/PrintTaskDefinitionRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "List of abstract definition for a task that can be triggered when various events occur within Universal Print."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); command.Handler = CommandHandler.Create(async (printTaskDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "List of abstract definition for a task that can be triggered when various events occur within Universal Print."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printTaskDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printTaskDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,14 +80,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "List of abstract definition for a task that can be triggered when various events occur within Universal Print."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--body")); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printTaskDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Definition/@Ref/RefRequestBuilder.cs b/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Definition/@Ref/RefRequestBuilder.cs index bbf4455e990..8e3e72c7443 100644 --- a/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Definition/@Ref/RefRequestBuilder.cs +++ b/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Definition/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The printTaskDefinition that was used to create this task. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--printtask-id", description: "key: id of printTask")); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var printTaskIdOption = new Option("--printtask-id", description: "key: id of printTask"); + printTaskIdOption.IsRequired = true; + command.AddOption(printTaskIdOption); command.Handler = CommandHandler.Create(async (printTaskDefinitionId, printTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); - if (!String.IsNullOrEmpty(printTaskId)) requestInfo.PathParameters.Add("printTask_id", printTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The printTaskDefinition that was used to create this task. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--printtask-id", description: "key: id of printTask")); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var printTaskIdOption = new Option("--printtask-id", description: "key: id of printTask"); + printTaskIdOption.IsRequired = true; + command.AddOption(printTaskIdOption); command.Handler = CommandHandler.Create(async (printTaskDefinitionId, printTaskId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); - if (!String.IsNullOrEmpty(printTaskId)) requestInfo.PathParameters.Add("printTask_id", printTaskId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The printTaskDefinition that was used to create this task. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--printtask-id", description: "key: id of printTask")); - command.AddOption(new Option("--body")); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var printTaskIdOption = new Option("--printtask-id", description: "key: id of printTask"); + printTaskIdOption.IsRequired = true; + command.AddOption(printTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printTaskDefinitionId, printTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); - if (!String.IsNullOrEmpty(printTaskId)) requestInfo.PathParameters.Add("printTask_id", printTaskId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Definition/DefinitionRequestBuilder.cs b/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Definition/DefinitionRequestBuilder.cs index 058bb1f08e7..137f0c243c9 100644 --- a/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Definition/DefinitionRequestBuilder.cs +++ b/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Definition/DefinitionRequestBuilder.cs @@ -27,16 +27,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The printTaskDefinition that was used to create this task. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--printtask-id", description: "key: id of printTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printTaskDefinitionId, printTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); - if (!String.IsNullOrEmpty(printTaskId)) requestInfo.PathParameters.Add("printTask_id", printTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var printTaskIdOption = new Option("--printtask-id", description: "key: id of printTask"); + printTaskIdOption.IsRequired = true; + command.AddOption(printTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printTaskDefinitionId, printTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/TaskDefinitions/Item/Tasks/Item/PrintTaskRequestBuilder.cs b/src/generated/Print/TaskDefinitions/Item/Tasks/Item/PrintTaskRequestBuilder.cs index ef4bc2ed221..2ebb50e6b23 100644 --- a/src/generated/Print/TaskDefinitions/Item/Tasks/Item/PrintTaskRequestBuilder.cs +++ b/src/generated/Print/TaskDefinitions/Item/Tasks/Item/PrintTaskRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A list of tasks that have been created based on this definition. The list includes currently running tasks and recently completed tasks. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--printtask-id", description: "key: id of printTask")); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var printTaskIdOption = new Option("--printtask-id", description: "key: id of printTask"); + printTaskIdOption.IsRequired = true; + command.AddOption(printTaskIdOption); command.Handler = CommandHandler.Create(async (printTaskDefinitionId, printTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); - if (!String.IsNullOrEmpty(printTaskId)) requestInfo.PathParameters.Add("printTask_id", printTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A list of tasks that have been created based on this definition. The list includes currently running tasks and recently completed tasks. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--printtask-id", description: "key: id of printTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printTaskDefinitionId, printTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); - if (!String.IsNullOrEmpty(printTaskId)) requestInfo.PathParameters.Add("printTask_id", printTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var printTaskIdOption = new Option("--printtask-id", description: "key: id of printTask"); + printTaskIdOption.IsRequired = true; + command.AddOption(printTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printTaskDefinitionId, printTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A list of tasks that have been created based on this definition. The list includes currently running tasks and recently completed tasks. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--printtask-id", description: "key: id of printTask")); - command.AddOption(new Option("--body")); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var printTaskIdOption = new Option("--printtask-id", description: "key: id of printTask"); + printTaskIdOption.IsRequired = true; + command.AddOption(printTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printTaskDefinitionId, printTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); - if (!String.IsNullOrEmpty(printTaskId)) requestInfo.PathParameters.Add("printTask_id", printTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Trigger/@Ref/RefRequestBuilder.cs b/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Trigger/@Ref/RefRequestBuilder.cs index 2bbbf0a50fb..3e845b6508b 100644 --- a/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Trigger/@Ref/RefRequestBuilder.cs +++ b/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Trigger/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The printTaskTrigger that triggered this task's execution. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--printtask-id", description: "key: id of printTask")); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var printTaskIdOption = new Option("--printtask-id", description: "key: id of printTask"); + printTaskIdOption.IsRequired = true; + command.AddOption(printTaskIdOption); command.Handler = CommandHandler.Create(async (printTaskDefinitionId, printTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); - if (!String.IsNullOrEmpty(printTaskId)) requestInfo.PathParameters.Add("printTask_id", printTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The printTaskTrigger that triggered this task's execution. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--printtask-id", description: "key: id of printTask")); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var printTaskIdOption = new Option("--printtask-id", description: "key: id of printTask"); + printTaskIdOption.IsRequired = true; + command.AddOption(printTaskIdOption); command.Handler = CommandHandler.Create(async (printTaskDefinitionId, printTaskId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); - if (!String.IsNullOrEmpty(printTaskId)) requestInfo.PathParameters.Add("printTask_id", printTaskId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The printTaskTrigger that triggered this task's execution. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--printtask-id", description: "key: id of printTask")); - command.AddOption(new Option("--body")); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var printTaskIdOption = new Option("--printtask-id", description: "key: id of printTask"); + printTaskIdOption.IsRequired = true; + command.AddOption(printTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printTaskDefinitionId, printTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); - if (!String.IsNullOrEmpty(printTaskId)) requestInfo.PathParameters.Add("printTask_id", printTaskId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Trigger/TriggerRequestBuilder.cs b/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Trigger/TriggerRequestBuilder.cs index de67132b274..1d89a459ebd 100644 --- a/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Trigger/TriggerRequestBuilder.cs +++ b/src/generated/Print/TaskDefinitions/Item/Tasks/Item/Trigger/TriggerRequestBuilder.cs @@ -27,16 +27,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The printTaskTrigger that triggered this task's execution. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--printtask-id", description: "key: id of printTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printTaskDefinitionId, printTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); - if (!String.IsNullOrEmpty(printTaskId)) requestInfo.PathParameters.Add("printTask_id", printTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var printTaskIdOption = new Option("--printtask-id", description: "key: id of printTask"); + printTaskIdOption.IsRequired = true; + command.AddOption(printTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printTaskDefinitionId, printTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/TaskDefinitions/Item/Tasks/TasksRequestBuilder.cs b/src/generated/Print/TaskDefinitions/Item/Tasks/TasksRequestBuilder.cs index f91a89b9320..3399077bbf2 100644 --- a/src/generated/Print/TaskDefinitions/Item/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Print/TaskDefinitions/Item/Tasks/TasksRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A list of tasks that have been created based on this definition. The list includes currently running tasks and recently completed tasks. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--body")); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printTaskDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +68,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A list of tasks that have been created based on this definition. The list includes currently running tasks and recently completed tasks. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printTaskDefinitionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printTaskDefinitionId)) requestInfo.PathParameters.Add("printTaskDefinition_id", printTaskDefinitionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printTaskDefinitionIdOption = new Option("--printtaskdefinition-id", description: "key: id of printTaskDefinition"); + printTaskDefinitionIdOption.IsRequired = true; + command.AddOption(printTaskDefinitionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printTaskDefinitionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Print/TaskDefinitions/TaskDefinitionsRequestBuilder.cs b/src/generated/Print/TaskDefinitions/TaskDefinitionsRequestBuilder.cs index 4a6c53007eb..4cc02634662 100644 --- a/src/generated/Print/TaskDefinitions/TaskDefinitionsRequestBuilder.cs +++ b/src/generated/Print/TaskDefinitions/TaskDefinitionsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "List of abstract definition for a task that can be triggered when various events occur within Universal Print."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "List of abstract definition for a task that can be triggered when various events occur within Universal Print."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Privacy/PrivacyRequestBuilder.cs b/src/generated/Privacy/PrivacyRequestBuilder.cs index 65286cccf97..175a8f8403d 100644 --- a/src/generated/Privacy/PrivacyRequestBuilder.cs +++ b/src/generated/Privacy/PrivacyRequestBuilder.cs @@ -27,12 +27,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get privacy"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -51,12 +58,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update privacy"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Privacy/SubjectRightsRequests/Item/GetFinalAttachment/GetFinalAttachmentRequestBuilder.cs b/src/generated/Privacy/SubjectRightsRequests/Item/GetFinalAttachment/GetFinalAttachmentRequestBuilder.cs index bb6710c8e3f..56ff3327272 100644 --- a/src/generated/Privacy/SubjectRightsRequests/Item/GetFinalAttachment/GetFinalAttachmentRequestBuilder.cs +++ b/src/generated/Privacy/SubjectRightsRequests/Item/GetFinalAttachment/GetFinalAttachmentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getFinalAttachment"; // Create options for all the parameters - command.AddOption(new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest")); + var subjectRightsRequestIdOption = new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest"); + subjectRightsRequestIdOption.IsRequired = true; + command.AddOption(subjectRightsRequestIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (subjectRightsRequestId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(subjectRightsRequestId)) requestInfo.PathParameters.Add("subjectRightsRequest_id", subjectRightsRequestId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Privacy/SubjectRightsRequests/Item/GetFinalReport/GetFinalReportRequestBuilder.cs b/src/generated/Privacy/SubjectRightsRequests/Item/GetFinalReport/GetFinalReportRequestBuilder.cs index dadb8432ead..7dd6068fe72 100644 --- a/src/generated/Privacy/SubjectRightsRequests/Item/GetFinalReport/GetFinalReportRequestBuilder.cs +++ b/src/generated/Privacy/SubjectRightsRequests/Item/GetFinalReport/GetFinalReportRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getFinalReport"; // Create options for all the parameters - command.AddOption(new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest")); + var subjectRightsRequestIdOption = new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest"); + subjectRightsRequestIdOption.IsRequired = true; + command.AddOption(subjectRightsRequestIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (subjectRightsRequestId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(subjectRightsRequestId)) requestInfo.PathParameters.Add("subjectRightsRequest_id", subjectRightsRequestId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Privacy/SubjectRightsRequests/Item/Notes/Item/AuthoredNoteRequestBuilder.cs b/src/generated/Privacy/SubjectRightsRequests/Item/Notes/Item/AuthoredNoteRequestBuilder.cs index 46cbf23f715..7a2e062ecb1 100644 --- a/src/generated/Privacy/SubjectRightsRequests/Item/Notes/Item/AuthoredNoteRequestBuilder.cs +++ b/src/generated/Privacy/SubjectRightsRequests/Item/Notes/Item/AuthoredNoteRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "List of notes associcated with the request."; // Create options for all the parameters - command.AddOption(new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest")); - command.AddOption(new Option("--authorednote-id", description: "key: id of authoredNote")); + var subjectRightsRequestIdOption = new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest"); + subjectRightsRequestIdOption.IsRequired = true; + command.AddOption(subjectRightsRequestIdOption); + var authoredNoteIdOption = new Option("--authorednote-id", description: "key: id of authoredNote"); + authoredNoteIdOption.IsRequired = true; + command.AddOption(authoredNoteIdOption); command.Handler = CommandHandler.Create(async (subjectRightsRequestId, authoredNoteId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(subjectRightsRequestId)) requestInfo.PathParameters.Add("subjectRightsRequest_id", subjectRightsRequestId); - if (!String.IsNullOrEmpty(authoredNoteId)) requestInfo.PathParameters.Add("authoredNote_id", authoredNoteId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "List of notes associcated with the request."; // Create options for all the parameters - command.AddOption(new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest")); - command.AddOption(new Option("--authorednote-id", description: "key: id of authoredNote")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (subjectRightsRequestId, authoredNoteId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(subjectRightsRequestId)) requestInfo.PathParameters.Add("subjectRightsRequest_id", subjectRightsRequestId); - if (!String.IsNullOrEmpty(authoredNoteId)) requestInfo.PathParameters.Add("authoredNote_id", authoredNoteId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var subjectRightsRequestIdOption = new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest"); + subjectRightsRequestIdOption.IsRequired = true; + command.AddOption(subjectRightsRequestIdOption); + var authoredNoteIdOption = new Option("--authorednote-id", description: "key: id of authoredNote"); + authoredNoteIdOption.IsRequired = true; + command.AddOption(authoredNoteIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (subjectRightsRequestId, authoredNoteId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "List of notes associcated with the request."; // Create options for all the parameters - command.AddOption(new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest")); - command.AddOption(new Option("--authorednote-id", description: "key: id of authoredNote")); - command.AddOption(new Option("--body")); + var subjectRightsRequestIdOption = new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest"); + subjectRightsRequestIdOption.IsRequired = true; + command.AddOption(subjectRightsRequestIdOption); + var authoredNoteIdOption = new Option("--authorednote-id", description: "key: id of authoredNote"); + authoredNoteIdOption.IsRequired = true; + command.AddOption(authoredNoteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (subjectRightsRequestId, authoredNoteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(subjectRightsRequestId)) requestInfo.PathParameters.Add("subjectRightsRequest_id", subjectRightsRequestId); - if (!String.IsNullOrEmpty(authoredNoteId)) requestInfo.PathParameters.Add("authoredNote_id", authoredNoteId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Privacy/SubjectRightsRequests/Item/Notes/NotesRequestBuilder.cs b/src/generated/Privacy/SubjectRightsRequests/Item/Notes/NotesRequestBuilder.cs index 835d64a7012..27f13ec8d96 100644 --- a/src/generated/Privacy/SubjectRightsRequests/Item/Notes/NotesRequestBuilder.cs +++ b/src/generated/Privacy/SubjectRightsRequests/Item/Notes/NotesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "List of notes associcated with the request."; // Create options for all the parameters - command.AddOption(new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest")); - command.AddOption(new Option("--body")); + var subjectRightsRequestIdOption = new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest"); + subjectRightsRequestIdOption.IsRequired = true; + command.AddOption(subjectRightsRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (subjectRightsRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(subjectRightsRequestId)) requestInfo.PathParameters.Add("subjectRightsRequest_id", subjectRightsRequestId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "List of notes associcated with the request."; // Create options for all the parameters - command.AddOption(new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (subjectRightsRequestId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(subjectRightsRequestId)) requestInfo.PathParameters.Add("subjectRightsRequest_id", subjectRightsRequestId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var subjectRightsRequestIdOption = new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest"); + subjectRightsRequestIdOption.IsRequired = true; + command.AddOption(subjectRightsRequestIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (subjectRightsRequestId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Privacy/SubjectRightsRequests/Item/SubjectRightsRequestRequestBuilder.cs b/src/generated/Privacy/SubjectRightsRequests/Item/SubjectRightsRequestRequestBuilder.cs index 2529b659a1b..2a88a89482d 100644 --- a/src/generated/Privacy/SubjectRightsRequests/Item/SubjectRightsRequestRequestBuilder.cs +++ b/src/generated/Privacy/SubjectRightsRequests/Item/SubjectRightsRequestRequestBuilder.cs @@ -30,10 +30,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property subjectRightsRequests for privacy"; // Create options for all the parameters - command.AddOption(new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest")); + var subjectRightsRequestIdOption = new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest"); + subjectRightsRequestIdOption.IsRequired = true; + command.AddOption(subjectRightsRequestIdOption); command.Handler = CommandHandler.Create(async (subjectRightsRequestId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(subjectRightsRequestId)) requestInfo.PathParameters.Add("subjectRightsRequest_id", subjectRightsRequestId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,14 +49,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get subjectRightsRequests from privacy"; // Create options for all the parameters - command.AddOption(new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (subjectRightsRequestId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(subjectRightsRequestId)) requestInfo.PathParameters.Add("subjectRightsRequest_id", subjectRightsRequestId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var subjectRightsRequestIdOption = new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest"); + subjectRightsRequestIdOption.IsRequired = true; + command.AddOption(subjectRightsRequestIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (subjectRightsRequestId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,14 +90,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property subjectRightsRequests in privacy"; // Create options for all the parameters - command.AddOption(new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest")); - command.AddOption(new Option("--body")); + var subjectRightsRequestIdOption = new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest"); + subjectRightsRequestIdOption.IsRequired = true; + command.AddOption(subjectRightsRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (subjectRightsRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(subjectRightsRequestId)) requestInfo.PathParameters.Add("subjectRightsRequest_id", subjectRightsRequestId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Privacy/SubjectRightsRequests/Item/Team/@Ref/RefRequestBuilder.cs b/src/generated/Privacy/SubjectRightsRequests/Item/Team/@Ref/RefRequestBuilder.cs index b6becbc097e..41410c34bb4 100644 --- a/src/generated/Privacy/SubjectRightsRequests/Item/Team/@Ref/RefRequestBuilder.cs +++ b/src/generated/Privacy/SubjectRightsRequests/Item/Team/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Information about the Microsoft Teams team that was created for the request."; // Create options for all the parameters - command.AddOption(new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest")); + var subjectRightsRequestIdOption = new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest"); + subjectRightsRequestIdOption.IsRequired = true; + command.AddOption(subjectRightsRequestIdOption); command.Handler = CommandHandler.Create(async (subjectRightsRequestId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(subjectRightsRequestId)) requestInfo.PathParameters.Add("subjectRightsRequest_id", subjectRightsRequestId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Information about the Microsoft Teams team that was created for the request."; // Create options for all the parameters - command.AddOption(new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest")); + var subjectRightsRequestIdOption = new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest"); + subjectRightsRequestIdOption.IsRequired = true; + command.AddOption(subjectRightsRequestIdOption); command.Handler = CommandHandler.Create(async (subjectRightsRequestId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(subjectRightsRequestId)) requestInfo.PathParameters.Add("subjectRightsRequest_id", subjectRightsRequestId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Information about the Microsoft Teams team that was created for the request."; // Create options for all the parameters - command.AddOption(new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest")); - command.AddOption(new Option("--body")); + var subjectRightsRequestIdOption = new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest"); + subjectRightsRequestIdOption.IsRequired = true; + command.AddOption(subjectRightsRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (subjectRightsRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(subjectRightsRequestId)) requestInfo.PathParameters.Add("subjectRightsRequest_id", subjectRightsRequestId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Privacy/SubjectRightsRequests/Item/Team/TeamRequestBuilder.cs b/src/generated/Privacy/SubjectRightsRequests/Item/Team/TeamRequestBuilder.cs index 5f8eaf12170..79e2f73927d 100644 --- a/src/generated/Privacy/SubjectRightsRequests/Item/Team/TeamRequestBuilder.cs +++ b/src/generated/Privacy/SubjectRightsRequests/Item/Team/TeamRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Information about the Microsoft Teams team that was created for the request."; // Create options for all the parameters - command.AddOption(new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (subjectRightsRequestId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(subjectRightsRequestId)) requestInfo.PathParameters.Add("subjectRightsRequest_id", subjectRightsRequestId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var subjectRightsRequestIdOption = new Option("--subjectrightsrequest-id", description: "key: id of subjectRightsRequest"); + subjectRightsRequestIdOption.IsRequired = true; + command.AddOption(subjectRightsRequestIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (subjectRightsRequestId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Privacy/SubjectRightsRequests/SubjectRightsRequestsRequestBuilder.cs b/src/generated/Privacy/SubjectRightsRequests/SubjectRightsRequestsRequestBuilder.cs index 5a3dc38c61a..149a471fb9a 100644 --- a/src/generated/Privacy/SubjectRightsRequests/SubjectRightsRequestsRequestBuilder.cs +++ b/src/generated/Privacy/SubjectRightsRequests/SubjectRightsRequestsRequestBuilder.cs @@ -38,12 +38,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to subjectRightsRequests for privacy"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +65,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get subjectRightsRequests from privacy"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/DailyPrintUsageByPrinter/DailyPrintUsageByPrinterRequestBuilder.cs b/src/generated/Reports/DailyPrintUsageByPrinter/DailyPrintUsageByPrinterRequestBuilder.cs index 70b2f04e537..e682238c9c2 100644 --- a/src/generated/Reports/DailyPrintUsageByPrinter/DailyPrintUsageByPrinterRequestBuilder.cs +++ b/src/generated/Reports/DailyPrintUsageByPrinter/DailyPrintUsageByPrinterRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to dailyPrintUsageByPrinter for reports"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get dailyPrintUsageByPrinter from reports"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/DailyPrintUsageByPrinter/Item/PrintUsageByPrinterRequestBuilder.cs b/src/generated/Reports/DailyPrintUsageByPrinter/Item/PrintUsageByPrinterRequestBuilder.cs index 7df6faf1b60..5c58434f06b 100644 --- a/src/generated/Reports/DailyPrintUsageByPrinter/Item/PrintUsageByPrinterRequestBuilder.cs +++ b/src/generated/Reports/DailyPrintUsageByPrinter/Item/PrintUsageByPrinterRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property dailyPrintUsageByPrinter for reports"; // Create options for all the parameters - command.AddOption(new Option("--printusagebyprinter-id", description: "key: id of printUsageByPrinter")); + var printUsageByPrinterIdOption = new Option("--printusagebyprinter-id", description: "key: id of printUsageByPrinter"); + printUsageByPrinterIdOption.IsRequired = true; + command.AddOption(printUsageByPrinterIdOption); command.Handler = CommandHandler.Create(async (printUsageByPrinterId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printUsageByPrinterId)) requestInfo.PathParameters.Add("printUsageByPrinter_id", printUsageByPrinterId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get dailyPrintUsageByPrinter from reports"; // Create options for all the parameters - command.AddOption(new Option("--printusagebyprinter-id", description: "key: id of printUsageByPrinter")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printUsageByPrinterId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printUsageByPrinterId)) requestInfo.PathParameters.Add("printUsageByPrinter_id", printUsageByPrinterId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printUsageByPrinterIdOption = new Option("--printusagebyprinter-id", description: "key: id of printUsageByPrinter"); + printUsageByPrinterIdOption.IsRequired = true; + command.AddOption(printUsageByPrinterIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printUsageByPrinterId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property dailyPrintUsageByPrinter in reports"; // Create options for all the parameters - command.AddOption(new Option("--printusagebyprinter-id", description: "key: id of printUsageByPrinter")); - command.AddOption(new Option("--body")); + var printUsageByPrinterIdOption = new Option("--printusagebyprinter-id", description: "key: id of printUsageByPrinter"); + printUsageByPrinterIdOption.IsRequired = true; + command.AddOption(printUsageByPrinterIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printUsageByPrinterId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(printUsageByPrinterId)) requestInfo.PathParameters.Add("printUsageByPrinter_id", printUsageByPrinterId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Reports/DailyPrintUsageByUser/DailyPrintUsageByUserRequestBuilder.cs b/src/generated/Reports/DailyPrintUsageByUser/DailyPrintUsageByUserRequestBuilder.cs index efc2dc658bb..2b591bf1956 100644 --- a/src/generated/Reports/DailyPrintUsageByUser/DailyPrintUsageByUserRequestBuilder.cs +++ b/src/generated/Reports/DailyPrintUsageByUser/DailyPrintUsageByUserRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to dailyPrintUsageByUser for reports"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get dailyPrintUsageByUser from reports"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/DailyPrintUsageByUser/Item/PrintUsageByUserRequestBuilder.cs b/src/generated/Reports/DailyPrintUsageByUser/Item/PrintUsageByUserRequestBuilder.cs index fd8b7861c17..bf3f7791431 100644 --- a/src/generated/Reports/DailyPrintUsageByUser/Item/PrintUsageByUserRequestBuilder.cs +++ b/src/generated/Reports/DailyPrintUsageByUser/Item/PrintUsageByUserRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property dailyPrintUsageByUser for reports"; // Create options for all the parameters - command.AddOption(new Option("--printusagebyuser-id", description: "key: id of printUsageByUser")); + var printUsageByUserIdOption = new Option("--printusagebyuser-id", description: "key: id of printUsageByUser"); + printUsageByUserIdOption.IsRequired = true; + command.AddOption(printUsageByUserIdOption); command.Handler = CommandHandler.Create(async (printUsageByUserId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printUsageByUserId)) requestInfo.PathParameters.Add("printUsageByUser_id", printUsageByUserId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get dailyPrintUsageByUser from reports"; // Create options for all the parameters - command.AddOption(new Option("--printusagebyuser-id", description: "key: id of printUsageByUser")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printUsageByUserId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printUsageByUserId)) requestInfo.PathParameters.Add("printUsageByUser_id", printUsageByUserId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printUsageByUserIdOption = new Option("--printusagebyuser-id", description: "key: id of printUsageByUser"); + printUsageByUserIdOption.IsRequired = true; + command.AddOption(printUsageByUserIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printUsageByUserId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property dailyPrintUsageByUser in reports"; // Create options for all the parameters - command.AddOption(new Option("--printusagebyuser-id", description: "key: id of printUsageByUser")); - command.AddOption(new Option("--body")); + var printUsageByUserIdOption = new Option("--printusagebyuser-id", description: "key: id of printUsageByUser"); + printUsageByUserIdOption.IsRequired = true; + command.AddOption(printUsageByUserIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printUsageByUserId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(printUsageByUserId)) requestInfo.PathParameters.Add("printUsageByUser_id", printUsageByUserId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Reports/DeviceConfigurationDeviceActivity/DeviceConfigurationDeviceActivityRequestBuilder.cs b/src/generated/Reports/DeviceConfigurationDeviceActivity/DeviceConfigurationDeviceActivityRequestBuilder.cs index 460322aa1e8..935128a7ae2 100644 --- a/src/generated/Reports/DeviceConfigurationDeviceActivity/DeviceConfigurationDeviceActivityRequestBuilder.cs +++ b/src/generated/Reports/DeviceConfigurationDeviceActivity/DeviceConfigurationDeviceActivityRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildGetCommand() { command.Description = "Metadata for the device configuration device activity report"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/DeviceConfigurationUserActivity/DeviceConfigurationUserActivityRequestBuilder.cs b/src/generated/Reports/DeviceConfigurationUserActivity/DeviceConfigurationUserActivityRequestBuilder.cs index 5e7bd6b91a6..f2880f568b3 100644 --- a/src/generated/Reports/DeviceConfigurationUserActivity/DeviceConfigurationUserActivityRequestBuilder.cs +++ b/src/generated/Reports/DeviceConfigurationUserActivity/DeviceConfigurationUserActivityRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildGetCommand() { command.Description = "Metadata for the device configuration user activity report"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetEmailActivityCountsWithPeriod/GetEmailActivityCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetEmailActivityCountsWithPeriod/GetEmailActivityCountsWithPeriodRequestBuilder.cs index 063aedb4190..2e70d100f12 100644 --- a/src/generated/Reports/GetEmailActivityCountsWithPeriod/GetEmailActivityCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetEmailActivityCountsWithPeriod/GetEmailActivityCountsWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getEmailActivityCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetEmailActivityUserCountsWithPeriod/GetEmailActivityUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetEmailActivityUserCountsWithPeriod/GetEmailActivityUserCountsWithPeriodRequestBuilder.cs index 2fc5857380e..9e4d60a3a3a 100644 --- a/src/generated/Reports/GetEmailActivityUserCountsWithPeriod/GetEmailActivityUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetEmailActivityUserCountsWithPeriod/GetEmailActivityUserCountsWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getEmailActivityUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetEmailActivityUserDetailWithDate/GetEmailActivityUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetEmailActivityUserDetailWithDate/GetEmailActivityUserDetailWithDateRequestBuilder.cs index d16715e1176..496d06042d7 100644 --- a/src/generated/Reports/GetEmailActivityUserDetailWithDate/GetEmailActivityUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetEmailActivityUserDetailWithDate/GetEmailActivityUserDetailWithDateRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getEmailActivityUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (date, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetEmailActivityUserDetailWithPeriod/GetEmailActivityUserDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetEmailActivityUserDetailWithPeriod/GetEmailActivityUserDetailWithPeriodRequestBuilder.cs index c554b825f43..645a612a703 100644 --- a/src/generated/Reports/GetEmailActivityUserDetailWithPeriod/GetEmailActivityUserDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetEmailActivityUserDetailWithPeriod/GetEmailActivityUserDetailWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getEmailActivityUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetEmailAppUsageAppsUserCountsWithPeriod/GetEmailAppUsageAppsUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetEmailAppUsageAppsUserCountsWithPeriod/GetEmailAppUsageAppsUserCountsWithPeriodRequestBuilder.cs index cbe80d3ab5f..7982e45466d 100644 --- a/src/generated/Reports/GetEmailAppUsageAppsUserCountsWithPeriod/GetEmailAppUsageAppsUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetEmailAppUsageAppsUserCountsWithPeriod/GetEmailAppUsageAppsUserCountsWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getEmailAppUsageAppsUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetEmailAppUsageUserCountsWithPeriod/GetEmailAppUsageUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetEmailAppUsageUserCountsWithPeriod/GetEmailAppUsageUserCountsWithPeriodRequestBuilder.cs index 566682509ae..4ea27b64f0d 100644 --- a/src/generated/Reports/GetEmailAppUsageUserCountsWithPeriod/GetEmailAppUsageUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetEmailAppUsageUserCountsWithPeriod/GetEmailAppUsageUserCountsWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getEmailAppUsageUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetEmailAppUsageUserDetailWithDate/GetEmailAppUsageUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetEmailAppUsageUserDetailWithDate/GetEmailAppUsageUserDetailWithDateRequestBuilder.cs index b4be7e941cc..0330d0fa9f8 100644 --- a/src/generated/Reports/GetEmailAppUsageUserDetailWithDate/GetEmailAppUsageUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetEmailAppUsageUserDetailWithDate/GetEmailAppUsageUserDetailWithDateRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getEmailAppUsageUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (date, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetEmailAppUsageUserDetailWithPeriod/GetEmailAppUsageUserDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetEmailAppUsageUserDetailWithPeriod/GetEmailAppUsageUserDetailWithPeriodRequestBuilder.cs index 42f12d7474f..4d388e7a74d 100644 --- a/src/generated/Reports/GetEmailAppUsageUserDetailWithPeriod/GetEmailAppUsageUserDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetEmailAppUsageUserDetailWithPeriod/GetEmailAppUsageUserDetailWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getEmailAppUsageUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetEmailAppUsageVersionsUserCountsWithPeriod/GetEmailAppUsageVersionsUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetEmailAppUsageVersionsUserCountsWithPeriod/GetEmailAppUsageVersionsUserCountsWithPeriodRequestBuilder.cs index 840412e34e5..33fd4ffda5a 100644 --- a/src/generated/Reports/GetEmailAppUsageVersionsUserCountsWithPeriod/GetEmailAppUsageVersionsUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetEmailAppUsageVersionsUserCountsWithPeriod/GetEmailAppUsageVersionsUserCountsWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getEmailAppUsageVersionsUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTime/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/Reports/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTime/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs index cd9d60517c2..e4eec6fa6e7 100644 --- a/src/generated/Reports/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTime/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/Reports/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTime/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getGroupArchivedPrintJobs"; // Create options for all the parameters - command.AddOption(new Option("--groupid", description: "Usage: groupId={groupId}")); - command.AddOption(new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}")); - command.AddOption(new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}")); - command.Handler = CommandHandler.Create(async (groupId, startDateTime, endDateTime) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("groupId", groupId); - requestInfo.PathParameters.Add("startDateTime", startDateTime); - requestInfo.PathParameters.Add("endDateTime", endDateTime); + var groupIdOption = new Option("--groupid", description: "Usage: groupId={groupId}"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + command.Handler = CommandHandler.Create(async (groupId, startDateTime, endDateTime) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetMailboxUsageDetailWithPeriod/GetMailboxUsageDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetMailboxUsageDetailWithPeriod/GetMailboxUsageDetailWithPeriodRequestBuilder.cs index ec681b8d20c..bfe7fc3fb90 100644 --- a/src/generated/Reports/GetMailboxUsageDetailWithPeriod/GetMailboxUsageDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetMailboxUsageDetailWithPeriod/GetMailboxUsageDetailWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getMailboxUsageDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetMailboxUsageMailboxCountsWithPeriod/GetMailboxUsageMailboxCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetMailboxUsageMailboxCountsWithPeriod/GetMailboxUsageMailboxCountsWithPeriodRequestBuilder.cs index fb68fc1b250..f559c59c556 100644 --- a/src/generated/Reports/GetMailboxUsageMailboxCountsWithPeriod/GetMailboxUsageMailboxCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetMailboxUsageMailboxCountsWithPeriod/GetMailboxUsageMailboxCountsWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getMailboxUsageMailboxCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetMailboxUsageQuotaStatusMailboxCountsWithPeriod/GetMailboxUsageQuotaStatusMailboxCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetMailboxUsageQuotaStatusMailboxCountsWithPeriod/GetMailboxUsageQuotaStatusMailboxCountsWithPeriodRequestBuilder.cs index b55f59f0c41..fc8ecf2e6d4 100644 --- a/src/generated/Reports/GetMailboxUsageQuotaStatusMailboxCountsWithPeriod/GetMailboxUsageQuotaStatusMailboxCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetMailboxUsageQuotaStatusMailboxCountsWithPeriod/GetMailboxUsageQuotaStatusMailboxCountsWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getMailboxUsageQuotaStatusMailboxCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetMailboxUsageStorageWithPeriod/GetMailboxUsageStorageWithPeriodRequestBuilder.cs b/src/generated/Reports/GetMailboxUsageStorageWithPeriod/GetMailboxUsageStorageWithPeriodRequestBuilder.cs index a0441bc9f59..953bcab129d 100644 --- a/src/generated/Reports/GetMailboxUsageStorageWithPeriod/GetMailboxUsageStorageWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetMailboxUsageStorageWithPeriod/GetMailboxUsageStorageWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getMailboxUsageStorage"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetOffice365ActivationCounts/GetOffice365ActivationCountsRequestBuilder.cs b/src/generated/Reports/GetOffice365ActivationCounts/GetOffice365ActivationCountsRequestBuilder.cs index fdfac8ffbcf..624bbec891c 100644 --- a/src/generated/Reports/GetOffice365ActivationCounts/GetOffice365ActivationCountsRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365ActivationCounts/GetOffice365ActivationCountsRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function getOffice365ActivationCounts"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOffice365ActivationsUserCounts/GetOffice365ActivationsUserCountsRequestBuilder.cs b/src/generated/Reports/GetOffice365ActivationsUserCounts/GetOffice365ActivationsUserCountsRequestBuilder.cs index 6a95dbc6d8c..0aaebf1ceed 100644 --- a/src/generated/Reports/GetOffice365ActivationsUserCounts/GetOffice365ActivationsUserCountsRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365ActivationsUserCounts/GetOffice365ActivationsUserCountsRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function getOffice365ActivationsUserCounts"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOffice365ActivationsUserDetail/GetOffice365ActivationsUserDetailRequestBuilder.cs b/src/generated/Reports/GetOffice365ActivationsUserDetail/GetOffice365ActivationsUserDetailRequestBuilder.cs index b977c0b6816..63c950354b4 100644 --- a/src/generated/Reports/GetOffice365ActivationsUserDetail/GetOffice365ActivationsUserDetailRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365ActivationsUserDetail/GetOffice365ActivationsUserDetailRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function getOffice365ActivationsUserDetail"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOffice365ActiveUserCountsWithPeriod/GetOffice365ActiveUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOffice365ActiveUserCountsWithPeriod/GetOffice365ActiveUserCountsWithPeriodRequestBuilder.cs index 99f03c77eeb..cf3cd9908d9 100644 --- a/src/generated/Reports/GetOffice365ActiveUserCountsWithPeriod/GetOffice365ActiveUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365ActiveUserCountsWithPeriod/GetOffice365ActiveUserCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOffice365ActiveUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOffice365ActiveUserDetailWithDate/GetOffice365ActiveUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetOffice365ActiveUserDetailWithDate/GetOffice365ActiveUserDetailWithDateRequestBuilder.cs index a020e7d847b..d87a0e2b892 100644 --- a/src/generated/Reports/GetOffice365ActiveUserDetailWithDate/GetOffice365ActiveUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365ActiveUserDetailWithDate/GetOffice365ActiveUserDetailWithDateRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOffice365ActiveUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.Handler = CommandHandler.Create(async (date) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOffice365ActiveUserDetailWithPeriod/GetOffice365ActiveUserDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOffice365ActiveUserDetailWithPeriod/GetOffice365ActiveUserDetailWithPeriodRequestBuilder.cs index 75fea083936..05198061ae6 100644 --- a/src/generated/Reports/GetOffice365ActiveUserDetailWithPeriod/GetOffice365ActiveUserDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365ActiveUserDetailWithPeriod/GetOffice365ActiveUserDetailWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOffice365ActiveUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOffice365GroupsActivityCountsWithPeriod/GetOffice365GroupsActivityCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOffice365GroupsActivityCountsWithPeriod/GetOffice365GroupsActivityCountsWithPeriodRequestBuilder.cs index 265612f30aa..f4bf78679e4 100644 --- a/src/generated/Reports/GetOffice365GroupsActivityCountsWithPeriod/GetOffice365GroupsActivityCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365GroupsActivityCountsWithPeriod/GetOffice365GroupsActivityCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOffice365GroupsActivityCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOffice365GroupsActivityDetailWithDate/GetOffice365GroupsActivityDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetOffice365GroupsActivityDetailWithDate/GetOffice365GroupsActivityDetailWithDateRequestBuilder.cs index e40145ee4ea..86ae6b94b92 100644 --- a/src/generated/Reports/GetOffice365GroupsActivityDetailWithDate/GetOffice365GroupsActivityDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365GroupsActivityDetailWithDate/GetOffice365GroupsActivityDetailWithDateRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOffice365GroupsActivityDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.Handler = CommandHandler.Create(async (date) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOffice365GroupsActivityDetailWithPeriod/GetOffice365GroupsActivityDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOffice365GroupsActivityDetailWithPeriod/GetOffice365GroupsActivityDetailWithPeriodRequestBuilder.cs index 89438543a15..5438f9defbd 100644 --- a/src/generated/Reports/GetOffice365GroupsActivityDetailWithPeriod/GetOffice365GroupsActivityDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365GroupsActivityDetailWithPeriod/GetOffice365GroupsActivityDetailWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOffice365GroupsActivityDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOffice365GroupsActivityFileCountsWithPeriod/GetOffice365GroupsActivityFileCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOffice365GroupsActivityFileCountsWithPeriod/GetOffice365GroupsActivityFileCountsWithPeriodRequestBuilder.cs index 537b4a3a5f7..d1f64af2408 100644 --- a/src/generated/Reports/GetOffice365GroupsActivityFileCountsWithPeriod/GetOffice365GroupsActivityFileCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365GroupsActivityFileCountsWithPeriod/GetOffice365GroupsActivityFileCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOffice365GroupsActivityFileCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOffice365GroupsActivityGroupCountsWithPeriod/GetOffice365GroupsActivityGroupCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOffice365GroupsActivityGroupCountsWithPeriod/GetOffice365GroupsActivityGroupCountsWithPeriodRequestBuilder.cs index be2bbf20281..dc0186ab559 100644 --- a/src/generated/Reports/GetOffice365GroupsActivityGroupCountsWithPeriod/GetOffice365GroupsActivityGroupCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365GroupsActivityGroupCountsWithPeriod/GetOffice365GroupsActivityGroupCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOffice365GroupsActivityGroupCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOffice365GroupsActivityStorageWithPeriod/GetOffice365GroupsActivityStorageWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOffice365GroupsActivityStorageWithPeriod/GetOffice365GroupsActivityStorageWithPeriodRequestBuilder.cs index 66d739533a8..eae9226da96 100644 --- a/src/generated/Reports/GetOffice365GroupsActivityStorageWithPeriod/GetOffice365GroupsActivityStorageWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365GroupsActivityStorageWithPeriod/GetOffice365GroupsActivityStorageWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOffice365GroupsActivityStorage"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOffice365ServicesUserCountsWithPeriod/GetOffice365ServicesUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOffice365ServicesUserCountsWithPeriod/GetOffice365ServicesUserCountsWithPeriodRequestBuilder.cs index 2bef9856598..6e2155af0df 100644 --- a/src/generated/Reports/GetOffice365ServicesUserCountsWithPeriod/GetOffice365ServicesUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365ServicesUserCountsWithPeriod/GetOffice365ServicesUserCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOffice365ServicesUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOneDriveActivityFileCountsWithPeriod/GetOneDriveActivityFileCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOneDriveActivityFileCountsWithPeriod/GetOneDriveActivityFileCountsWithPeriodRequestBuilder.cs index 3f2df07f372..b28bf91a6bb 100644 --- a/src/generated/Reports/GetOneDriveActivityFileCountsWithPeriod/GetOneDriveActivityFileCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOneDriveActivityFileCountsWithPeriod/GetOneDriveActivityFileCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOneDriveActivityFileCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOneDriveActivityUserCountsWithPeriod/GetOneDriveActivityUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOneDriveActivityUserCountsWithPeriod/GetOneDriveActivityUserCountsWithPeriodRequestBuilder.cs index 02eb2763487..6c8a1ee58a4 100644 --- a/src/generated/Reports/GetOneDriveActivityUserCountsWithPeriod/GetOneDriveActivityUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOneDriveActivityUserCountsWithPeriod/GetOneDriveActivityUserCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOneDriveActivityUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOneDriveActivityUserDetailWithDate/GetOneDriveActivityUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetOneDriveActivityUserDetailWithDate/GetOneDriveActivityUserDetailWithDateRequestBuilder.cs index 72f32cd3c08..8be248651ba 100644 --- a/src/generated/Reports/GetOneDriveActivityUserDetailWithDate/GetOneDriveActivityUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetOneDriveActivityUserDetailWithDate/GetOneDriveActivityUserDetailWithDateRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOneDriveActivityUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.Handler = CommandHandler.Create(async (date) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOneDriveActivityUserDetailWithPeriod/GetOneDriveActivityUserDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOneDriveActivityUserDetailWithPeriod/GetOneDriveActivityUserDetailWithPeriodRequestBuilder.cs index c814b283880..6c8d845cf4d 100644 --- a/src/generated/Reports/GetOneDriveActivityUserDetailWithPeriod/GetOneDriveActivityUserDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOneDriveActivityUserDetailWithPeriod/GetOneDriveActivityUserDetailWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOneDriveActivityUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOneDriveUsageAccountCountsWithPeriod/GetOneDriveUsageAccountCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOneDriveUsageAccountCountsWithPeriod/GetOneDriveUsageAccountCountsWithPeriodRequestBuilder.cs index 1828458c4c8..468e5840a2a 100644 --- a/src/generated/Reports/GetOneDriveUsageAccountCountsWithPeriod/GetOneDriveUsageAccountCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOneDriveUsageAccountCountsWithPeriod/GetOneDriveUsageAccountCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOneDriveUsageAccountCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOneDriveUsageAccountDetailWithDate/GetOneDriveUsageAccountDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetOneDriveUsageAccountDetailWithDate/GetOneDriveUsageAccountDetailWithDateRequestBuilder.cs index c50998d42aa..717f439d393 100644 --- a/src/generated/Reports/GetOneDriveUsageAccountDetailWithDate/GetOneDriveUsageAccountDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetOneDriveUsageAccountDetailWithDate/GetOneDriveUsageAccountDetailWithDateRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOneDriveUsageAccountDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.Handler = CommandHandler.Create(async (date) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOneDriveUsageAccountDetailWithPeriod/GetOneDriveUsageAccountDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOneDriveUsageAccountDetailWithPeriod/GetOneDriveUsageAccountDetailWithPeriodRequestBuilder.cs index 3097ff63565..65efc0fdd0a 100644 --- a/src/generated/Reports/GetOneDriveUsageAccountDetailWithPeriod/GetOneDriveUsageAccountDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOneDriveUsageAccountDetailWithPeriod/GetOneDriveUsageAccountDetailWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOneDriveUsageAccountDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOneDriveUsageFileCountsWithPeriod/GetOneDriveUsageFileCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOneDriveUsageFileCountsWithPeriod/GetOneDriveUsageFileCountsWithPeriodRequestBuilder.cs index 3bdb9024283..5c2b25e049c 100644 --- a/src/generated/Reports/GetOneDriveUsageFileCountsWithPeriod/GetOneDriveUsageFileCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOneDriveUsageFileCountsWithPeriod/GetOneDriveUsageFileCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOneDriveUsageFileCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetOneDriveUsageStorageWithPeriod/GetOneDriveUsageStorageWithPeriodRequestBuilder.cs b/src/generated/Reports/GetOneDriveUsageStorageWithPeriod/GetOneDriveUsageStorageWithPeriodRequestBuilder.cs index 599eb65fe82..84c154eaee4 100644 --- a/src/generated/Reports/GetOneDriveUsageStorageWithPeriod/GetOneDriveUsageStorageWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetOneDriveUsageStorageWithPeriod/GetOneDriveUsageStorageWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getOneDriveUsageStorage"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTime/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/Reports/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTime/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs index 274221283c2..8a06afb9925 100644 --- a/src/generated/Reports/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTime/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/Reports/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTime/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getPrinterArchivedPrintJobs"; // Create options for all the parameters - command.AddOption(new Option("--printerid", description: "Usage: printerId={printerId}")); - command.AddOption(new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}")); - command.AddOption(new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}")); - command.Handler = CommandHandler.Create(async (printerId, startDateTime, endDateTime) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printerId)) requestInfo.PathParameters.Add("printerId", printerId); - requestInfo.PathParameters.Add("startDateTime", startDateTime); - requestInfo.PathParameters.Add("endDateTime", endDateTime); + var printerIdOption = new Option("--printerid", description: "Usage: printerId={printerId}"); + printerIdOption.IsRequired = true; + command.AddOption(printerIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + command.Handler = CommandHandler.Create(async (printerId, startDateTime, endDateTime) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSharePointActivityFileCountsWithPeriod/GetSharePointActivityFileCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSharePointActivityFileCountsWithPeriod/GetSharePointActivityFileCountsWithPeriodRequestBuilder.cs index 90669070736..aa7961a01da 100644 --- a/src/generated/Reports/GetSharePointActivityFileCountsWithPeriod/GetSharePointActivityFileCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSharePointActivityFileCountsWithPeriod/GetSharePointActivityFileCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSharePointActivityFileCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSharePointActivityPagesWithPeriod/GetSharePointActivityPagesWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSharePointActivityPagesWithPeriod/GetSharePointActivityPagesWithPeriodRequestBuilder.cs index 5aab3e039f5..68d17928c55 100644 --- a/src/generated/Reports/GetSharePointActivityPagesWithPeriod/GetSharePointActivityPagesWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSharePointActivityPagesWithPeriod/GetSharePointActivityPagesWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSharePointActivityPages"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSharePointActivityUserCountsWithPeriod/GetSharePointActivityUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSharePointActivityUserCountsWithPeriod/GetSharePointActivityUserCountsWithPeriodRequestBuilder.cs index 6b6573a5c3a..7db7a6831d6 100644 --- a/src/generated/Reports/GetSharePointActivityUserCountsWithPeriod/GetSharePointActivityUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSharePointActivityUserCountsWithPeriod/GetSharePointActivityUserCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSharePointActivityUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSharePointActivityUserDetailWithDate/GetSharePointActivityUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetSharePointActivityUserDetailWithDate/GetSharePointActivityUserDetailWithDateRequestBuilder.cs index 10cdfaf22e5..7a6d5297854 100644 --- a/src/generated/Reports/GetSharePointActivityUserDetailWithDate/GetSharePointActivityUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetSharePointActivityUserDetailWithDate/GetSharePointActivityUserDetailWithDateRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSharePointActivityUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.Handler = CommandHandler.Create(async (date) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSharePointActivityUserDetailWithPeriod/GetSharePointActivityUserDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSharePointActivityUserDetailWithPeriod/GetSharePointActivityUserDetailWithPeriodRequestBuilder.cs index b065ef4509a..c67e3134590 100644 --- a/src/generated/Reports/GetSharePointActivityUserDetailWithPeriod/GetSharePointActivityUserDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSharePointActivityUserDetailWithPeriod/GetSharePointActivityUserDetailWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSharePointActivityUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSharePointSiteUsageDetailWithDate/GetSharePointSiteUsageDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetSharePointSiteUsageDetailWithDate/GetSharePointSiteUsageDetailWithDateRequestBuilder.cs index 0266d04a9ad..f337f0270a5 100644 --- a/src/generated/Reports/GetSharePointSiteUsageDetailWithDate/GetSharePointSiteUsageDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetSharePointSiteUsageDetailWithDate/GetSharePointSiteUsageDetailWithDateRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSharePointSiteUsageDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.Handler = CommandHandler.Create(async (date) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSharePointSiteUsageDetailWithPeriod/GetSharePointSiteUsageDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSharePointSiteUsageDetailWithPeriod/GetSharePointSiteUsageDetailWithPeriodRequestBuilder.cs index 7dff978a11d..f36d45b306e 100644 --- a/src/generated/Reports/GetSharePointSiteUsageDetailWithPeriod/GetSharePointSiteUsageDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSharePointSiteUsageDetailWithPeriod/GetSharePointSiteUsageDetailWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSharePointSiteUsageDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSharePointSiteUsageFileCountsWithPeriod/GetSharePointSiteUsageFileCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSharePointSiteUsageFileCountsWithPeriod/GetSharePointSiteUsageFileCountsWithPeriodRequestBuilder.cs index 4035cdbc259..abe810b063a 100644 --- a/src/generated/Reports/GetSharePointSiteUsageFileCountsWithPeriod/GetSharePointSiteUsageFileCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSharePointSiteUsageFileCountsWithPeriod/GetSharePointSiteUsageFileCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSharePointSiteUsageFileCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSharePointSiteUsagePagesWithPeriod/GetSharePointSiteUsagePagesWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSharePointSiteUsagePagesWithPeriod/GetSharePointSiteUsagePagesWithPeriodRequestBuilder.cs index c5bab9e8996..5b486239e97 100644 --- a/src/generated/Reports/GetSharePointSiteUsagePagesWithPeriod/GetSharePointSiteUsagePagesWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSharePointSiteUsagePagesWithPeriod/GetSharePointSiteUsagePagesWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSharePointSiteUsagePages"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSharePointSiteUsageSiteCountsWithPeriod/GetSharePointSiteUsageSiteCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSharePointSiteUsageSiteCountsWithPeriod/GetSharePointSiteUsageSiteCountsWithPeriodRequestBuilder.cs index 9d8aa6be5c3..b8e81ee0190 100644 --- a/src/generated/Reports/GetSharePointSiteUsageSiteCountsWithPeriod/GetSharePointSiteUsageSiteCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSharePointSiteUsageSiteCountsWithPeriod/GetSharePointSiteUsageSiteCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSharePointSiteUsageSiteCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSharePointSiteUsageStorageWithPeriod/GetSharePointSiteUsageStorageWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSharePointSiteUsageStorageWithPeriod/GetSharePointSiteUsageStorageWithPeriodRequestBuilder.cs index d454b72c20f..912522423f4 100644 --- a/src/generated/Reports/GetSharePointSiteUsageStorageWithPeriod/GetSharePointSiteUsageStorageWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSharePointSiteUsageStorageWithPeriod/GetSharePointSiteUsageStorageWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSharePointSiteUsageStorage"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessActivityCountsWithPeriod/GetSkypeForBusinessActivityCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessActivityCountsWithPeriod/GetSkypeForBusinessActivityCountsWithPeriodRequestBuilder.cs index bdcdbc2410a..7251ddd32c4 100644 --- a/src/generated/Reports/GetSkypeForBusinessActivityCountsWithPeriod/GetSkypeForBusinessActivityCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessActivityCountsWithPeriod/GetSkypeForBusinessActivityCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessActivityCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessActivityUserCountsWithPeriod/GetSkypeForBusinessActivityUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessActivityUserCountsWithPeriod/GetSkypeForBusinessActivityUserCountsWithPeriodRequestBuilder.cs index 6b7ec83bb18..a97b848521e 100644 --- a/src/generated/Reports/GetSkypeForBusinessActivityUserCountsWithPeriod/GetSkypeForBusinessActivityUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessActivityUserCountsWithPeriod/GetSkypeForBusinessActivityUserCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessActivityUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessActivityUserDetailWithDate/GetSkypeForBusinessActivityUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessActivityUserDetailWithDate/GetSkypeForBusinessActivityUserDetailWithDateRequestBuilder.cs index 2063180e319..8a4da471753 100644 --- a/src/generated/Reports/GetSkypeForBusinessActivityUserDetailWithDate/GetSkypeForBusinessActivityUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessActivityUserDetailWithDate/GetSkypeForBusinessActivityUserDetailWithDateRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessActivityUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.Handler = CommandHandler.Create(async (date) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessActivityUserDetailWithPeriod/GetSkypeForBusinessActivityUserDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessActivityUserDetailWithPeriod/GetSkypeForBusinessActivityUserDetailWithPeriodRequestBuilder.cs index 868d1c03f8c..08fc4605408 100644 --- a/src/generated/Reports/GetSkypeForBusinessActivityUserDetailWithPeriod/GetSkypeForBusinessActivityUserDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessActivityUserDetailWithPeriod/GetSkypeForBusinessActivityUserDetailWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessActivityUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessDeviceUsageDistributionUserCountsWithPeriod/GetSkypeForBusinessDeviceUsageDistributionUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessDeviceUsageDistributionUserCountsWithPeriod/GetSkypeForBusinessDeviceUsageDistributionUserCountsWithPeriodRequestBuilder.cs index 82bb7067c69..8be7ab520da 100644 --- a/src/generated/Reports/GetSkypeForBusinessDeviceUsageDistributionUserCountsWithPeriod/GetSkypeForBusinessDeviceUsageDistributionUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessDeviceUsageDistributionUserCountsWithPeriod/GetSkypeForBusinessDeviceUsageDistributionUserCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessDeviceUsageDistributionUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserCountsWithPeriod/GetSkypeForBusinessDeviceUsageUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserCountsWithPeriod/GetSkypeForBusinessDeviceUsageUserCountsWithPeriodRequestBuilder.cs index 1bf53ec0877..df56dd743b2 100644 --- a/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserCountsWithPeriod/GetSkypeForBusinessDeviceUsageUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserCountsWithPeriod/GetSkypeForBusinessDeviceUsageUserCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessDeviceUsageUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserDetailWithDate/GetSkypeForBusinessDeviceUsageUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserDetailWithDate/GetSkypeForBusinessDeviceUsageUserDetailWithDateRequestBuilder.cs index fe887be502e..c0790fdf75a 100644 --- a/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserDetailWithDate/GetSkypeForBusinessDeviceUsageUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserDetailWithDate/GetSkypeForBusinessDeviceUsageUserDetailWithDateRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessDeviceUsageUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.Handler = CommandHandler.Create(async (date) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserDetailWithPeriod/GetSkypeForBusinessDeviceUsageUserDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserDetailWithPeriod/GetSkypeForBusinessDeviceUsageUserDetailWithPeriodRequestBuilder.cs index ea566c4dde5..b94023009c2 100644 --- a/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserDetailWithPeriod/GetSkypeForBusinessDeviceUsageUserDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserDetailWithPeriod/GetSkypeForBusinessDeviceUsageUserDetailWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessDeviceUsageUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessOrganizerActivityCountsWithPeriod/GetSkypeForBusinessOrganizerActivityCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessOrganizerActivityCountsWithPeriod/GetSkypeForBusinessOrganizerActivityCountsWithPeriodRequestBuilder.cs index 56af79ab9c0..c3503d075f0 100644 --- a/src/generated/Reports/GetSkypeForBusinessOrganizerActivityCountsWithPeriod/GetSkypeForBusinessOrganizerActivityCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessOrganizerActivityCountsWithPeriod/GetSkypeForBusinessOrganizerActivityCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessOrganizerActivityCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessOrganizerActivityMinuteCountsWithPeriod/GetSkypeForBusinessOrganizerActivityMinuteCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessOrganizerActivityMinuteCountsWithPeriod/GetSkypeForBusinessOrganizerActivityMinuteCountsWithPeriodRequestBuilder.cs index c57b9b64855..ab06a89966e 100644 --- a/src/generated/Reports/GetSkypeForBusinessOrganizerActivityMinuteCountsWithPeriod/GetSkypeForBusinessOrganizerActivityMinuteCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessOrganizerActivityMinuteCountsWithPeriod/GetSkypeForBusinessOrganizerActivityMinuteCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessOrganizerActivityMinuteCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessOrganizerActivityUserCountsWithPeriod/GetSkypeForBusinessOrganizerActivityUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessOrganizerActivityUserCountsWithPeriod/GetSkypeForBusinessOrganizerActivityUserCountsWithPeriodRequestBuilder.cs index 5eef632fd00..f5494555875 100644 --- a/src/generated/Reports/GetSkypeForBusinessOrganizerActivityUserCountsWithPeriod/GetSkypeForBusinessOrganizerActivityUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessOrganizerActivityUserCountsWithPeriod/GetSkypeForBusinessOrganizerActivityUserCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessOrganizerActivityUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessParticipantActivityCountsWithPeriod/GetSkypeForBusinessParticipantActivityCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessParticipantActivityCountsWithPeriod/GetSkypeForBusinessParticipantActivityCountsWithPeriodRequestBuilder.cs index 6b7885fb003..70ae1659f7e 100644 --- a/src/generated/Reports/GetSkypeForBusinessParticipantActivityCountsWithPeriod/GetSkypeForBusinessParticipantActivityCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessParticipantActivityCountsWithPeriod/GetSkypeForBusinessParticipantActivityCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessParticipantActivityCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessParticipantActivityMinuteCountsWithPeriod/GetSkypeForBusinessParticipantActivityMinuteCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessParticipantActivityMinuteCountsWithPeriod/GetSkypeForBusinessParticipantActivityMinuteCountsWithPeriodRequestBuilder.cs index 0070c4eb77a..02945748d51 100644 --- a/src/generated/Reports/GetSkypeForBusinessParticipantActivityMinuteCountsWithPeriod/GetSkypeForBusinessParticipantActivityMinuteCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessParticipantActivityMinuteCountsWithPeriod/GetSkypeForBusinessParticipantActivityMinuteCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessParticipantActivityMinuteCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessParticipantActivityUserCountsWithPeriod/GetSkypeForBusinessParticipantActivityUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessParticipantActivityUserCountsWithPeriod/GetSkypeForBusinessParticipantActivityUserCountsWithPeriodRequestBuilder.cs index 729bd02a73c..dd812c58e19 100644 --- a/src/generated/Reports/GetSkypeForBusinessParticipantActivityUserCountsWithPeriod/GetSkypeForBusinessParticipantActivityUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessParticipantActivityUserCountsWithPeriod/GetSkypeForBusinessParticipantActivityUserCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessParticipantActivityUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessPeerToPeerActivityCountsWithPeriod/GetSkypeForBusinessPeerToPeerActivityCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessPeerToPeerActivityCountsWithPeriod/GetSkypeForBusinessPeerToPeerActivityCountsWithPeriodRequestBuilder.cs index 5b23db4502b..cf83e61e6fd 100644 --- a/src/generated/Reports/GetSkypeForBusinessPeerToPeerActivityCountsWithPeriod/GetSkypeForBusinessPeerToPeerActivityCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessPeerToPeerActivityCountsWithPeriod/GetSkypeForBusinessPeerToPeerActivityCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessPeerToPeerActivityCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessPeerToPeerActivityMinuteCountsWithPeriod/GetSkypeForBusinessPeerToPeerActivityMinuteCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessPeerToPeerActivityMinuteCountsWithPeriod/GetSkypeForBusinessPeerToPeerActivityMinuteCountsWithPeriodRequestBuilder.cs index 83995eb326d..c6c1f000e32 100644 --- a/src/generated/Reports/GetSkypeForBusinessPeerToPeerActivityMinuteCountsWithPeriod/GetSkypeForBusinessPeerToPeerActivityMinuteCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessPeerToPeerActivityMinuteCountsWithPeriod/GetSkypeForBusinessPeerToPeerActivityMinuteCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessPeerToPeerActivityMinuteCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetSkypeForBusinessPeerToPeerActivityUserCountsWithPeriod/GetSkypeForBusinessPeerToPeerActivityUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessPeerToPeerActivityUserCountsWithPeriod/GetSkypeForBusinessPeerToPeerActivityUserCountsWithPeriodRequestBuilder.cs index 1c2cf5ba99a..4c31e842dc1 100644 --- a/src/generated/Reports/GetSkypeForBusinessPeerToPeerActivityUserCountsWithPeriod/GetSkypeForBusinessPeerToPeerActivityUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessPeerToPeerActivityUserCountsWithPeriod/GetSkypeForBusinessPeerToPeerActivityUserCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getSkypeForBusinessPeerToPeerActivityUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetTeamsDeviceUsageDistributionUserCountsWithPeriod/GetTeamsDeviceUsageDistributionUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetTeamsDeviceUsageDistributionUserCountsWithPeriod/GetTeamsDeviceUsageDistributionUserCountsWithPeriodRequestBuilder.cs index 8340afec83a..bf228cdbe63 100644 --- a/src/generated/Reports/GetTeamsDeviceUsageDistributionUserCountsWithPeriod/GetTeamsDeviceUsageDistributionUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetTeamsDeviceUsageDistributionUserCountsWithPeriod/GetTeamsDeviceUsageDistributionUserCountsWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getTeamsDeviceUsageDistributionUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetTeamsDeviceUsageUserCountsWithPeriod/GetTeamsDeviceUsageUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetTeamsDeviceUsageUserCountsWithPeriod/GetTeamsDeviceUsageUserCountsWithPeriodRequestBuilder.cs index 041a25e28de..89e9daa14b1 100644 --- a/src/generated/Reports/GetTeamsDeviceUsageUserCountsWithPeriod/GetTeamsDeviceUsageUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetTeamsDeviceUsageUserCountsWithPeriod/GetTeamsDeviceUsageUserCountsWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getTeamsDeviceUsageUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetTeamsDeviceUsageUserDetailWithDate/GetTeamsDeviceUsageUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetTeamsDeviceUsageUserDetailWithDate/GetTeamsDeviceUsageUserDetailWithDateRequestBuilder.cs index 8ec20db8525..16293cbaee7 100644 --- a/src/generated/Reports/GetTeamsDeviceUsageUserDetailWithDate/GetTeamsDeviceUsageUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetTeamsDeviceUsageUserDetailWithDate/GetTeamsDeviceUsageUserDetailWithDateRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getTeamsDeviceUsageUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (date, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetTeamsDeviceUsageUserDetailWithPeriod/GetTeamsDeviceUsageUserDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetTeamsDeviceUsageUserDetailWithPeriod/GetTeamsDeviceUsageUserDetailWithPeriodRequestBuilder.cs index 514e78a4dee..80ba8543f90 100644 --- a/src/generated/Reports/GetTeamsDeviceUsageUserDetailWithPeriod/GetTeamsDeviceUsageUserDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetTeamsDeviceUsageUserDetailWithPeriod/GetTeamsDeviceUsageUserDetailWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getTeamsDeviceUsageUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetTeamsUserActivityCountsWithPeriod/GetTeamsUserActivityCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetTeamsUserActivityCountsWithPeriod/GetTeamsUserActivityCountsWithPeriodRequestBuilder.cs index f4ccc7b8dde..da8051f91f5 100644 --- a/src/generated/Reports/GetTeamsUserActivityCountsWithPeriod/GetTeamsUserActivityCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetTeamsUserActivityCountsWithPeriod/GetTeamsUserActivityCountsWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getTeamsUserActivityCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetTeamsUserActivityUserCountsWithPeriod/GetTeamsUserActivityUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetTeamsUserActivityUserCountsWithPeriod/GetTeamsUserActivityUserCountsWithPeriodRequestBuilder.cs index 3f05c903183..40e15199bd0 100644 --- a/src/generated/Reports/GetTeamsUserActivityUserCountsWithPeriod/GetTeamsUserActivityUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetTeamsUserActivityUserCountsWithPeriod/GetTeamsUserActivityUserCountsWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getTeamsUserActivityUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetTeamsUserActivityUserDetailWithDate/GetTeamsUserActivityUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetTeamsUserActivityUserDetailWithDate/GetTeamsUserActivityUserDetailWithDateRequestBuilder.cs index a1d4d8f9cd0..70fa1d5fce4 100644 --- a/src/generated/Reports/GetTeamsUserActivityUserDetailWithDate/GetTeamsUserActivityUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetTeamsUserActivityUserDetailWithDate/GetTeamsUserActivityUserDetailWithDateRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getTeamsUserActivityUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (date, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetTeamsUserActivityUserDetailWithPeriod/GetTeamsUserActivityUserDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetTeamsUserActivityUserDetailWithPeriod/GetTeamsUserActivityUserDetailWithPeriodRequestBuilder.cs index 390174872a5..a1c64fff101 100644 --- a/src/generated/Reports/GetTeamsUserActivityUserDetailWithPeriod/GetTeamsUserActivityUserDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetTeamsUserActivityUserDetailWithPeriod/GetTeamsUserActivityUserDetailWithPeriodRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getTeamsUserActivityUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (period, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { diff --git a/src/generated/Reports/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTime/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/Reports/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTime/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs index 6c6d2723132..4504934a88f 100644 --- a/src/generated/Reports/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTime/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/Reports/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTime/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getUserArchivedPrintJobs"; // Create options for all the parameters - command.AddOption(new Option("--userid", description: "Usage: userId={userId}")); - command.AddOption(new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}")); - command.AddOption(new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}")); - command.Handler = CommandHandler.Create(async (userId, startDateTime, endDateTime) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("userId", userId); - requestInfo.PathParameters.Add("startDateTime", startDateTime); - requestInfo.PathParameters.Add("endDateTime", endDateTime); + var userIdOption = new Option("--userid", description: "Usage: userId={userId}"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + command.Handler = CommandHandler.Create(async (userId, startDateTime, endDateTime) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetYammerActivityCountsWithPeriod/GetYammerActivityCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetYammerActivityCountsWithPeriod/GetYammerActivityCountsWithPeriodRequestBuilder.cs index 2bc19d578c5..c40ee989c7e 100644 --- a/src/generated/Reports/GetYammerActivityCountsWithPeriod/GetYammerActivityCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetYammerActivityCountsWithPeriod/GetYammerActivityCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getYammerActivityCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetYammerActivityUserCountsWithPeriod/GetYammerActivityUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetYammerActivityUserCountsWithPeriod/GetYammerActivityUserCountsWithPeriodRequestBuilder.cs index 113faea24a2..b076b50b266 100644 --- a/src/generated/Reports/GetYammerActivityUserCountsWithPeriod/GetYammerActivityUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetYammerActivityUserCountsWithPeriod/GetYammerActivityUserCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getYammerActivityUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetYammerActivityUserDetailWithDate/GetYammerActivityUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetYammerActivityUserDetailWithDate/GetYammerActivityUserDetailWithDateRequestBuilder.cs index 8857943fab3..15786dbaae5 100644 --- a/src/generated/Reports/GetYammerActivityUserDetailWithDate/GetYammerActivityUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetYammerActivityUserDetailWithDate/GetYammerActivityUserDetailWithDateRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getYammerActivityUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.Handler = CommandHandler.Create(async (date) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetYammerActivityUserDetailWithPeriod/GetYammerActivityUserDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetYammerActivityUserDetailWithPeriod/GetYammerActivityUserDetailWithPeriodRequestBuilder.cs index 8fd434b7bae..6eeeb3d71a1 100644 --- a/src/generated/Reports/GetYammerActivityUserDetailWithPeriod/GetYammerActivityUserDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetYammerActivityUserDetailWithPeriod/GetYammerActivityUserDetailWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getYammerActivityUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetYammerDeviceUsageDistributionUserCountsWithPeriod/GetYammerDeviceUsageDistributionUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetYammerDeviceUsageDistributionUserCountsWithPeriod/GetYammerDeviceUsageDistributionUserCountsWithPeriodRequestBuilder.cs index 0b62bee23d1..ba80ccf90c8 100644 --- a/src/generated/Reports/GetYammerDeviceUsageDistributionUserCountsWithPeriod/GetYammerDeviceUsageDistributionUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetYammerDeviceUsageDistributionUserCountsWithPeriod/GetYammerDeviceUsageDistributionUserCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getYammerDeviceUsageDistributionUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetYammerDeviceUsageUserCountsWithPeriod/GetYammerDeviceUsageUserCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetYammerDeviceUsageUserCountsWithPeriod/GetYammerDeviceUsageUserCountsWithPeriodRequestBuilder.cs index 58997a0204a..763742c2741 100644 --- a/src/generated/Reports/GetYammerDeviceUsageUserCountsWithPeriod/GetYammerDeviceUsageUserCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetYammerDeviceUsageUserCountsWithPeriod/GetYammerDeviceUsageUserCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getYammerDeviceUsageUserCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetYammerDeviceUsageUserDetailWithDate/GetYammerDeviceUsageUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetYammerDeviceUsageUserDetailWithDate/GetYammerDeviceUsageUserDetailWithDateRequestBuilder.cs index b33b52e2179..71218a2cecb 100644 --- a/src/generated/Reports/GetYammerDeviceUsageUserDetailWithDate/GetYammerDeviceUsageUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetYammerDeviceUsageUserDetailWithDate/GetYammerDeviceUsageUserDetailWithDateRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getYammerDeviceUsageUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.Handler = CommandHandler.Create(async (date) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetYammerDeviceUsageUserDetailWithPeriod/GetYammerDeviceUsageUserDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetYammerDeviceUsageUserDetailWithPeriod/GetYammerDeviceUsageUserDetailWithPeriodRequestBuilder.cs index 6f09da45644..17b3d5847b0 100644 --- a/src/generated/Reports/GetYammerDeviceUsageUserDetailWithPeriod/GetYammerDeviceUsageUserDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetYammerDeviceUsageUserDetailWithPeriod/GetYammerDeviceUsageUserDetailWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getYammerDeviceUsageUserDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetYammerGroupsActivityCountsWithPeriod/GetYammerGroupsActivityCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetYammerGroupsActivityCountsWithPeriod/GetYammerGroupsActivityCountsWithPeriodRequestBuilder.cs index cbca8745f00..4b68afd4052 100644 --- a/src/generated/Reports/GetYammerGroupsActivityCountsWithPeriod/GetYammerGroupsActivityCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetYammerGroupsActivityCountsWithPeriod/GetYammerGroupsActivityCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getYammerGroupsActivityCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetYammerGroupsActivityDetailWithDate/GetYammerGroupsActivityDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetYammerGroupsActivityDetailWithDate/GetYammerGroupsActivityDetailWithDateRequestBuilder.cs index 9ef0c098aac..7fb2d5071eb 100644 --- a/src/generated/Reports/GetYammerGroupsActivityDetailWithDate/GetYammerGroupsActivityDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetYammerGroupsActivityDetailWithDate/GetYammerGroupsActivityDetailWithDateRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getYammerGroupsActivityDetail"; // Create options for all the parameters - command.AddOption(new Option("--date", description: "Usage: date={date}")); + var dateOption = new Option("--date", description: "Usage: date={date}"); + dateOption.IsRequired = true; + command.AddOption(dateOption); command.Handler = CommandHandler.Create(async (date) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(date)) requestInfo.PathParameters.Add("date", date); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetYammerGroupsActivityDetailWithPeriod/GetYammerGroupsActivityDetailWithPeriodRequestBuilder.cs b/src/generated/Reports/GetYammerGroupsActivityDetailWithPeriod/GetYammerGroupsActivityDetailWithPeriodRequestBuilder.cs index e0076e786e8..60321ce7205 100644 --- a/src/generated/Reports/GetYammerGroupsActivityDetailWithPeriod/GetYammerGroupsActivityDetailWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetYammerGroupsActivityDetailWithPeriod/GetYammerGroupsActivityDetailWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getYammerGroupsActivityDetail"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/GetYammerGroupsActivityGroupCountsWithPeriod/GetYammerGroupsActivityGroupCountsWithPeriodRequestBuilder.cs b/src/generated/Reports/GetYammerGroupsActivityGroupCountsWithPeriod/GetYammerGroupsActivityGroupCountsWithPeriodRequestBuilder.cs index 2b26f5bc6f7..e5db884939e 100644 --- a/src/generated/Reports/GetYammerGroupsActivityGroupCountsWithPeriod/GetYammerGroupsActivityGroupCountsWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/GetYammerGroupsActivityGroupCountsWithPeriod/GetYammerGroupsActivityGroupCountsWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getYammerGroupsActivityGroupCounts"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/ManagedDeviceEnrollmentFailureDetails/ManagedDeviceEnrollmentFailureDetailsRequestBuilder.cs b/src/generated/Reports/ManagedDeviceEnrollmentFailureDetails/ManagedDeviceEnrollmentFailureDetailsRequestBuilder.cs index 37d74537007..ab54c662568 100644 --- a/src/generated/Reports/ManagedDeviceEnrollmentFailureDetails/ManagedDeviceEnrollmentFailureDetailsRequestBuilder.cs +++ b/src/generated/Reports/ManagedDeviceEnrollmentFailureDetails/ManagedDeviceEnrollmentFailureDetailsRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function managedDeviceEnrollmentFailureDetails"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/ManagedDeviceEnrollmentFailureDetailsWithSkipWithTopWithFilterWithSkipToken/ManagedDeviceEnrollmentFailureDetailsWithSkipWithTopWithFilterWithSkipTokenRequestBuilder.cs b/src/generated/Reports/ManagedDeviceEnrollmentFailureDetailsWithSkipWithTopWithFilterWithSkipToken/ManagedDeviceEnrollmentFailureDetailsWithSkipWithTopWithFilterWithSkipTokenRequestBuilder.cs index 8e5cd225182..15581ae5f68 100644 --- a/src/generated/Reports/ManagedDeviceEnrollmentFailureDetailsWithSkipWithTopWithFilterWithSkipToken/ManagedDeviceEnrollmentFailureDetailsWithSkipWithTopWithFilterWithSkipTokenRequestBuilder.cs +++ b/src/generated/Reports/ManagedDeviceEnrollmentFailureDetailsWithSkipWithTopWithFilterWithSkipToken/ManagedDeviceEnrollmentFailureDetailsWithSkipWithTopWithFilterWithSkipTokenRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function managedDeviceEnrollmentFailureDetails"; // Create options for all the parameters - command.AddOption(new Option("--skip", description: "Usage: skip={skip}")); - command.AddOption(new Option("--top", description: "Usage: top={top}")); - command.AddOption(new Option("--filter", description: "Usage: filter={filter}")); - command.AddOption(new Option("--skiptoken", description: "Usage: skipToken={skipToken}")); + var skipOption = new Option("--skip", description: "Usage: skip={skip}"); + skipOption.IsRequired = true; + command.AddOption(skipOption); + var topOption = new Option("--top", description: "Usage: top={top}"); + topOption.IsRequired = true; + command.AddOption(topOption); + var filterOption = new Option("--filter", description: "Usage: filter={filter}"); + filterOption.IsRequired = true; + command.AddOption(filterOption); + var skipTokenOption = new Option("--skiptoken", description: "Usage: skipToken={skipToken}"); + skipTokenOption.IsRequired = true; + command.AddOption(skipTokenOption); command.Handler = CommandHandler.Create(async (skip, top, filter, skipToken) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.PathParameters.Add("skip", skip); - requestInfo.PathParameters.Add("top", top); - if (!String.IsNullOrEmpty(filter)) requestInfo.PathParameters.Add("filter", filter); - if (!String.IsNullOrEmpty(skipToken)) requestInfo.PathParameters.Add("skipToken", skipToken); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/ManagedDeviceEnrollmentTopFailures/ManagedDeviceEnrollmentTopFailuresRequestBuilder.cs b/src/generated/Reports/ManagedDeviceEnrollmentTopFailures/ManagedDeviceEnrollmentTopFailuresRequestBuilder.cs index eb8866bd294..d1951caf7f0 100644 --- a/src/generated/Reports/ManagedDeviceEnrollmentTopFailures/ManagedDeviceEnrollmentTopFailuresRequestBuilder.cs +++ b/src/generated/Reports/ManagedDeviceEnrollmentTopFailures/ManagedDeviceEnrollmentTopFailuresRequestBuilder.cs @@ -27,7 +27,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function managedDeviceEnrollmentTopFailures"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/ManagedDeviceEnrollmentTopFailuresWithPeriod/ManagedDeviceEnrollmentTopFailuresWithPeriodRequestBuilder.cs b/src/generated/Reports/ManagedDeviceEnrollmentTopFailuresWithPeriod/ManagedDeviceEnrollmentTopFailuresWithPeriodRequestBuilder.cs index 1160d5cdad9..f4433262306 100644 --- a/src/generated/Reports/ManagedDeviceEnrollmentTopFailuresWithPeriod/ManagedDeviceEnrollmentTopFailuresWithPeriodRequestBuilder.cs +++ b/src/generated/Reports/ManagedDeviceEnrollmentTopFailuresWithPeriod/ManagedDeviceEnrollmentTopFailuresWithPeriodRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function managedDeviceEnrollmentTopFailures"; // Create options for all the parameters - command.AddOption(new Option("--period", description: "Usage: period={period}")); + var periodOption = new Option("--period", description: "Usage: period={period}"); + periodOption.IsRequired = true; + command.AddOption(periodOption); command.Handler = CommandHandler.Create(async (period) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(period)) requestInfo.PathParameters.Add("period", period); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/MonthlyPrintUsageByPrinter/Item/PrintUsageByPrinterRequestBuilder.cs b/src/generated/Reports/MonthlyPrintUsageByPrinter/Item/PrintUsageByPrinterRequestBuilder.cs index 4d8165bd4f6..cdb5f0090c9 100644 --- a/src/generated/Reports/MonthlyPrintUsageByPrinter/Item/PrintUsageByPrinterRequestBuilder.cs +++ b/src/generated/Reports/MonthlyPrintUsageByPrinter/Item/PrintUsageByPrinterRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property monthlyPrintUsageByPrinter for reports"; // Create options for all the parameters - command.AddOption(new Option("--printusagebyprinter-id", description: "key: id of printUsageByPrinter")); + var printUsageByPrinterIdOption = new Option("--printusagebyprinter-id", description: "key: id of printUsageByPrinter"); + printUsageByPrinterIdOption.IsRequired = true; + command.AddOption(printUsageByPrinterIdOption); command.Handler = CommandHandler.Create(async (printUsageByPrinterId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printUsageByPrinterId)) requestInfo.PathParameters.Add("printUsageByPrinter_id", printUsageByPrinterId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get monthlyPrintUsageByPrinter from reports"; // Create options for all the parameters - command.AddOption(new Option("--printusagebyprinter-id", description: "key: id of printUsageByPrinter")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printUsageByPrinterId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printUsageByPrinterId)) requestInfo.PathParameters.Add("printUsageByPrinter_id", printUsageByPrinterId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printUsageByPrinterIdOption = new Option("--printusagebyprinter-id", description: "key: id of printUsageByPrinter"); + printUsageByPrinterIdOption.IsRequired = true; + command.AddOption(printUsageByPrinterIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printUsageByPrinterId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property monthlyPrintUsageByPrinter in reports"; // Create options for all the parameters - command.AddOption(new Option("--printusagebyprinter-id", description: "key: id of printUsageByPrinter")); - command.AddOption(new Option("--body")); + var printUsageByPrinterIdOption = new Option("--printusagebyprinter-id", description: "key: id of printUsageByPrinter"); + printUsageByPrinterIdOption.IsRequired = true; + command.AddOption(printUsageByPrinterIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printUsageByPrinterId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(printUsageByPrinterId)) requestInfo.PathParameters.Add("printUsageByPrinter_id", printUsageByPrinterId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Reports/MonthlyPrintUsageByPrinter/MonthlyPrintUsageByPrinterRequestBuilder.cs b/src/generated/Reports/MonthlyPrintUsageByPrinter/MonthlyPrintUsageByPrinterRequestBuilder.cs index 4f23600b615..162e2d9ccfc 100644 --- a/src/generated/Reports/MonthlyPrintUsageByPrinter/MonthlyPrintUsageByPrinterRequestBuilder.cs +++ b/src/generated/Reports/MonthlyPrintUsageByPrinter/MonthlyPrintUsageByPrinterRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to monthlyPrintUsageByPrinter for reports"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get monthlyPrintUsageByPrinter from reports"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/MonthlyPrintUsageByUser/Item/PrintUsageByUserRequestBuilder.cs b/src/generated/Reports/MonthlyPrintUsageByUser/Item/PrintUsageByUserRequestBuilder.cs index b1dd02d7ff1..464a0ae8731 100644 --- a/src/generated/Reports/MonthlyPrintUsageByUser/Item/PrintUsageByUserRequestBuilder.cs +++ b/src/generated/Reports/MonthlyPrintUsageByUser/Item/PrintUsageByUserRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property monthlyPrintUsageByUser for reports"; // Create options for all the parameters - command.AddOption(new Option("--printusagebyuser-id", description: "key: id of printUsageByUser")); + var printUsageByUserIdOption = new Option("--printusagebyuser-id", description: "key: id of printUsageByUser"); + printUsageByUserIdOption.IsRequired = true; + command.AddOption(printUsageByUserIdOption); command.Handler = CommandHandler.Create(async (printUsageByUserId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(printUsageByUserId)) requestInfo.PathParameters.Add("printUsageByUser_id", printUsageByUserId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get monthlyPrintUsageByUser from reports"; // Create options for all the parameters - command.AddOption(new Option("--printusagebyuser-id", description: "key: id of printUsageByUser")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (printUsageByUserId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(printUsageByUserId)) requestInfo.PathParameters.Add("printUsageByUser_id", printUsageByUserId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var printUsageByUserIdOption = new Option("--printusagebyuser-id", description: "key: id of printUsageByUser"); + printUsageByUserIdOption.IsRequired = true; + command.AddOption(printUsageByUserIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (printUsageByUserId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property monthlyPrintUsageByUser in reports"; // Create options for all the parameters - command.AddOption(new Option("--printusagebyuser-id", description: "key: id of printUsageByUser")); - command.AddOption(new Option("--body")); + var printUsageByUserIdOption = new Option("--printusagebyuser-id", description: "key: id of printUsageByUser"); + printUsageByUserIdOption.IsRequired = true; + command.AddOption(printUsageByUserIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (printUsageByUserId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(printUsageByUserId)) requestInfo.PathParameters.Add("printUsageByUser_id", printUsageByUserId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Reports/MonthlyPrintUsageByUser/MonthlyPrintUsageByUserRequestBuilder.cs b/src/generated/Reports/MonthlyPrintUsageByUser/MonthlyPrintUsageByUserRequestBuilder.cs index 9101d2c5ad9..c0e82381973 100644 --- a/src/generated/Reports/MonthlyPrintUsageByUser/MonthlyPrintUsageByUserRequestBuilder.cs +++ b/src/generated/Reports/MonthlyPrintUsageByUser/MonthlyPrintUsageByUserRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to monthlyPrintUsageByUser for reports"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get monthlyPrintUsageByUser from reports"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Reports/ReportsRequestBuilder.cs b/src/generated/Reports/ReportsRequestBuilder.cs index a5a5041ef24..d5f7881097d 100644 --- a/src/generated/Reports/ReportsRequestBuilder.cs +++ b/src/generated/Reports/ReportsRequestBuilder.cs @@ -136,12 +136,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get reports"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -174,12 +181,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update reports"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/RoleManagement/Directory/DirectoryRequestBuilder.cs b/src/generated/RoleManagement/Directory/DirectoryRequestBuilder.cs index 898b3213d12..3228e8baff5 100644 --- a/src/generated/RoleManagement/Directory/DirectoryRequestBuilder.cs +++ b/src/generated/RoleManagement/Directory/DirectoryRequestBuilder.cs @@ -29,7 +29,8 @@ public Command BuildDeleteCommand() { command.Description = "Read-only. Nullable."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,12 +44,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,12 +75,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/RoleManagement/Directory/RoleAssignments/Item/AppScope/AppScopeRequestBuilder.cs b/src/generated/RoleManagement/Directory/RoleAssignments/Item/AppScope/AppScopeRequestBuilder.cs index 0276af61cbf..18550d331bc 100644 --- a/src/generated/RoleManagement/Directory/RoleAssignments/Item/AppScope/AppScopeRequestBuilder.cs +++ b/src/generated/RoleManagement/Directory/RoleAssignments/Item/AppScope/AppScopeRequestBuilder.cs @@ -20,16 +20,18 @@ public class AppScopeRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand."; + command.Description = "Details of the app specific scope when the assignment scope is app specific. Containment entity."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -37,20 +39,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand."; + command.Description = "Details of the app specific scope when the assignment scope is app specific. Containment entity."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,20 +73,24 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand."; + command.Description = "Details of the app specific scope when the assignment scope is app specific. Containment entity."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--body")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -97,7 +111,7 @@ public AppScopeRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// Request headers /// Request options /// @@ -112,7 +126,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// Request headers /// Request options /// Request query parameters @@ -133,7 +147,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// /// Request headers /// Request options @@ -151,7 +165,7 @@ public RequestInformation CreatePatchRequestInformation(ApiSdk.Models.Microsoft. return requestInfo; } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +176,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +188,7 @@ public async Task DeleteAsync(Action> h = default, I return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -186,7 +200,7 @@ public async Task PatchAsync(ApiSdk.Models.Microsoft.Graph.AppScope model, Actio var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/RoleManagement/Directory/RoleAssignments/Item/DirectoryScope/@Ref/RefRequestBuilder.cs b/src/generated/RoleManagement/Directory/RoleAssignments/Item/DirectoryScope/@Ref/RefRequestBuilder.cs index 3d0fdd31c91..791b08e8fd2 100644 --- a/src/generated/RoleManagement/Directory/RoleAssignments/Item/DirectoryScope/@Ref/RefRequestBuilder.cs +++ b/src/generated/RoleManagement/Directory/RoleAssignments/Item/DirectoryScope/@Ref/RefRequestBuilder.cs @@ -19,16 +19,18 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The directory object that is the scope of the assignment. Read-only. Supports $expand."; + command.Description = "The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -36,16 +38,18 @@ public Command BuildDeleteCommand() { return command; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The directory object that is the scope of the assignment. Read-only. Supports $expand."; + command.Description = "The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,20 +62,24 @@ public Command BuildGetCommand() { return command; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The directory object that is the scope of the assignment. Read-only. Supports $expand."; + command.Description = "The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--body")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -92,7 +100,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Request headers /// Request options /// @@ -107,7 +115,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Request headers /// Request options /// @@ -122,7 +130,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// /// Request headers /// Request options @@ -140,7 +148,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.RoleManagement.Dire return requestInfo; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -151,7 +159,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +170,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/RoleManagement/Directory/RoleAssignments/Item/DirectoryScope/DirectoryScopeRequestBuilder.cs b/src/generated/RoleManagement/Directory/RoleAssignments/Item/DirectoryScope/DirectoryScopeRequestBuilder.cs index 598555acc0a..24b18cfff3d 100644 --- a/src/generated/RoleManagement/Directory/RoleAssignments/Item/DirectoryScope/DirectoryScopeRequestBuilder.cs +++ b/src/generated/RoleManagement/Directory/RoleAssignments/Item/DirectoryScope/DirectoryScopeRequestBuilder.cs @@ -21,20 +21,28 @@ public class DirectoryScopeRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The directory object that is the scope of the assignment. Read-only. Supports $expand."; + command.Description = "The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,7 +76,7 @@ public DirectoryScopeRequestBuilder(Dictionary pathParameters, I RequestAdapter = requestAdapter; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -89,7 +97,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -100,7 +108,7 @@ public async Task GetAsync(Action q = defau var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/RoleManagement/Directory/RoleAssignments/Item/Principal/@Ref/RefRequestBuilder.cs b/src/generated/RoleManagement/Directory/RoleAssignments/Item/Principal/@Ref/RefRequestBuilder.cs index 0a159582ed4..8810d59f9a4 100644 --- a/src/generated/RoleManagement/Directory/RoleAssignments/Item/Principal/@Ref/RefRequestBuilder.cs +++ b/src/generated/RoleManagement/Directory/RoleAssignments/Item/Principal/@Ref/RefRequestBuilder.cs @@ -19,16 +19,18 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Referencing the assigned principal. Read-only. Supports $expand."; + command.Description = "The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -36,16 +38,18 @@ public Command BuildDeleteCommand() { return command; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Referencing the assigned principal. Read-only. Supports $expand."; + command.Description = "The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,20 +62,24 @@ public Command BuildGetCommand() { return command; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "Referencing the assigned principal. Read-only. Supports $expand."; + command.Description = "The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--body")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -92,7 +100,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Request headers /// Request options /// @@ -107,7 +115,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Request headers /// Request options /// @@ -122,7 +130,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// /// Request headers /// Request options @@ -140,7 +148,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.RoleManagement.Dire return requestInfo; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -151,7 +159,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +170,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/RoleManagement/Directory/RoleAssignments/Item/Principal/PrincipalRequestBuilder.cs b/src/generated/RoleManagement/Directory/RoleAssignments/Item/Principal/PrincipalRequestBuilder.cs index 7935f7e6169..580c231d8cf 100644 --- a/src/generated/RoleManagement/Directory/RoleAssignments/Item/Principal/PrincipalRequestBuilder.cs +++ b/src/generated/RoleManagement/Directory/RoleAssignments/Item/Principal/PrincipalRequestBuilder.cs @@ -21,20 +21,28 @@ public class PrincipalRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Referencing the assigned principal. Read-only. Supports $expand."; + command.Description = "The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,7 +76,7 @@ public PrincipalRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -89,7 +97,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -100,7 +108,7 @@ public async Task GetAsync(Action q = defau var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/RoleManagement/Directory/RoleAssignments/Item/RoleDefinition/@Ref/RefRequestBuilder.cs b/src/generated/RoleManagement/Directory/RoleAssignments/Item/RoleDefinition/@Ref/RefRequestBuilder.cs index 5d91a032c07..95fd6d1dc55 100644 --- a/src/generated/RoleManagement/Directory/RoleAssignments/Item/RoleDefinition/@Ref/RefRequestBuilder.cs +++ b/src/generated/RoleManagement/Directory/RoleAssignments/Item/RoleDefinition/@Ref/RefRequestBuilder.cs @@ -19,16 +19,18 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded."; + command.Description = "The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -36,16 +38,18 @@ public Command BuildDeleteCommand() { return command; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded."; + command.Description = "The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,20 +62,24 @@ public Command BuildGetCommand() { return command; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded."; + command.Description = "The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--body")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -92,7 +100,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// Request headers /// Request options /// @@ -107,7 +115,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// Request headers /// Request options /// @@ -122,7 +130,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// /// Request headers /// Request options @@ -140,7 +148,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.RoleManagement.Dire return requestInfo; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -151,7 +159,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +170,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/RoleManagement/Directory/RoleAssignments/Item/RoleDefinition/RoleDefinitionRequestBuilder.cs b/src/generated/RoleManagement/Directory/RoleAssignments/Item/RoleDefinition/RoleDefinitionRequestBuilder.cs index 89dd7410454..823d8ac2496 100644 --- a/src/generated/RoleManagement/Directory/RoleAssignments/Item/RoleDefinition/RoleDefinitionRequestBuilder.cs +++ b/src/generated/RoleManagement/Directory/RoleAssignments/Item/RoleDefinition/RoleDefinitionRequestBuilder.cs @@ -21,20 +21,28 @@ public class RoleDefinitionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded."; + command.Description = "The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,7 +76,7 @@ public RoleDefinitionRequestBuilder(Dictionary pathParameters, I RequestAdapter = requestAdapter; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -89,7 +97,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -100,7 +108,7 @@ public async Task GetAsync(Action q = var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/RoleManagement/Directory/RoleAssignments/Item/UnifiedRoleAssignmentRequestBuilder.cs b/src/generated/RoleManagement/Directory/RoleAssignments/Item/UnifiedRoleAssignmentRequestBuilder.cs index 404c6c7dae3..b3fb8f91b2c 100644 --- a/src/generated/RoleManagement/Directory/RoleAssignments/Item/UnifiedRoleAssignmentRequestBuilder.cs +++ b/src/generated/RoleManagement/Directory/RoleAssignments/Item/UnifiedRoleAssignmentRequestBuilder.cs @@ -38,10 +38,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Resource to grant access to users or groups."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,14 +64,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Resource to grant access to users or groups."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,14 +98,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Resource to grant access to users or groups."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--body")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/RoleManagement/Directory/RoleAssignments/RoleAssignmentsRequestBuilder.cs b/src/generated/RoleManagement/Directory/RoleAssignments/RoleAssignmentsRequestBuilder.cs index 745558ec40d..b31d16cf6d8 100644 --- a/src/generated/RoleManagement/Directory/RoleAssignments/RoleAssignmentsRequestBuilder.cs +++ b/src/generated/RoleManagement/Directory/RoleAssignments/RoleAssignmentsRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Resource to grant access to users or groups."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +67,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Resource to grant access to users or groups."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/RoleManagement/Directory/RoleDefinitions/Item/InheritsPermissionsFrom/InheritsPermissionsFromRequestBuilder.cs b/src/generated/RoleManagement/Directory/RoleDefinitions/Item/InheritsPermissionsFrom/InheritsPermissionsFromRequestBuilder.cs index a7b225b52fe..693052441cd 100644 --- a/src/generated/RoleManagement/Directory/RoleDefinitions/Item/InheritsPermissionsFrom/InheritsPermissionsFromRequestBuilder.cs +++ b/src/generated/RoleManagement/Directory/RoleDefinitions/Item/InheritsPermissionsFrom/InheritsPermissionsFromRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand."; + command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--body")); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,32 +60,53 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand."; + command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,7 +132,7 @@ public InheritsPermissionsFromRequestBuilder(Dictionary pathPara RequestAdapter = requestAdapter; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Request headers /// Request options /// Request query parameters @@ -128,7 +153,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// /// Request headers /// Request options @@ -146,7 +171,7 @@ public RequestInformation CreatePostRequestInformation(UnifiedRoleDefinition bod return requestInfo; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -158,7 +183,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -170,7 +195,7 @@ public async Task PostAsync(UnifiedRoleDefinition model, var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/RoleManagement/Directory/RoleDefinitions/Item/InheritsPermissionsFrom/Item/UnifiedRoleDefinitionRequestBuilder.cs b/src/generated/RoleManagement/Directory/RoleDefinitions/Item/InheritsPermissionsFrom/Item/UnifiedRoleDefinitionRequestBuilder.cs index 03dd4f6c0d3..6db5b0f0055 100644 --- a/src/generated/RoleManagement/Directory/RoleDefinitions/Item/InheritsPermissionsFrom/Item/UnifiedRoleDefinitionRequestBuilder.cs +++ b/src/generated/RoleManagement/Directory/RoleDefinitions/Item/InheritsPermissionsFrom/Item/UnifiedRoleDefinitionRequestBuilder.cs @@ -20,18 +20,21 @@ public class UnifiedRoleDefinitionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand."; + command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--unifiedroledefinition-id1", description: "key: id of unifiedRoleDefinition")); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); + var unifiedRoleDefinitionId1Option = new Option("--unifiedroledefinition-id1", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionId1Option.IsRequired = true; + command.AddOption(unifiedRoleDefinitionId1Option); command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, unifiedRoleDefinitionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId1)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id1", unifiedRoleDefinitionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand."; + command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--unifiedroledefinition-id1", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, unifiedRoleDefinitionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId1)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id1", unifiedRoleDefinitionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); + var unifiedRoleDefinitionId1Option = new Option("--unifiedroledefinition-id1", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionId1Option.IsRequired = true; + command.AddOption(unifiedRoleDefinitionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, unifiedRoleDefinitionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand."; + command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--unifiedroledefinition-id1", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--body")); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); + var unifiedRoleDefinitionId1Option = new Option("--unifiedroledefinition-id1", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionId1Option.IsRequired = true; + command.AddOption(unifiedRoleDefinitionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, unifiedRoleDefinitionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId1)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id1", unifiedRoleDefinitionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public UnifiedRoleDefinitionRequestBuilder(Dictionary pathParame RequestAdapter = requestAdapter; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(UnifiedRoleDefinition bo return requestInfo; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(UnifiedRoleDefinition model, ActionRead-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/RoleManagement/Directory/RoleDefinitions/Item/UnifiedRoleDefinitionRequestBuilder.cs b/src/generated/RoleManagement/Directory/RoleDefinitions/Item/UnifiedRoleDefinitionRequestBuilder.cs index 8a9a41d2136..5ee57f7d46a 100644 --- a/src/generated/RoleManagement/Directory/RoleDefinitions/Item/UnifiedRoleDefinitionRequestBuilder.cs +++ b/src/generated/RoleManagement/Directory/RoleDefinitions/Item/UnifiedRoleDefinitionRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Resource representing the roles allowed by RBAC providers and the permissions assigned to the roles."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Resource representing the roles allowed by RBAC providers and the permissions assigned to the roles."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Resource representing the roles allowed by RBAC providers and the permissions assigned to the roles."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--body")); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/RoleManagement/Directory/RoleDefinitions/RoleDefinitionsRequestBuilder.cs b/src/generated/RoleManagement/Directory/RoleDefinitions/RoleDefinitionsRequestBuilder.cs index 740036a3f82..c191c1b0543 100644 --- a/src/generated/RoleManagement/Directory/RoleDefinitions/RoleDefinitionsRequestBuilder.cs +++ b/src/generated/RoleManagement/Directory/RoleDefinitions/RoleDefinitionsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Resource representing the roles allowed by RBAC providers and the permissions assigned to the roles."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Resource representing the roles allowed by RBAC providers and the permissions assigned to the roles."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/RoleManagement/EntitlementManagement/EntitlementManagementRequestBuilder.cs b/src/generated/RoleManagement/EntitlementManagement/EntitlementManagementRequestBuilder.cs index b151e436caa..abcaa634660 100644 --- a/src/generated/RoleManagement/EntitlementManagement/EntitlementManagementRequestBuilder.cs +++ b/src/generated/RoleManagement/EntitlementManagement/EntitlementManagementRequestBuilder.cs @@ -22,14 +22,15 @@ public class EntitlementManagementRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The RbacApplication for Entitlement Management + /// Container for all entitlement management resources in Azure AD identity governance. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The RbacApplication for Entitlement Management"; + command.Description = "Container for all entitlement management resources in Azure AD identity governance."; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateDeleteRequestInformation(); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -37,18 +38,25 @@ public Command BuildDeleteCommand() { return command; } /// - /// The RbacApplication for Entitlement Management + /// Container for all entitlement management resources in Azure AD identity governance. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The RbacApplication for Entitlement Management"; + command.Description = "Container for all entitlement management resources in Azure AD identity governance."; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,18 +69,21 @@ public Command BuildGetCommand() { return command; } /// - /// The RbacApplication for Entitlement Management + /// Container for all entitlement management resources in Azure AD identity governance. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The RbacApplication for Entitlement Management"; + command.Description = "Container for all entitlement management resources in Azure AD identity governance."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -107,7 +118,7 @@ public EntitlementManagementRequestBuilder(Dictionary pathParame RequestAdapter = requestAdapter; } /// - /// The RbacApplication for Entitlement Management + /// Container for all entitlement management resources in Azure AD identity governance. /// Request headers /// Request options /// @@ -122,7 +133,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The RbacApplication for Entitlement Management + /// Container for all entitlement management resources in Azure AD identity governance. /// Request headers /// Request options /// Request query parameters @@ -143,7 +154,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The RbacApplication for Entitlement Management + /// Container for all entitlement management resources in Azure AD identity governance. /// /// Request headers /// Request options @@ -161,7 +172,7 @@ public RequestInformation CreatePatchRequestInformation(RbacApplication body, Ac return requestInfo; } /// - /// The RbacApplication for Entitlement Management + /// Container for all entitlement management resources in Azure AD identity governance. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -172,7 +183,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The RbacApplication for Entitlement Management + /// Container for all entitlement management resources in Azure AD identity governance. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -184,7 +195,7 @@ public async Task GetAsync(Action q = defau return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The RbacApplication for Entitlement Management + /// Container for all entitlement management resources in Azure AD identity governance. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -196,7 +207,7 @@ public async Task PatchAsync(RbacApplication model, ActionThe RbacApplication for Entitlement Management + /// Container for all entitlement management resources in Azure AD identity governance. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/AppScope/AppScopeRequestBuilder.cs b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/AppScope/AppScopeRequestBuilder.cs index b471f85c275..1e2cca81c73 100644 --- a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/AppScope/AppScopeRequestBuilder.cs +++ b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/AppScope/AppScopeRequestBuilder.cs @@ -20,16 +20,18 @@ public class AppScopeRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand."; + command.Description = "Details of the app specific scope when the assignment scope is app specific. Containment entity."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -37,20 +39,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand."; + command.Description = "Details of the app specific scope when the assignment scope is app specific. Containment entity."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,20 +73,24 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand."; + command.Description = "Details of the app specific scope when the assignment scope is app specific. Containment entity."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--body")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -97,7 +111,7 @@ public AppScopeRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// Request headers /// Request options /// @@ -112,7 +126,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// Request headers /// Request options /// Request query parameters @@ -133,7 +147,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// /// Request headers /// Request options @@ -151,7 +165,7 @@ public RequestInformation CreatePatchRequestInformation(ApiSdk.Models.Microsoft. return requestInfo; } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +176,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +188,7 @@ public async Task DeleteAsync(Action> h = default, I return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -186,7 +200,7 @@ public async Task PatchAsync(ApiSdk.Models.Microsoft.Graph.AppScope model, Actio var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// Read-only property with details of the app specific scope when the assignment scope is app specific. Containment entity. Supports $expand. + /// Details of the app specific scope when the assignment scope is app specific. Containment entity. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/DirectoryScope/@Ref/RefRequestBuilder.cs b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/DirectoryScope/@Ref/RefRequestBuilder.cs index 62faf8fd1e1..bed5d2714db 100644 --- a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/DirectoryScope/@Ref/RefRequestBuilder.cs +++ b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/DirectoryScope/@Ref/RefRequestBuilder.cs @@ -19,16 +19,18 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The directory object that is the scope of the assignment. Read-only. Supports $expand."; + command.Description = "The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -36,16 +38,18 @@ public Command BuildDeleteCommand() { return command; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The directory object that is the scope of the assignment. Read-only. Supports $expand."; + command.Description = "The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,20 +62,24 @@ public Command BuildGetCommand() { return command; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The directory object that is the scope of the assignment. Read-only. Supports $expand."; + command.Description = "The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--body")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -92,7 +100,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Request headers /// Request options /// @@ -107,7 +115,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Request headers /// Request options /// @@ -122,7 +130,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// /// Request headers /// Request options @@ -140,7 +148,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.RoleManagement.Enti return requestInfo; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -151,7 +159,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +170,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/DirectoryScope/DirectoryScopeRequestBuilder.cs b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/DirectoryScope/DirectoryScopeRequestBuilder.cs index 30bbb765de2..20013bccaa0 100644 --- a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/DirectoryScope/DirectoryScopeRequestBuilder.cs +++ b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/DirectoryScope/DirectoryScopeRequestBuilder.cs @@ -21,20 +21,28 @@ public class DirectoryScopeRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The directory object that is the scope of the assignment. Read-only. Supports $expand."; + command.Description = "The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,7 +76,7 @@ public DirectoryScopeRequestBuilder(Dictionary pathParameters, I RequestAdapter = requestAdapter; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -89,7 +97,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -100,7 +108,7 @@ public async Task GetAsync(Action q = defau var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The directory object that is the scope of the assignment. Read-only. Supports $expand. + /// The directory object that is the scope of the assignment. Provided so that callers can get the directory object using $expand at the same time as getting the role assignment. Read-only. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/Principal/@Ref/RefRequestBuilder.cs b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/Principal/@Ref/RefRequestBuilder.cs index 4cf5e6dc6d2..95bfd5467aa 100644 --- a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/Principal/@Ref/RefRequestBuilder.cs +++ b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/Principal/@Ref/RefRequestBuilder.cs @@ -19,16 +19,18 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Referencing the assigned principal. Read-only. Supports $expand."; + command.Description = "The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -36,16 +38,18 @@ public Command BuildDeleteCommand() { return command; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Referencing the assigned principal. Read-only. Supports $expand."; + command.Description = "The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,20 +62,24 @@ public Command BuildGetCommand() { return command; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "Referencing the assigned principal. Read-only. Supports $expand."; + command.Description = "The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--body")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -92,7 +100,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Request headers /// Request options /// @@ -107,7 +115,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Request headers /// Request options /// @@ -122,7 +130,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// /// Request headers /// Request options @@ -140,7 +148,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.RoleManagement.Enti return requestInfo; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -151,7 +159,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +170,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/Principal/PrincipalRequestBuilder.cs b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/Principal/PrincipalRequestBuilder.cs index aa6dbdd848f..4c94467332c 100644 --- a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/Principal/PrincipalRequestBuilder.cs +++ b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/Principal/PrincipalRequestBuilder.cs @@ -21,20 +21,28 @@ public class PrincipalRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Referencing the assigned principal. Read-only. Supports $expand."; + command.Description = "The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,7 +76,7 @@ public PrincipalRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -89,7 +97,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -100,7 +108,7 @@ public async Task GetAsync(Action q = defau var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Referencing the assigned principal. Read-only. Supports $expand. + /// The assigned principal. Provided so that callers can get the principal using $expand at the same time as getting the role assignment. Read-only. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/RoleDefinition/@Ref/RefRequestBuilder.cs b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/RoleDefinition/@Ref/RefRequestBuilder.cs index d69662dbedb..37e806d6b0c 100644 --- a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/RoleDefinition/@Ref/RefRequestBuilder.cs +++ b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/RoleDefinition/@Ref/RefRequestBuilder.cs @@ -19,16 +19,18 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded."; + command.Description = "The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -36,16 +38,18 @@ public Command BuildDeleteCommand() { return command; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded."; + command.Description = "The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,20 +62,24 @@ public Command BuildGetCommand() { return command; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded."; + command.Description = "The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--body")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -92,7 +100,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// Request headers /// Request options /// @@ -107,7 +115,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// Request headers /// Request options /// @@ -122,7 +130,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// /// Request headers /// Request options @@ -140,7 +148,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.RoleManagement.Enti return requestInfo; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -151,7 +159,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +170,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/RoleDefinition/RoleDefinitionRequestBuilder.cs b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/RoleDefinition/RoleDefinitionRequestBuilder.cs index 998fba838f2..38cba0e8e36 100644 --- a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/RoleDefinition/RoleDefinitionRequestBuilder.cs +++ b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/RoleDefinition/RoleDefinitionRequestBuilder.cs @@ -21,20 +21,28 @@ public class RoleDefinitionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded."; + command.Description = "The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,7 +76,7 @@ public RoleDefinitionRequestBuilder(Dictionary pathParameters, I RequestAdapter = requestAdapter; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -89,7 +97,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -100,7 +108,7 @@ public async Task GetAsync(Action q = var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. + /// The roleDefinition the assignment is for. Provided so that callers can get the role definition using $expand at the same time as getting the role assignment. roleDefinition.id will be auto expanded. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/UnifiedRoleAssignmentRequestBuilder.cs b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/UnifiedRoleAssignmentRequestBuilder.cs index f89c09e50cb..b2699140d15 100644 --- a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/UnifiedRoleAssignmentRequestBuilder.cs +++ b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/Item/UnifiedRoleAssignmentRequestBuilder.cs @@ -38,10 +38,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Resource to grant access to users or groups."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,14 +64,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Resource to grant access to users or groups."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,14 +98,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Resource to grant access to users or groups."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment")); - command.AddOption(new Option("--body")); + var unifiedRoleAssignmentIdOption = new Option("--unifiedroleassignment-id", description: "key: id of unifiedRoleAssignment"); + unifiedRoleAssignmentIdOption.IsRequired = true; + command.AddOption(unifiedRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleAssignmentId)) requestInfo.PathParameters.Add("unifiedRoleAssignment_id", unifiedRoleAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/RoleAssignmentsRequestBuilder.cs b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/RoleAssignmentsRequestBuilder.cs index 154c21fcc52..b1cbc61145c 100644 --- a/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/RoleAssignmentsRequestBuilder.cs +++ b/src/generated/RoleManagement/EntitlementManagement/RoleAssignments/RoleAssignmentsRequestBuilder.cs @@ -40,12 +40,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Resource to grant access to users or groups."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +67,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Resource to grant access to users or groups."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/Item/InheritsPermissionsFrom/InheritsPermissionsFromRequestBuilder.cs b/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/Item/InheritsPermissionsFrom/InheritsPermissionsFromRequestBuilder.cs index 6a657b3007f..5387f86b95b 100644 --- a/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/Item/InheritsPermissionsFrom/InheritsPermissionsFromRequestBuilder.cs +++ b/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/Item/InheritsPermissionsFrom/InheritsPermissionsFromRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand."; + command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--body")); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,32 +60,53 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand."; + command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,7 +132,7 @@ public InheritsPermissionsFromRequestBuilder(Dictionary pathPara RequestAdapter = requestAdapter; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Request headers /// Request options /// Request query parameters @@ -128,7 +153,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// /// Request headers /// Request options @@ -146,7 +171,7 @@ public RequestInformation CreatePostRequestInformation(UnifiedRoleDefinition bod return requestInfo; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -158,7 +183,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -170,7 +195,7 @@ public async Task PostAsync(UnifiedRoleDefinition model, var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/Item/InheritsPermissionsFrom/Item/UnifiedRoleDefinitionRequestBuilder.cs b/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/Item/InheritsPermissionsFrom/Item/UnifiedRoleDefinitionRequestBuilder.cs index f7f3ffb70fe..e71bd84f601 100644 --- a/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/Item/InheritsPermissionsFrom/Item/UnifiedRoleDefinitionRequestBuilder.cs +++ b/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/Item/InheritsPermissionsFrom/Item/UnifiedRoleDefinitionRequestBuilder.cs @@ -20,18 +20,21 @@ public class UnifiedRoleDefinitionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand."; + command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--unifiedroledefinition-id1", description: "key: id of unifiedRoleDefinition")); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); + var unifiedRoleDefinitionId1Option = new Option("--unifiedroledefinition-id1", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionId1Option.IsRequired = true; + command.AddOption(unifiedRoleDefinitionId1Option); command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, unifiedRoleDefinitionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId1)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id1", unifiedRoleDefinitionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand."; + command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--unifiedroledefinition-id1", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, unifiedRoleDefinitionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId1)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id1", unifiedRoleDefinitionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); + var unifiedRoleDefinitionId1Option = new Option("--unifiedroledefinition-id1", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionId1Option.IsRequired = true; + command.AddOption(unifiedRoleDefinitionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, unifiedRoleDefinitionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand."; + command.Description = "Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--unifiedroledefinition-id1", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--body")); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); + var unifiedRoleDefinitionId1Option = new Option("--unifiedroledefinition-id1", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionId1Option.IsRequired = true; + command.AddOption(unifiedRoleDefinitionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, unifiedRoleDefinitionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId1)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id1", unifiedRoleDefinitionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public UnifiedRoleDefinitionRequestBuilder(Dictionary pathParame RequestAdapter = requestAdapter; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(UnifiedRoleDefinition bo return requestInfo; } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(UnifiedRoleDefinition model, ActionRead-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand. + /// Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles support this attribute. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/Item/UnifiedRoleDefinitionRequestBuilder.cs b/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/Item/UnifiedRoleDefinitionRequestBuilder.cs index 6d2b2a6da62..9548ba0b25c 100644 --- a/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/Item/UnifiedRoleDefinitionRequestBuilder.cs +++ b/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/Item/UnifiedRoleDefinitionRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Resource representing the roles allowed by RBAC providers and the permissions assigned to the roles."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Resource representing the roles allowed by RBAC providers and the permissions assigned to the roles."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Resource representing the roles allowed by RBAC providers and the permissions assigned to the roles."; // Create options for all the parameters - command.AddOption(new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition")); - command.AddOption(new Option("--body")); + var unifiedRoleDefinitionIdOption = new Option("--unifiedroledefinition-id", description: "key: id of unifiedRoleDefinition"); + unifiedRoleDefinitionIdOption.IsRequired = true; + command.AddOption(unifiedRoleDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (unifiedRoleDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(unifiedRoleDefinitionId)) requestInfo.PathParameters.Add("unifiedRoleDefinition_id", unifiedRoleDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/RoleDefinitionsRequestBuilder.cs b/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/RoleDefinitionsRequestBuilder.cs index 366fed3cb9d..b0a24219ae8 100644 --- a/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/RoleDefinitionsRequestBuilder.cs +++ b/src/generated/RoleManagement/EntitlementManagement/RoleDefinitions/RoleDefinitionsRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Resource representing the roles allowed by RBAC providers and the permissions assigned to the roles."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,24 +64,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Resource representing the roles allowed by RBAC providers and the permissions assigned to the roles."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/RoleManagement/RoleManagementRequestBuilder.cs b/src/generated/RoleManagement/RoleManagementRequestBuilder.cs index 6e3a8a369d6..464fb1006fa 100644 --- a/src/generated/RoleManagement/RoleManagementRequestBuilder.cs +++ b/src/generated/RoleManagement/RoleManagementRequestBuilder.cs @@ -48,12 +48,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get roleManagement"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,12 +79,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update roleManagement"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/SchemaExtensions/Item/SchemaExtensionRequestBuilder.cs b/src/generated/SchemaExtensions/Item/SchemaExtensionRequestBuilder.cs index 4440e07ee63..425123ff183 100644 --- a/src/generated/SchemaExtensions/Item/SchemaExtensionRequestBuilder.cs +++ b/src/generated/SchemaExtensions/Item/SchemaExtensionRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from schemaExtensions"; // Create options for all the parameters - command.AddOption(new Option("--schemaextension-id", description: "key: id of schemaExtension")); + var schemaExtensionIdOption = new Option("--schemaextension-id", description: "key: id of schemaExtension"); + schemaExtensionIdOption.IsRequired = true; + command.AddOption(schemaExtensionIdOption); command.Handler = CommandHandler.Create(async (schemaExtensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(schemaExtensionId)) requestInfo.PathParameters.Add("schemaExtension_id", schemaExtensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from schemaExtensions by key"; // Create options for all the parameters - command.AddOption(new Option("--schemaextension-id", description: "key: id of schemaExtension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (schemaExtensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(schemaExtensionId)) requestInfo.PathParameters.Add("schemaExtension_id", schemaExtensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var schemaExtensionIdOption = new Option("--schemaextension-id", description: "key: id of schemaExtension"); + schemaExtensionIdOption.IsRequired = true; + command.AddOption(schemaExtensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (schemaExtensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in schemaExtensions"; // Create options for all the parameters - command.AddOption(new Option("--schemaextension-id", description: "key: id of schemaExtension")); - command.AddOption(new Option("--body")); + var schemaExtensionIdOption = new Option("--schemaextension-id", description: "key: id of schemaExtension"); + schemaExtensionIdOption.IsRequired = true; + command.AddOption(schemaExtensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (schemaExtensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(schemaExtensionId)) requestInfo.PathParameters.Add("schemaExtension_id", schemaExtensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/SchemaExtensions/SchemaExtensionsRequestBuilder.cs b/src/generated/SchemaExtensions/SchemaExtensionsRequestBuilder.cs index ddc07840413..bcba8c51eee 100644 --- a/src/generated/SchemaExtensions/SchemaExtensionsRequestBuilder.cs +++ b/src/generated/SchemaExtensions/SchemaExtensionsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to schemaExtensions"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from schemaExtensions"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ScopedRoleMemberships/Item/ScopedRoleMembershipRequestBuilder.cs b/src/generated/ScopedRoleMemberships/Item/ScopedRoleMembershipRequestBuilder.cs index 4150c69bca4..0eaed663afb 100644 --- a/src/generated/ScopedRoleMemberships/Item/ScopedRoleMembershipRequestBuilder.cs +++ b/src/generated/ScopedRoleMemberships/Item/ScopedRoleMembershipRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from scopedRoleMemberships"; // Create options for all the parameters - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); command.Handler = CommandHandler.Create(async (scopedRoleMembershipId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from scopedRoleMemberships by key"; // Create options for all the parameters - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (scopedRoleMembershipId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (scopedRoleMembershipId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in scopedRoleMemberships"; // Create options for all the parameters - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); - command.AddOption(new Option("--body")); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (scopedRoleMembershipId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/ScopedRoleMemberships/ScopedRoleMembershipsRequestBuilder.cs b/src/generated/ScopedRoleMemberships/ScopedRoleMembershipsRequestBuilder.cs index 032a7f2e42f..c85a5f422aa 100644 --- a/src/generated/ScopedRoleMemberships/ScopedRoleMembershipsRequestBuilder.cs +++ b/src/generated/ScopedRoleMemberships/ScopedRoleMembershipsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to scopedRoleMemberships"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from scopedRoleMemberships"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Search/Query/QueryRequestBuilder.cs b/src/generated/Search/Query/QueryRequestBuilder.cs index b946c8dc4f9..2e88bd0a698 100644 --- a/src/generated/Search/Query/QueryRequestBuilder.cs +++ b/src/generated/Search/Query/QueryRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action query"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Search/SearchRequestBuilder.cs b/src/generated/Search/SearchRequestBuilder.cs index afa29400788..f44c76d27f4 100644 --- a/src/generated/Search/SearchRequestBuilder.cs +++ b/src/generated/Search/SearchRequestBuilder.cs @@ -27,12 +27,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get search"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -51,12 +58,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update search"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Security/Alerts/AlertsRequestBuilder.cs b/src/generated/Security/Alerts/AlertsRequestBuilder.cs index 95582ac5e1f..a5af9a07a2a 100644 --- a/src/generated/Security/Alerts/AlertsRequestBuilder.cs +++ b/src/generated/Security/Alerts/AlertsRequestBuilder.cs @@ -30,18 +30,21 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable."; + command.Description = "Notifications for suspicious or potential security issues in a customer’s tenant."; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -54,30 +57,50 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable."; + command.Description = "Notifications for suspicious or potential security issues in a customer’s tenant."; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -103,7 +126,7 @@ public AlertsRequestBuilder(Dictionary pathParameters, IRequestA RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// Request headers /// Request options /// Request query parameters @@ -124,7 +147,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// /// Request headers /// Request options @@ -142,7 +165,7 @@ public RequestInformation CreatePostRequestInformation(Alert body, Action - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -154,7 +177,7 @@ public async Task GetAsync(Action q = defaul return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -166,7 +189,7 @@ public async Task PostAsync(Alert model, Action(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Security/Alerts/Item/AlertRequestBuilder.cs b/src/generated/Security/Alerts/Item/AlertRequestBuilder.cs index f8ce61bbe60..13eaedf86a6 100644 --- a/src/generated/Security/Alerts/Item/AlertRequestBuilder.cs +++ b/src/generated/Security/Alerts/Item/AlertRequestBuilder.cs @@ -20,16 +20,18 @@ public class AlertRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable."; + command.Description = "Notifications for suspicious or potential security issues in a customer’s tenant."; // Create options for all the parameters - command.AddOption(new Option("--alert-id", description: "key: id of alert")); + var alertIdOption = new Option("--alert-id", description: "key: id of alert"); + alertIdOption.IsRequired = true; + command.AddOption(alertIdOption); command.Handler = CommandHandler.Create(async (alertId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(alertId)) requestInfo.PathParameters.Add("alert_id", alertId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -37,20 +39,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable."; + command.Description = "Notifications for suspicious or potential security issues in a customer’s tenant."; // Create options for all the parameters - command.AddOption(new Option("--alert-id", description: "key: id of alert")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (alertId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(alertId)) requestInfo.PathParameters.Add("alert_id", alertId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var alertIdOption = new Option("--alert-id", description: "key: id of alert"); + alertIdOption.IsRequired = true; + command.AddOption(alertIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (alertId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,20 +73,24 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable."; + command.Description = "Notifications for suspicious or potential security issues in a customer’s tenant."; // Create options for all the parameters - command.AddOption(new Option("--alert-id", description: "key: id of alert")); - command.AddOption(new Option("--body")); + var alertIdOption = new Option("--alert-id", description: "key: id of alert"); + alertIdOption.IsRequired = true; + command.AddOption(alertIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (alertId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(alertId)) requestInfo.PathParameters.Add("alert_id", alertId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -97,7 +111,7 @@ public AlertRequestBuilder(Dictionary pathParameters, IRequestAd RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// Request headers /// Request options /// @@ -112,7 +126,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// Request headers /// Request options /// Request query parameters @@ -133,7 +147,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// /// Request headers /// Request options @@ -151,7 +165,7 @@ public RequestInformation CreatePatchRequestInformation(Alert body, Action - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +176,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +188,7 @@ public async Task GetAsync(Action q = default, Action return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -186,7 +200,7 @@ public async Task PatchAsync(Alert model, Action> h var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. + /// Notifications for suspicious or potential security issues in a customer’s tenant. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Security/SecureScoreControlProfiles/Item/SecureScoreControlProfileRequestBuilder.cs b/src/generated/Security/SecureScoreControlProfiles/Item/SecureScoreControlProfileRequestBuilder.cs index fa002db146b..7c58dfd7772 100644 --- a/src/generated/Security/SecureScoreControlProfiles/Item/SecureScoreControlProfileRequestBuilder.cs +++ b/src/generated/Security/SecureScoreControlProfiles/Item/SecureScoreControlProfileRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property secureScoreControlProfiles for security"; // Create options for all the parameters - command.AddOption(new Option("--securescorecontrolprofile-id", description: "key: id of secureScoreControlProfile")); + var secureScoreControlProfileIdOption = new Option("--securescorecontrolprofile-id", description: "key: id of secureScoreControlProfile"); + secureScoreControlProfileIdOption.IsRequired = true; + command.AddOption(secureScoreControlProfileIdOption); command.Handler = CommandHandler.Create(async (secureScoreControlProfileId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(secureScoreControlProfileId)) requestInfo.PathParameters.Add("secureScoreControlProfile_id", secureScoreControlProfileId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get secureScoreControlProfiles from security"; // Create options for all the parameters - command.AddOption(new Option("--securescorecontrolprofile-id", description: "key: id of secureScoreControlProfile")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (secureScoreControlProfileId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(secureScoreControlProfileId)) requestInfo.PathParameters.Add("secureScoreControlProfile_id", secureScoreControlProfileId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var secureScoreControlProfileIdOption = new Option("--securescorecontrolprofile-id", description: "key: id of secureScoreControlProfile"); + secureScoreControlProfileIdOption.IsRequired = true; + command.AddOption(secureScoreControlProfileIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (secureScoreControlProfileId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property secureScoreControlProfiles in security"; // Create options for all the parameters - command.AddOption(new Option("--securescorecontrolprofile-id", description: "key: id of secureScoreControlProfile")); - command.AddOption(new Option("--body")); + var secureScoreControlProfileIdOption = new Option("--securescorecontrolprofile-id", description: "key: id of secureScoreControlProfile"); + secureScoreControlProfileIdOption.IsRequired = true; + command.AddOption(secureScoreControlProfileIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (secureScoreControlProfileId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(secureScoreControlProfileId)) requestInfo.PathParameters.Add("secureScoreControlProfile_id", secureScoreControlProfileId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Security/SecureScoreControlProfiles/SecureScoreControlProfilesRequestBuilder.cs b/src/generated/Security/SecureScoreControlProfiles/SecureScoreControlProfilesRequestBuilder.cs index 9c6127da7a0..21fec3ac2c2 100644 --- a/src/generated/Security/SecureScoreControlProfiles/SecureScoreControlProfilesRequestBuilder.cs +++ b/src/generated/Security/SecureScoreControlProfiles/SecureScoreControlProfilesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to secureScoreControlProfiles for security"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get secureScoreControlProfiles from security"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Security/SecureScores/Item/SecureScoreRequestBuilder.cs b/src/generated/Security/SecureScores/Item/SecureScoreRequestBuilder.cs index 3bc6276a79c..78e670c613f 100644 --- a/src/generated/Security/SecureScores/Item/SecureScoreRequestBuilder.cs +++ b/src/generated/Security/SecureScores/Item/SecureScoreRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property secureScores for security"; // Create options for all the parameters - command.AddOption(new Option("--securescore-id", description: "key: id of secureScore")); + var secureScoreIdOption = new Option("--securescore-id", description: "key: id of secureScore"); + secureScoreIdOption.IsRequired = true; + command.AddOption(secureScoreIdOption); command.Handler = CommandHandler.Create(async (secureScoreId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(secureScoreId)) requestInfo.PathParameters.Add("secureScore_id", secureScoreId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get secureScores from security"; // Create options for all the parameters - command.AddOption(new Option("--securescore-id", description: "key: id of secureScore")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (secureScoreId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(secureScoreId)) requestInfo.PathParameters.Add("secureScore_id", secureScoreId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var secureScoreIdOption = new Option("--securescore-id", description: "key: id of secureScore"); + secureScoreIdOption.IsRequired = true; + command.AddOption(secureScoreIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (secureScoreId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property secureScores in security"; // Create options for all the parameters - command.AddOption(new Option("--securescore-id", description: "key: id of secureScore")); - command.AddOption(new Option("--body")); + var secureScoreIdOption = new Option("--securescore-id", description: "key: id of secureScore"); + secureScoreIdOption.IsRequired = true; + command.AddOption(secureScoreIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (secureScoreId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(secureScoreId)) requestInfo.PathParameters.Add("secureScore_id", secureScoreId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Security/SecureScores/SecureScoresRequestBuilder.cs b/src/generated/Security/SecureScores/SecureScoresRequestBuilder.cs index 6c03fb84bb8..9442cfe2af5 100644 --- a/src/generated/Security/SecureScores/SecureScoresRequestBuilder.cs +++ b/src/generated/Security/SecureScores/SecureScoresRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to secureScores for security"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get secureScores from security"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Security/SecurityRequestBuilder.cs b/src/generated/Security/SecurityRequestBuilder.cs index b01f4a2309d..46cf4186849 100644 --- a/src/generated/Security/SecurityRequestBuilder.cs +++ b/src/generated/Security/SecurityRequestBuilder.cs @@ -36,12 +36,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get security"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,12 +67,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update security"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/ServicePrincipals/Delta/DeltaRequestBuilder.cs b/src/generated/ServicePrincipals/Delta/DeltaRequestBuilder.cs index 265c9a88128..0e127c5fe5a 100644 --- a/src/generated/ServicePrincipals/Delta/DeltaRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs b/src/generated/ServicePrincipals/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs index c52873b5f9f..9b9f737cfc5 100644 --- a/src/generated/ServicePrincipals/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs +++ b/src/generated/ServicePrincipals/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getAvailableExtensionProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/GetByIds/GetByIdsRequestBuilder.cs b/src/generated/ServicePrincipals/GetByIds/GetByIdsRequestBuilder.cs index 6f8dfeff4f4..94701325d6e 100644 --- a/src/generated/ServicePrincipals/GetByIds/GetByIdsRequestBuilder.cs +++ b/src/generated/ServicePrincipals/GetByIds/GetByIdsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getByIds"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/AddKey/AddKeyRequestBuilder.cs b/src/generated/ServicePrincipals/Item/AddKey/AddKeyRequestBuilder.cs index 77d8e1df3ff..a8029d7b470 100644 --- a/src/generated/ServicePrincipals/Item/AddKey/AddKeyRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/AddKey/AddKeyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addKey"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/AddPassword/AddPasswordRequestBuilder.cs b/src/generated/ServicePrincipals/Item/AddPassword/AddPasswordRequestBuilder.cs index 477adc8ac82..15ade99b365 100644 --- a/src/generated/ServicePrincipals/Item/AddPassword/AddPasswordRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/AddPassword/AddPasswordRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addPassword"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/AppRoleAssignedTo/AppRoleAssignedToRequestBuilder.cs b/src/generated/ServicePrincipals/Item/AppRoleAssignedTo/AppRoleAssignedToRequestBuilder.cs index 3d006fd7ce7..99536deee60 100644 --- a/src/generated/ServicePrincipals/Item/AppRoleAssignedTo/AppRoleAssignedToRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/AppRoleAssignedTo/AppRoleAssignedToRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand."; + command.Description = "App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,32 +60,53 @@ public Command BuildCreateCommand() { return command; } /// - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand."; + command.Description = "App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,7 +132,7 @@ public AppRoleAssignedToRequestBuilder(Dictionary pathParameters RequestAdapter = requestAdapter; } /// - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -128,7 +153,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// /// Request headers /// Request options @@ -146,7 +171,7 @@ public RequestInformation CreatePostRequestInformation(AppRoleAssignment body, A return requestInfo; } /// - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -158,7 +183,7 @@ public async Task GetAsync(Action return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -170,7 +195,7 @@ public async Task PostAsync(AppRoleAssignment model, Action(requestInfo, responseHandler, cancellationToken); } - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/ServicePrincipals/Item/AppRoleAssignedTo/Item/AppRoleAssignmentRequestBuilder.cs b/src/generated/ServicePrincipals/Item/AppRoleAssignedTo/Item/AppRoleAssignmentRequestBuilder.cs index 19a5561c94f..b9cfdc63155 100644 --- a/src/generated/ServicePrincipals/Item/AppRoleAssignedTo/Item/AppRoleAssignmentRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/AppRoleAssignedTo/Item/AppRoleAssignmentRequestBuilder.cs @@ -20,18 +20,21 @@ public class AppRoleAssignmentRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand."; + command.Description = "App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, appRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand."; + command.Description = "App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, appRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, appRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand."; + command.Description = "App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, appRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public AppRoleAssignmentRequestBuilder(Dictionary pathParameters RequestAdapter = requestAdapter; } /// - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(AppRoleAssignment body, return requestInfo; } /// - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = def return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// App role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(AppRoleAssignment model, ActionApp role assignments for this app or service, granted to users, groups, and other service principals. Supports $expand. + /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/ServicePrincipals/Item/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs b/src/generated/ServicePrincipals/Item/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs index 4e845df1436..984ccd3bada 100644 --- a/src/generated/ServicePrincipals/Item/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "App role assignment for another app or service, granted to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "App role assignment for another app or service, granted to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs b/src/generated/ServicePrincipals/Item/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs index d0b5aed0d2b..874402df2bc 100644 --- a/src/generated/ServicePrincipals/Item/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "App role assignment for another app or service, granted to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, appRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "App role assignment for another app or service, granted to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, appRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, appRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "App role assignment for another app or service, granted to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, appRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/ServicePrincipals/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs b/src/generated/ServicePrincipals/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs index 4f818a470f0..bc52e038949 100644 --- a/src/generated/ServicePrincipals/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs b/src/generated/ServicePrincipals/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs index d24452eab16..a0dd035fc10 100644 --- a/src/generated/ServicePrincipals/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/ClaimsMappingPolicies/@Ref/RefRequestBuilder.cs b/src/generated/ServicePrincipals/Item/ClaimsMappingPolicies/@Ref/RefRequestBuilder.cs index cdc9db02c0a..4533334acf9 100644 --- a/src/generated/ServicePrincipals/Item/ClaimsMappingPolicies/@Ref/RefRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/ClaimsMappingPolicies/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The claimsMappingPolicies assigned to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The claimsMappingPolicies assigned to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/ClaimsMappingPolicies/ClaimsMappingPoliciesRequestBuilder.cs b/src/generated/ServicePrincipals/Item/ClaimsMappingPolicies/ClaimsMappingPoliciesRequestBuilder.cs index 74262aaf8bb..b03c195d325 100644 --- a/src/generated/ServicePrincipals/Item/ClaimsMappingPolicies/ClaimsMappingPoliciesRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/ClaimsMappingPolicies/ClaimsMappingPoliciesRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The claimsMappingPolicies assigned to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/CreatedObjects/@Ref/RefRequestBuilder.cs b/src/generated/ServicePrincipals/Item/CreatedObjects/@Ref/RefRequestBuilder.cs index 8f2563b4324..5c066b369fb 100644 --- a/src/generated/ServicePrincipals/Item/CreatedObjects/@Ref/RefRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/CreatedObjects/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects created by this service principal. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Directory objects created by this service principal. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/CreatedObjects/CreatedObjectsRequestBuilder.cs b/src/generated/ServicePrincipals/Item/CreatedObjects/CreatedObjectsRequestBuilder.cs index d381bd81f6e..499672ef61d 100644 --- a/src/generated/ServicePrincipals/Item/CreatedObjects/CreatedObjectsRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/CreatedObjects/CreatedObjectsRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects created by this service principal. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/DelegatedPermissionClassifications/DelegatedPermissionClassificationsRequestBuilder.cs b/src/generated/ServicePrincipals/Item/DelegatedPermissionClassifications/DelegatedPermissionClassificationsRequestBuilder.cs index 92d2d794ad3..9760d641024 100644 --- a/src/generated/ServicePrincipals/Item/DelegatedPermissionClassifications/DelegatedPermissionClassificationsRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/DelegatedPermissionClassifications/DelegatedPermissionClassificationsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/DelegatedPermissionClassifications/Item/DelegatedPermissionClassificationRequestBuilder.cs b/src/generated/ServicePrincipals/Item/DelegatedPermissionClassifications/Item/DelegatedPermissionClassificationRequestBuilder.cs index 60423783968..8fd81ff4c9b 100644 --- a/src/generated/ServicePrincipals/Item/DelegatedPermissionClassifications/Item/DelegatedPermissionClassificationRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/DelegatedPermissionClassifications/Item/DelegatedPermissionClassificationRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--delegatedpermissionclassification-id", description: "key: id of delegatedPermissionClassification")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var delegatedPermissionClassificationIdOption = new Option("--delegatedpermissionclassification-id", description: "key: id of delegatedPermissionClassification"); + delegatedPermissionClassificationIdOption.IsRequired = true; + command.AddOption(delegatedPermissionClassificationIdOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, delegatedPermissionClassificationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - if (!String.IsNullOrEmpty(delegatedPermissionClassificationId)) requestInfo.PathParameters.Add("delegatedPermissionClassification_id", delegatedPermissionClassificationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--delegatedpermissionclassification-id", description: "key: id of delegatedPermissionClassification")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, delegatedPermissionClassificationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - if (!String.IsNullOrEmpty(delegatedPermissionClassificationId)) requestInfo.PathParameters.Add("delegatedPermissionClassification_id", delegatedPermissionClassificationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var delegatedPermissionClassificationIdOption = new Option("--delegatedpermissionclassification-id", description: "key: id of delegatedPermissionClassification"); + delegatedPermissionClassificationIdOption.IsRequired = true; + command.AddOption(delegatedPermissionClassificationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, delegatedPermissionClassificationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--delegatedpermissionclassification-id", description: "key: id of delegatedPermissionClassification")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var delegatedPermissionClassificationIdOption = new Option("--delegatedpermissionclassification-id", description: "key: id of delegatedPermissionClassification"); + delegatedPermissionClassificationIdOption.IsRequired = true; + command.AddOption(delegatedPermissionClassificationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, delegatedPermissionClassificationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - if (!String.IsNullOrEmpty(delegatedPermissionClassificationId)) requestInfo.PathParameters.Add("delegatedPermissionClassification_id", delegatedPermissionClassificationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/ServicePrincipals/Item/Endpoints/EndpointsRequestBuilder.cs b/src/generated/ServicePrincipals/Item/Endpoints/EndpointsRequestBuilder.cs index 9cae9ff764a..44766448589 100644 --- a/src/generated/ServicePrincipals/Item/Endpoints/EndpointsRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/Endpoints/EndpointsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/Endpoints/Item/EndpointRequestBuilder.cs b/src/generated/ServicePrincipals/Item/Endpoints/Item/EndpointRequestBuilder.cs index f606198f8b1..44fa6b5bec7 100644 --- a/src/generated/ServicePrincipals/Item/Endpoints/Item/EndpointRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/Endpoints/Item/EndpointRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--endpoint-id", description: "key: id of endpoint")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var endpointIdOption = new Option("--endpoint-id", description: "key: id of endpoint"); + endpointIdOption.IsRequired = true; + command.AddOption(endpointIdOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, endpointId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - if (!String.IsNullOrEmpty(endpointId)) requestInfo.PathParameters.Add("endpoint_id", endpointId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--endpoint-id", description: "key: id of endpoint")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, endpointId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - if (!String.IsNullOrEmpty(endpointId)) requestInfo.PathParameters.Add("endpoint_id", endpointId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var endpointIdOption = new Option("--endpoint-id", description: "key: id of endpoint"); + endpointIdOption.IsRequired = true; + command.AddOption(endpointIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, endpointId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--endpoint-id", description: "key: id of endpoint")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var endpointIdOption = new Option("--endpoint-id", description: "key: id of endpoint"); + endpointIdOption.IsRequired = true; + command.AddOption(endpointIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, endpointId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - if (!String.IsNullOrEmpty(endpointId)) requestInfo.PathParameters.Add("endpoint_id", endpointId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/ServicePrincipals/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs b/src/generated/ServicePrincipals/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs index 04cebfc93e8..1389d190703 100644 --- a/src/generated/ServicePrincipals/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs b/src/generated/ServicePrincipals/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs index b4917443633..30d53abf35a 100644 --- a/src/generated/ServicePrincipals/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/HomeRealmDiscoveryPolicies/@Ref/RefRequestBuilder.cs b/src/generated/ServicePrincipals/Item/HomeRealmDiscoveryPolicies/@Ref/RefRequestBuilder.cs index 7b9da7cc2d7..956dbfd62a5 100644 --- a/src/generated/ServicePrincipals/Item/HomeRealmDiscoveryPolicies/@Ref/RefRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/HomeRealmDiscoveryPolicies/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/HomeRealmDiscoveryPolicies/HomeRealmDiscoveryPoliciesRequestBuilder.cs b/src/generated/ServicePrincipals/Item/HomeRealmDiscoveryPolicies/HomeRealmDiscoveryPoliciesRequestBuilder.cs index f9f9ca69e92..4d0540e2810 100644 --- a/src/generated/ServicePrincipals/Item/HomeRealmDiscoveryPolicies/HomeRealmDiscoveryPoliciesRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/HomeRealmDiscoveryPolicies/HomeRealmDiscoveryPoliciesRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/MemberOf/@Ref/RefRequestBuilder.cs b/src/generated/ServicePrincipals/Item/MemberOf/@Ref/RefRequestBuilder.cs index f1c698b68a1..16437050737 100644 --- a/src/generated/ServicePrincipals/Item/MemberOf/@Ref/RefRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/MemberOf/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Roles that this service principal is a member of. HTTP Methods: GET Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Roles that this service principal is a member of. HTTP Methods: GET Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/MemberOf/MemberOfRequestBuilder.cs b/src/generated/ServicePrincipals/Item/MemberOf/MemberOfRequestBuilder.cs index b6428336ae6..79d0f8aa3a4 100644 --- a/src/generated/ServicePrincipals/Item/MemberOf/MemberOfRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/MemberOf/MemberOfRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Roles that this service principal is a member of. HTTP Methods: GET Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/Oauth2PermissionGrants/@Ref/RefRequestBuilder.cs b/src/generated/ServicePrincipals/Item/Oauth2PermissionGrants/@Ref/RefRequestBuilder.cs index a3e2a3c9e63..ad3ce17d3f9 100644 --- a/src/generated/ServicePrincipals/Item/Oauth2PermissionGrants/@Ref/RefRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/Oauth2PermissionGrants/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Delegated permission grants authorizing this service principal to access an API on behalf of a signed-in user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Delegated permission grants authorizing this service principal to access an API on behalf of a signed-in user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs b/src/generated/ServicePrincipals/Item/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs index 2a6aea9f88c..2e2ffd79d6b 100644 --- a/src/generated/ServicePrincipals/Item/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Delegated permission grants authorizing this service principal to access an API on behalf of a signed-in user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/OwnedObjects/@Ref/RefRequestBuilder.cs b/src/generated/ServicePrincipals/Item/OwnedObjects/@Ref/RefRequestBuilder.cs index 98f51ce4303..0a92f24d67f 100644 --- a/src/generated/ServicePrincipals/Item/OwnedObjects/@Ref/RefRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/OwnedObjects/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects that are owned by this service principal. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Directory objects that are owned by this service principal. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/OwnedObjects/OwnedObjectsRequestBuilder.cs b/src/generated/ServicePrincipals/Item/OwnedObjects/OwnedObjectsRequestBuilder.cs index 2089ba035e2..a8f83adcb2c 100644 --- a/src/generated/ServicePrincipals/Item/OwnedObjects/OwnedObjectsRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/OwnedObjects/OwnedObjectsRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects that are owned by this service principal. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/Owners/@Ref/RefRequestBuilder.cs b/src/generated/ServicePrincipals/Item/Owners/@Ref/RefRequestBuilder.cs index aa89c02fc70..02d9de0665a 100644 --- a/src/generated/ServicePrincipals/Item/Owners/@Ref/RefRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/Owners/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects that are owners of this servicePrincipal. The owners are a set of non-admin users or servicePrincipals who are allowed to modify this object. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Directory objects that are owners of this servicePrincipal. The owners are a set of non-admin users or servicePrincipals who are allowed to modify this object. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/Owners/OwnersRequestBuilder.cs b/src/generated/ServicePrincipals/Item/Owners/OwnersRequestBuilder.cs index 17b53e37b69..d496de8099d 100644 --- a/src/generated/ServicePrincipals/Item/Owners/OwnersRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/Owners/OwnersRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects that are owners of this servicePrincipal. The owners are a set of non-admin users or servicePrincipals who are allowed to modify this object. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/RemoveKey/RemoveKeyRequestBuilder.cs b/src/generated/ServicePrincipals/Item/RemoveKey/RemoveKeyRequestBuilder.cs index bfd822128c7..676e3a11e95 100644 --- a/src/generated/ServicePrincipals/Item/RemoveKey/RemoveKeyRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/RemoveKey/RemoveKeyRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action removeKey"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/ServicePrincipals/Item/RemovePassword/RemovePasswordRequestBuilder.cs b/src/generated/ServicePrincipals/Item/RemovePassword/RemovePasswordRequestBuilder.cs index 394aa515d65..121d8260936 100644 --- a/src/generated/ServicePrincipals/Item/RemovePassword/RemovePasswordRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/RemovePassword/RemovePasswordRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action removePassword"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/ServicePrincipals/Item/Restore/RestoreRequestBuilder.cs b/src/generated/ServicePrincipals/Item/Restore/RestoreRequestBuilder.cs index 5fbcd576d0a..a31f9db4f66 100644 --- a/src/generated/ServicePrincipals/Item/Restore/RestoreRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/Restore/RestoreRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restore"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); command.Handler = CommandHandler.Create(async (servicePrincipalId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/ServicePrincipalRequestBuilder.cs b/src/generated/ServicePrincipals/Item/ServicePrincipalRequestBuilder.cs index a89061ebfe6..b9d69b39157 100644 --- a/src/generated/ServicePrincipals/Item/ServicePrincipalRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/ServicePrincipalRequestBuilder.cs @@ -108,10 +108,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from servicePrincipals"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); command.Handler = CommandHandler.Create(async (servicePrincipalId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -132,14 +134,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from servicePrincipals by key"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -205,14 +215,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in servicePrincipals"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/ServicePrincipals/Item/TokenIssuancePolicies/@Ref/RefRequestBuilder.cs b/src/generated/ServicePrincipals/Item/TokenIssuancePolicies/@Ref/RefRequestBuilder.cs index 0678e357d3d..5018aab9ee1 100644 --- a/src/generated/ServicePrincipals/Item/TokenIssuancePolicies/@Ref/RefRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/TokenIssuancePolicies/@Ref/RefRequestBuilder.cs @@ -19,28 +19,43 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The tokenIssuancePolicies assigned to this service principal. + /// The tokenIssuancePolicies assigned to this service principal. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The tokenIssuancePolicies assigned to this service principal."; + command.Description = "The tokenIssuancePolicies assigned to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -53,20 +68,24 @@ public Command BuildGetCommand() { return command; } /// - /// The tokenIssuancePolicies assigned to this service principal. + /// The tokenIssuancePolicies assigned to this service principal. Supports $expand. /// public Command BuildPostCommand() { var command = new Command("post"); - command.Description = "The tokenIssuancePolicies assigned to this service principal."; + command.Description = "The tokenIssuancePolicies assigned to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,7 +111,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The tokenIssuancePolicies assigned to this service principal. + /// The tokenIssuancePolicies assigned to this service principal. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -113,7 +132,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The tokenIssuancePolicies assigned to this service principal. + /// The tokenIssuancePolicies assigned to this service principal. Supports $expand. /// /// Request headers /// Request options @@ -131,7 +150,7 @@ public RequestInformation CreatePostRequestInformation(ApiSdk.ServicePrincipals. return requestInfo; } /// - /// The tokenIssuancePolicies assigned to this service principal. + /// The tokenIssuancePolicies assigned to this service principal. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -143,7 +162,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The tokenIssuancePolicies assigned to this service principal. + /// The tokenIssuancePolicies assigned to this service principal. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -155,7 +174,7 @@ public async Task GetAsync(Action q = default, var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The tokenIssuancePolicies assigned to this service principal. + /// The tokenIssuancePolicies assigned to this service principal. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/ServicePrincipals/Item/TokenIssuancePolicies/TokenIssuancePoliciesRequestBuilder.cs b/src/generated/ServicePrincipals/Item/TokenIssuancePolicies/TokenIssuancePoliciesRequestBuilder.cs index a42208b311c..a73f048f6c8 100644 --- a/src/generated/ServicePrincipals/Item/TokenIssuancePolicies/TokenIssuancePoliciesRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/TokenIssuancePolicies/TokenIssuancePoliciesRequestBuilder.cs @@ -20,32 +20,53 @@ public class TokenIssuancePoliciesRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The tokenIssuancePolicies assigned to this service principal. + /// The tokenIssuancePolicies assigned to this service principal. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The tokenIssuancePolicies assigned to this service principal."; + command.Description = "The tokenIssuancePolicies assigned to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,7 +99,7 @@ public TokenIssuancePoliciesRequestBuilder(Dictionary pathParame RequestAdapter = requestAdapter; } /// - /// The tokenIssuancePolicies assigned to this service principal. + /// The tokenIssuancePolicies assigned to this service principal. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -99,7 +120,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The tokenIssuancePolicies assigned to this service principal. + /// The tokenIssuancePolicies assigned to this service principal. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -110,7 +131,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } - /// The tokenIssuancePolicies assigned to this service principal. + /// The tokenIssuancePolicies assigned to this service principal. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/ServicePrincipals/Item/TokenLifetimePolicies/@Ref/RefRequestBuilder.cs b/src/generated/ServicePrincipals/Item/TokenLifetimePolicies/@Ref/RefRequestBuilder.cs index 601c9911e07..7e34e1045b5 100644 --- a/src/generated/ServicePrincipals/Item/TokenLifetimePolicies/@Ref/RefRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/TokenLifetimePolicies/@Ref/RefRequestBuilder.cs @@ -19,28 +19,43 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The tokenLifetimePolicies assigned to this service principal. + /// The tokenLifetimePolicies assigned to this service principal. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The tokenLifetimePolicies assigned to this service principal."; + command.Description = "The tokenLifetimePolicies assigned to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -53,20 +68,24 @@ public Command BuildGetCommand() { return command; } /// - /// The tokenLifetimePolicies assigned to this service principal. + /// The tokenLifetimePolicies assigned to this service principal. Supports $expand. /// public Command BuildPostCommand() { var command = new Command("post"); - command.Description = "The tokenLifetimePolicies assigned to this service principal."; + command.Description = "The tokenLifetimePolicies assigned to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,7 +111,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The tokenLifetimePolicies assigned to this service principal. + /// The tokenLifetimePolicies assigned to this service principal. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -113,7 +132,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The tokenLifetimePolicies assigned to this service principal. + /// The tokenLifetimePolicies assigned to this service principal. Supports $expand. /// /// Request headers /// Request options @@ -131,7 +150,7 @@ public RequestInformation CreatePostRequestInformation(ApiSdk.ServicePrincipals. return requestInfo; } /// - /// The tokenLifetimePolicies assigned to this service principal. + /// The tokenLifetimePolicies assigned to this service principal. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -143,7 +162,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The tokenLifetimePolicies assigned to this service principal. + /// The tokenLifetimePolicies assigned to this service principal. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -155,7 +174,7 @@ public async Task GetAsync(Action q = default, var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The tokenLifetimePolicies assigned to this service principal. + /// The tokenLifetimePolicies assigned to this service principal. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/ServicePrincipals/Item/TokenLifetimePolicies/TokenLifetimePoliciesRequestBuilder.cs b/src/generated/ServicePrincipals/Item/TokenLifetimePolicies/TokenLifetimePoliciesRequestBuilder.cs index d68e3ff22d8..72c9905255e 100644 --- a/src/generated/ServicePrincipals/Item/TokenLifetimePolicies/TokenLifetimePoliciesRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/TokenLifetimePolicies/TokenLifetimePoliciesRequestBuilder.cs @@ -20,32 +20,53 @@ public class TokenLifetimePoliciesRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The tokenLifetimePolicies assigned to this service principal. + /// The tokenLifetimePolicies assigned to this service principal. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The tokenLifetimePolicies assigned to this service principal."; + command.Description = "The tokenLifetimePolicies assigned to this service principal. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,7 +99,7 @@ public TokenLifetimePoliciesRequestBuilder(Dictionary pathParame RequestAdapter = requestAdapter; } /// - /// The tokenLifetimePolicies assigned to this service principal. + /// The tokenLifetimePolicies assigned to this service principal. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -99,7 +120,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The tokenLifetimePolicies assigned to this service principal. + /// The tokenLifetimePolicies assigned to this service principal. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -110,7 +131,7 @@ public async Task GetAsync(Action(requestInfo, responseHandler, cancellationToken); } - /// The tokenLifetimePolicies assigned to this service principal. + /// The tokenLifetimePolicies assigned to this service principal. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/ServicePrincipals/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs b/src/generated/ServicePrincipals/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs index 3afa39729fc..e5747a0694e 100644 --- a/src/generated/ServicePrincipals/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of transitiveMemberOf from servicePrincipals"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Create new navigation property ref to transitiveMemberOf for servicePrincipals"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--body")); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (servicePrincipalId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs b/src/generated/ServicePrincipals/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs index 2fe7632c9bf..981ef31b781 100644 --- a/src/generated/ServicePrincipals/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs +++ b/src/generated/ServicePrincipals/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get transitiveMemberOf from servicePrincipals"; // Create options for all the parameters - command.AddOption(new Option("--serviceprincipal-id", description: "key: id of servicePrincipal")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(servicePrincipalId)) requestInfo.PathParameters.Add("servicePrincipal_id", servicePrincipalId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var servicePrincipalIdOption = new Option("--serviceprincipal-id", description: "key: id of servicePrincipal"); + servicePrincipalIdOption.IsRequired = true; + command.AddOption(servicePrincipalIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (servicePrincipalId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/ServicePrincipalsRequestBuilder.cs b/src/generated/ServicePrincipals/ServicePrincipalsRequestBuilder.cs index 1cc8980aae4..f6f3ac0a781 100644 --- a/src/generated/ServicePrincipals/ServicePrincipalsRequestBuilder.cs +++ b/src/generated/ServicePrincipals/ServicePrincipalsRequestBuilder.cs @@ -63,12 +63,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to servicePrincipals"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,24 +102,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from servicePrincipals"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/ServicePrincipals/ValidateProperties/ValidatePropertiesRequestBuilder.cs b/src/generated/ServicePrincipals/ValidateProperties/ValidatePropertiesRequestBuilder.cs index 6795b996693..0465d91be8c 100644 --- a/src/generated/ServicePrincipals/ValidateProperties/ValidatePropertiesRequestBuilder.cs +++ b/src/generated/ServicePrincipals/ValidateProperties/ValidatePropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validateProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/DriveItem/Content/ContentRequestBuilder.cs b/src/generated/Shares/Item/DriveItem/Content/ContentRequestBuilder.cs index a3b2f4cad6e..56e9b8decbc 100644 --- a/src/generated/Shares/Item/DriveItem/Content/ContentRequestBuilder.cs +++ b/src/generated/Shares/Item/DriveItem/Content/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property driveItem from shares"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (sharedDriveItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property driveItem in shares"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/DriveItem/DriveItemRequestBuilder.cs b/src/generated/Shares/Item/DriveItem/DriveItemRequestBuilder.cs index 3c609aed591..83c4aee55f1 100644 --- a/src/generated/Shares/Item/DriveItem/DriveItemRequestBuilder.cs +++ b/src/generated/Shares/Item/DriveItem/DriveItemRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Used to access the underlying driveItem"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used to access the underlying driveItem"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Used to access the underlying driveItem"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/Items/Item/Content/ContentRequestBuilder.cs b/src/generated/Shares/Item/Items/Item/Content/ContentRequestBuilder.cs index 6a4afd92df7..89304d3543f 100644 --- a/src/generated/Shares/Item/Items/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Shares/Item/Items/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property items from shares"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (sharedDriveItemId, driveItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property items in shares"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, driveItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/Items/Item/DriveItemRequestBuilder.cs b/src/generated/Shares/Item/Items/Item/DriveItemRequestBuilder.cs index 8a030c9b89d..91a95346afc 100644 --- a/src/generated/Shares/Item/Items/Item/DriveItemRequestBuilder.cs +++ b/src/generated/Shares/Item/Items/Item/DriveItemRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All driveItems contained in the sharing root. This collection cannot be enumerated."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All driveItems contained in the sharing root. This collection cannot be enumerated."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All driveItems contained in the sharing root. This collection cannot be enumerated."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/Items/ItemsRequestBuilder.cs b/src/generated/Shares/Item/Items/ItemsRequestBuilder.cs index a8cf013cf5a..bacea7d317d 100644 --- a/src/generated/Shares/Item/Items/ItemsRequestBuilder.cs +++ b/src/generated/Shares/Item/Items/ItemsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All driveItems contained in the sharing root. This collection cannot be enumerated."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All driveItems contained in the sharing root. This collection cannot be enumerated."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/Columns/ColumnsRequestBuilder.cs b/src/generated/Shares/Item/List/Columns/ColumnsRequestBuilder.cs index 39517a0b57b..39b51338492 100644 --- a/src/generated/Shares/Item/List/Columns/ColumnsRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Columns/ColumnsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/Columns/Item/ColumnDefinitionRequestBuilder.cs b/src/generated/Shares/Item/List/Columns/Item/ColumnDefinitionRequestBuilder.cs index dc386075de3..f0c757428cd 100644 --- a/src/generated/Shares/Item/List/Columns/Item/ColumnDefinitionRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Columns/Item/ColumnDefinitionRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs b/src/generated/Shares/Item/List/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs index 3c21ca80ce4..46332061ede 100644 --- a/src/generated/Shares/Item/List/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs @@ -19,18 +19,21 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -38,18 +41,21 @@ public Command BuildDeleteCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, columnDefinitionId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +68,27 @@ public Command BuildGetCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -98,7 +109,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -113,7 +124,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -128,7 +139,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// /// Request headers /// Request options @@ -146,7 +157,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.Shares.Item.List.Co return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -157,7 +168,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +179,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/Shares/Item/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs b/src/generated/Shares/Item/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs index 2744fb533bb..bcb7a1cdbcf 100644 --- a/src/generated/Shares/Item/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs @@ -21,22 +21,31 @@ public class SourceColumnRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,7 +79,7 @@ public SourceColumnRequestBuilder(Dictionary pathParameters, IRe RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// Request query parameters @@ -91,7 +100,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -102,7 +111,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The source column for the content type column. + /// The source column for content type column. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Shares/Item/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs index 5ce9f2e0af7..b99d63deb46 100644 --- a/src/generated/Shares/Item/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addCopy"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/ContentTypes/ContentTypesRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/ContentTypesRequestBuilder.cs index 4db0ce196a6..0943a43320c 100644 --- a/src/generated/Shares/Item/List/ContentTypes/ContentTypesRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/ContentTypesRequestBuilder.cs @@ -52,14 +52,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,26 +82,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs index 8077aecd63c..8a4046e4bb9 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs index 17eb3d23083..b0aca9653ce 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action associateWithHubSites"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/@Base/BaseRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/@Base/BaseRequestBuilder.cs index 084dbb608a2..d5b1721cd0e 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/@Base/BaseRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/@Base/BaseRequestBuilder.cs @@ -44,16 +44,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs index 0961ecf3bad..4fbf9240ffa 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToDefaultContentLocation"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs index ffb102d3210..c786dbb28ed 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function isPublished"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs index 2eeb39717b8..03e5c8d54e7 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action publish"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs index 2ae715098ae..7934cbe3d83 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unpublish"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs index d1ecadc411c..e20e49fa2c5 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action associateWithHubSites"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs index 820a0404c79..e3bc39eb743 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs @@ -25,24 +25,40 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,16 +77,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs index 18bbc4d0217..05a162ad38d 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addCopy"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs index 0b28ea4dfd8..6bbab3dafd0 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs @@ -33,28 +33,50 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs index 8a453fab923..d09e5f849fe 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs @@ -30,22 +30,27 @@ public List BuildCommand() { return commands; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,34 +63,56 @@ public Command BuildCreateCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -111,7 +138,7 @@ public ColumnLinksRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// Request query parameters @@ -132,7 +159,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// /// Request headers /// Request options @@ -150,7 +177,7 @@ public RequestInformation CreatePostRequestInformation(ColumnLink body, Action - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +189,7 @@ public async Task GetAsync(Action q = d return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// @@ -174,7 +201,7 @@ public async Task PostAsync(ColumnLink model, Action(requestInfo, responseHandler, cancellationToken); } - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs index e7a169557be..e7d73e5bc3c 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs @@ -20,20 +20,24 @@ public class ColumnLinkRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, columnLinkId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,24 +45,34 @@ public Command BuildDeleteCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, columnLinkId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, columnLinkId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,24 +85,30 @@ public Command BuildGetCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, columnLinkId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -109,7 +129,7 @@ public ColumnLinkRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// @@ -124,7 +144,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// Request query parameters @@ -145,7 +165,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// /// Request headers /// Request options @@ -163,7 +183,7 @@ public RequestInformation CreatePatchRequestInformation(ColumnLink body, Action< return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +194,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -186,7 +206,7 @@ public async Task GetAsync(Action q = default, A return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// @@ -198,7 +218,7 @@ public async Task PatchAsync(ColumnLink model, ActionThe collection of columns that are required by this content type. + /// The collection of columns that are required by this content type public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs index 2b4eeed92a1..2a664aec13f 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs @@ -25,24 +25,40 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,16 +77,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs index 23520d75f4d..0536aa1d8c2 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs @@ -26,28 +26,50 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs index 90b62f17f5e..3e805f1a916 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,28 +70,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs index 21e1d4695cc..f113a8371a0 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,18 +92,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs index a6b55978eb4..db807fa3161 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs @@ -19,20 +19,24 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -40,20 +44,24 @@ public Command BuildDeleteCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, columnDefinitionId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,24 +74,30 @@ public Command BuildGetCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -104,7 +118,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -119,7 +133,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -134,7 +148,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// /// Request headers /// Request options @@ -152,7 +166,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.Shares.Item.List.Co return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -163,7 +177,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +188,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs index a67610127e8..11b81850def 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs @@ -21,24 +21,34 @@ public class SourceColumnRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,7 +82,7 @@ public SourceColumnRequestBuilder(Dictionary pathParameters, IRe RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// Request query parameters @@ -93,7 +103,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -104,7 +114,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The source column for the content type column. + /// The source column for content type column. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/ContentTypeRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/ContentTypeRequestBuilder.cs index ec88cc5d14e..b9be8b394d0 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/ContentTypeRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/ContentTypeRequestBuilder.cs @@ -88,12 +88,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -107,16 +110,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -135,16 +147,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs index 2d234ea9a45..7df9f67a626 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToDefaultContentLocation"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs index 1a74f94bf7b..4e566058dbf 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function isPublished"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs index e5adcaa0dd2..3e284e41487 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action publish"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs b/src/generated/Shares/Item/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs index 1fa965cc8f5..a8de8f874ad 100644 --- a/src/generated/Shares/Item/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unpublish"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/Drive/DriveRequestBuilder.cs b/src/generated/Shares/Item/List/Drive/DriveRequestBuilder.cs index cfd65322345..0057c6b6bd5 100644 --- a/src/generated/Shares/Item/List/Drive/DriveRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Drive/DriveRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Only present on document libraries. Allows access to the list as a [drive][] resource with [driveItems][driveItem]."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Only present on document libraries. Allows access to the list as a [drive][] resource with [driveItems][driveItem]."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Only present on document libraries. Allows access to the list as a [drive][] resource with [driveItems][driveItem]."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/Items/Item/Analytics/@Ref/RefRequestBuilder.cs b/src/generated/Shares/Item/List/Items/Item/Analytics/@Ref/RefRequestBuilder.cs index 93714cc4bc7..9663f7e722d 100644 --- a/src/generated/Shares/Item/List/Items/Item/Analytics/@Ref/RefRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Items/Item/Analytics/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs b/src/generated/Shares/Item/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs index da57ce49255..76a03d1b720 100644 --- a/src/generated/Shares/Item/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs @@ -27,16 +27,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs b/src/generated/Shares/Item/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs index cac8c6d2e56..ef8b7a67a47 100644 --- a/src/generated/Shares/Item/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property driveItem from shares"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property driveItem in shares"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs b/src/generated/Shares/Item/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs index 34a17b23aa7..8ea4c8877ea 100644 --- a/src/generated/Shares/Item/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/Items/Item/Fields/FieldsRequestBuilder.cs b/src/generated/Shares/Item/List/Items/Item/Fields/FieldsRequestBuilder.cs index 43047170fb4..e0f3a72e930 100644 --- a/src/generated/Shares/Item/List/Items/Item/Fields/FieldsRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Items/Item/Fields/FieldsRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs b/src/generated/Shares/Item/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs index 22ac44f0fe8..516f972a6ce 100644 --- a/src/generated/Shares/Item/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs b/src/generated/Shares/Item/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs index 46b3a4d0f98..06adbf66a59 100644 --- a/src/generated/Shares/Item/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}")); - command.AddOption(new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}")); - command.AddOption(new Option("--interval", description: "Usage: interval={interval}")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var intervalOption = new Option("--interval", description: "Usage: interval={interval}"); + intervalOption.IsRequired = true; + command.AddOption(intervalOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, startDateTime, endDateTime, interval) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.PathParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.PathParameters.Add("endDateTime", endDateTime); - if (!String.IsNullOrEmpty(interval)) requestInfo.PathParameters.Add("interval", interval); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/Items/Item/ListItemRequestBuilder.cs b/src/generated/Shares/Item/List/Items/Item/ListItemRequestBuilder.cs index b35cb99530b..95ee09233b8 100644 --- a/src/generated/Shares/Item/List/Items/Item/ListItemRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Items/Item/ListItemRequestBuilder.cs @@ -39,12 +39,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -75,16 +78,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -103,16 +115,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs b/src/generated/Shares/Item/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs index d7593c2b877..c94b0b58041 100644 --- a/src/generated/Shares/Item/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, listItemVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, listItemVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, listItemVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, listItemVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs b/src/generated/Shares/Item/List/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs index dd58a822735..51183ac9c06 100644 --- a/src/generated/Shares/Item/List/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, listItemVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, listItemVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, listItemVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, listItemVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs b/src/generated/Shares/Item/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs index 5f2eec08625..e6246041a0a 100644 --- a/src/generated/Shares/Item/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restoreVersion"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, listItemVersionId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/Items/Item/Versions/VersionsRequestBuilder.cs b/src/generated/Shares/Item/List/Items/Item/Versions/VersionsRequestBuilder.cs index 6ae8875a1bb..156bcd51d6d 100644 --- a/src/generated/Shares/Item/List/Items/Item/Versions/VersionsRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Items/Item/Versions/VersionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/Items/ItemsRequestBuilder.cs b/src/generated/Shares/Item/List/Items/ItemsRequestBuilder.cs index 9cc772844dd..e793be33c9d 100644 --- a/src/generated/Shares/Item/List/Items/ItemsRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Items/ItemsRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +70,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/List/ListRequestBuilder.cs b/src/generated/Shares/Item/List/ListRequestBuilder.cs index 2f8e6a02ecd..ae503791ad6 100644 --- a/src/generated/Shares/Item/List/ListRequestBuilder.cs +++ b/src/generated/Shares/Item/List/ListRequestBuilder.cs @@ -46,10 +46,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Used to access the underlying list"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -71,14 +73,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used to access the underlying list"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -104,14 +114,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Used to access the underlying list"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/Subscriptions/Item/SubscriptionRequestBuilder.cs b/src/generated/Shares/Item/List/Subscriptions/Item/SubscriptionRequestBuilder.cs index dae8d65b2bc..bc68f320af7 100644 --- a/src/generated/Shares/Item/List/Subscriptions/Item/SubscriptionRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Subscriptions/Item/SubscriptionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, subscriptionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, subscriptionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, subscriptionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, subscriptionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/List/Subscriptions/SubscriptionsRequestBuilder.cs b/src/generated/Shares/Item/List/Subscriptions/SubscriptionsRequestBuilder.cs index ead4c11ce7b..6f34fece177 100644 --- a/src/generated/Shares/Item/List/Subscriptions/SubscriptionsRequestBuilder.cs +++ b/src/generated/Shares/Item/List/Subscriptions/SubscriptionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/ListItem/Analytics/@Ref/RefRequestBuilder.cs b/src/generated/Shares/Item/ListItem/Analytics/@Ref/RefRequestBuilder.cs index ac27a488875..40686684642 100644 --- a/src/generated/Shares/Item/ListItem/Analytics/@Ref/RefRequestBuilder.cs +++ b/src/generated/Shares/Item/ListItem/Analytics/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/ListItem/Analytics/AnalyticsRequestBuilder.cs b/src/generated/Shares/Item/ListItem/Analytics/AnalyticsRequestBuilder.cs index 874bef5a828..f8909dcafea 100644 --- a/src/generated/Shares/Item/ListItem/Analytics/AnalyticsRequestBuilder.cs +++ b/src/generated/Shares/Item/ListItem/Analytics/AnalyticsRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/ListItem/DriveItem/Content/ContentRequestBuilder.cs b/src/generated/Shares/Item/ListItem/DriveItem/Content/ContentRequestBuilder.cs index 90e4e1adf73..b451adbf1be 100644 --- a/src/generated/Shares/Item/ListItem/DriveItem/Content/ContentRequestBuilder.cs +++ b/src/generated/Shares/Item/ListItem/DriveItem/Content/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property driveItem from shares"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (sharedDriveItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property driveItem in shares"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/ListItem/DriveItem/DriveItemRequestBuilder.cs b/src/generated/Shares/Item/ListItem/DriveItem/DriveItemRequestBuilder.cs index 5d4211c769f..2ddd70db698 100644 --- a/src/generated/Shares/Item/ListItem/DriveItem/DriveItemRequestBuilder.cs +++ b/src/generated/Shares/Item/ListItem/DriveItem/DriveItemRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/ListItem/Fields/FieldsRequestBuilder.cs b/src/generated/Shares/Item/ListItem/Fields/FieldsRequestBuilder.cs index 656e86b56cd..fe333bfb7cb 100644 --- a/src/generated/Shares/Item/ListItem/Fields/FieldsRequestBuilder.cs +++ b/src/generated/Shares/Item/ListItem/Fields/FieldsRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/ListItem/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs b/src/generated/Shares/Item/ListItem/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs index 2dd82524b54..7ed5a54adf2 100644 --- a/src/generated/Shares/Item/ListItem/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs +++ b/src/generated/Shares/Item/ListItem/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/ListItem/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs b/src/generated/Shares/Item/ListItem/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs index 41f878178e4..c7eb247d6b7 100644 --- a/src/generated/Shares/Item/ListItem/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs +++ b/src/generated/Shares/Item/ListItem/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}")); - command.AddOption(new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}")); - command.AddOption(new Option("--interval", description: "Usage: interval={interval}")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var intervalOption = new Option("--interval", description: "Usage: interval={interval}"); + intervalOption.IsRequired = true; + command.AddOption(intervalOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, startDateTime, endDateTime, interval) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.PathParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.PathParameters.Add("endDateTime", endDateTime); - if (!String.IsNullOrEmpty(interval)) requestInfo.PathParameters.Add("interval", interval); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/ListItem/ListItemRequestBuilder.cs b/src/generated/Shares/Item/ListItem/ListItemRequestBuilder.cs index 3667cd89102..50d2bc3ac5e 100644 --- a/src/generated/Shares/Item/ListItem/ListItemRequestBuilder.cs +++ b/src/generated/Shares/Item/ListItem/ListItemRequestBuilder.cs @@ -39,10 +39,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Used to access the underlying listItem"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -73,14 +75,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used to access the underlying listItem"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,14 +109,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Used to access the underlying listItem"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/ListItem/Versions/Item/Fields/FieldsRequestBuilder.cs b/src/generated/Shares/Item/ListItem/Versions/Item/Fields/FieldsRequestBuilder.cs index 109d776beb2..f082db26946 100644 --- a/src/generated/Shares/Item/ListItem/Versions/Item/Fields/FieldsRequestBuilder.cs +++ b/src/generated/Shares/Item/ListItem/Versions/Item/Fields/FieldsRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/ListItem/Versions/Item/ListItemVersionRequestBuilder.cs b/src/generated/Shares/Item/ListItem/Versions/Item/ListItemVersionRequestBuilder.cs index c4b7d30df5f..45de7abec27 100644 --- a/src/generated/Shares/Item/ListItem/Versions/Item/ListItemVersionRequestBuilder.cs +++ b/src/generated/Shares/Item/ListItem/Versions/Item/ListItemVersionRequestBuilder.cs @@ -28,12 +28,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,16 +58,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,16 +95,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/ListItem/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs b/src/generated/Shares/Item/ListItem/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs index dd0a95a4aa0..dd90dff5856 100644 --- a/src/generated/Shares/Item/ListItem/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs +++ b/src/generated/Shares/Item/ListItem/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restoreVersion"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, listItemVersionId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/ListItem/Versions/VersionsRequestBuilder.cs b/src/generated/Shares/Item/ListItem/Versions/VersionsRequestBuilder.cs index 9b5a7ea7016..945fcc80c1b 100644 --- a/src/generated/Shares/Item/ListItem/Versions/VersionsRequestBuilder.cs +++ b/src/generated/Shares/Item/ListItem/Versions/VersionsRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +68,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/Permission/Grant/GrantRequestBuilder.cs b/src/generated/Shares/Item/Permission/Grant/GrantRequestBuilder.cs index fa9f3c18086..7a9ff58ef50 100644 --- a/src/generated/Shares/Item/Permission/Grant/GrantRequestBuilder.cs +++ b/src/generated/Shares/Item/Permission/Grant/GrantRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action grant"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Shares/Item/Permission/PermissionRequestBuilder.cs b/src/generated/Shares/Item/Permission/PermissionRequestBuilder.cs index 212492cd3b8..ca7cf175545 100644 --- a/src/generated/Shares/Item/Permission/PermissionRequestBuilder.cs +++ b/src/generated/Shares/Item/Permission/PermissionRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Used to access the permission representing the underlying sharing link"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used to access the permission representing the underlying sharing link"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,14 +86,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Used to access the permission representing the underlying sharing link"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/Root/Content/ContentRequestBuilder.cs b/src/generated/Shares/Item/Root/Content/ContentRequestBuilder.cs index 87f06088c40..ed9164349c1 100644 --- a/src/generated/Shares/Item/Root/Content/ContentRequestBuilder.cs +++ b/src/generated/Shares/Item/Root/Content/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property root from shares"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (sharedDriveItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property root in shares"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/Root/RootRequestBuilder.cs b/src/generated/Shares/Item/Root/RootRequestBuilder.cs index fb14164c0ad..77f2f84565e 100644 --- a/src/generated/Shares/Item/Root/RootRequestBuilder.cs +++ b/src/generated/Shares/Item/Root/RootRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Used to access the underlying driveItem. Deprecated -- use driveItem instead."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used to access the underlying driveItem. Deprecated -- use driveItem instead."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Used to access the underlying driveItem. Deprecated -- use driveItem instead."; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/SharedDriveItemRequestBuilder.cs b/src/generated/Shares/Item/SharedDriveItemRequestBuilder.cs index a6634b6f947..c632aee201e 100644 --- a/src/generated/Shares/Item/SharedDriveItemRequestBuilder.cs +++ b/src/generated/Shares/Item/SharedDriveItemRequestBuilder.cs @@ -33,10 +33,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from shares"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,14 +61,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from shares by key"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -117,14 +127,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in shares"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/Item/Site/SiteRequestBuilder.cs b/src/generated/Shares/Item/Site/SiteRequestBuilder.cs index 0b9ff12fcb8..edb92db3120 100644 --- a/src/generated/Shares/Item/Site/SiteRequestBuilder.cs +++ b/src/generated/Shares/Item/Site/SiteRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Used to access the underlying site"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used to access the underlying site"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (sharedDriveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Used to access the underlying site"; // Create options for all the parameters - command.AddOption(new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem")); - command.AddOption(new Option("--body")); + var sharedDriveItemIdOption = new Option("--shareddriveitem-id", description: "key: id of sharedDriveItem"); + sharedDriveItemIdOption.IsRequired = true; + command.AddOption(sharedDriveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (sharedDriveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(sharedDriveItemId)) requestInfo.PathParameters.Add("sharedDriveItem_id", sharedDriveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Shares/SharesRequestBuilder.cs b/src/generated/Shares/SharesRequestBuilder.cs index 1a9742468d5..f34bbb52175 100644 --- a/src/generated/Shares/SharesRequestBuilder.cs +++ b/src/generated/Shares/SharesRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to shares"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,24 +70,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from shares"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/@Add/AddRequestBuilder.cs b/src/generated/Sites/@Add/AddRequestBuilder.cs index 7dea2131eb2..3e6c76ffaa9 100644 --- a/src/generated/Sites/@Add/AddRequestBuilder.cs +++ b/src/generated/Sites/@Add/AddRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/@Remove/RemoveRequestBuilder.cs b/src/generated/Sites/@Remove/RemoveRequestBuilder.cs index 7447ee101cb..4900705544a 100644 --- a/src/generated/Sites/@Remove/RemoveRequestBuilder.cs +++ b/src/generated/Sites/@Remove/RemoveRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action remove"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Analytics/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/Analytics/@Ref/RefRequestBuilder.cs index 62539b64f6c..9a5ddcc73a7 100644 --- a/src/generated/Sites/Item/Analytics/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/Analytics/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Analytics about the view activities that took place in this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); command.Handler = CommandHandler.Create(async (siteId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place in this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); command.Handler = CommandHandler.Create(async (siteId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Analytics about the view activities that took place in this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Analytics/AnalyticsRequestBuilder.cs b/src/generated/Sites/Item/Analytics/AnalyticsRequestBuilder.cs index 2151ef13be6..272ca4355f0 100644 --- a/src/generated/Sites/Item/Analytics/AnalyticsRequestBuilder.cs +++ b/src/generated/Sites/Item/Analytics/AnalyticsRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place in this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Columns/ColumnsRequestBuilder.cs b/src/generated/Sites/Item/Columns/ColumnsRequestBuilder.cs index a6367f591ca..e9abba17e35 100644 --- a/src/generated/Sites/Item/Columns/ColumnsRequestBuilder.cs +++ b/src/generated/Sites/Item/Columns/ColumnsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of column definitions reusable across lists under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of column definitions reusable across lists under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs b/src/generated/Sites/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs index c44707ab4ec..1b7120cf915 100644 --- a/src/generated/Sites/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs +++ b/src/generated/Sites/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of column definitions reusable across lists under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (siteId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of column definitions reusable across lists under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of column definitions reusable across lists under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs index 08f6834645a..c8f11620c01 100644 --- a/src/generated/Sites/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs @@ -19,18 +19,21 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (siteId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -38,18 +41,21 @@ public Command BuildDeleteCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (siteId, columnDefinitionId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +68,27 @@ public Command BuildGetCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -98,7 +109,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -113,7 +124,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -128,7 +139,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// /// Request headers /// Request options @@ -146,7 +157,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.Sites.Item.Columns. return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -157,7 +168,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +179,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/Sites/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs b/src/generated/Sites/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs index fc133977f87..17b5ab6dad6 100644 --- a/src/generated/Sites/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs +++ b/src/generated/Sites/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs @@ -21,22 +21,31 @@ public class SourceColumnRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,7 +79,7 @@ public SourceColumnRequestBuilder(Dictionary pathParameters, IRe RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// Request query parameters @@ -91,7 +100,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -102,7 +111,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The source column for the content type column. + /// The source column for content type column. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Sites/Item/ContentTypes/AddCopy/AddCopyRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/AddCopy/AddCopyRequestBuilder.cs index 150f03fe2af..b75a41c560e 100644 --- a/src/generated/Sites/Item/ContentTypes/AddCopy/AddCopyRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/AddCopy/AddCopyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addCopy"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/ContentTypes/ContentTypesRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/ContentTypesRequestBuilder.cs index 3f39e569f1e..6d22be2da24 100644 --- a/src/generated/Sites/Item/ContentTypes/ContentTypesRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/ContentTypesRequestBuilder.cs @@ -52,14 +52,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of content types defined for this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,26 +82,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of content types defined for this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs index 81be0057a71..2d4afbe848c 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs index 21092c78153..a52cf59818c 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action associateWithHubSites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/@Base/BaseRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/@Base/BaseRequestBuilder.cs index f4310fa1c8b..f69ccc30d55 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/@Base/BaseRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/@Base/BaseRequestBuilder.cs @@ -44,16 +44,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, contentTypeId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, contentTypeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs index b08404d86de..b99dbf5a8a3 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToDefaultContentLocation"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs index 2a89eff02e3..3e9792719b9 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function isPublished"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs index ca84a26e5ee..75e751f1e72 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action publish"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs index 4f21e9876d7..c850f9591e6 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unpublish"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs index 189b81f6ed6..7a3a86acc33 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action associateWithHubSites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs index a69828011cb..435aa7752ab 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs @@ -25,24 +25,40 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (siteId, contentTypeId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (siteId, contentTypeId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,16 +77,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs index 3115511f405..01be91a5447 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addCopy"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs index bcb42fbf631..c1a9e424a48 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs @@ -33,28 +33,50 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs index d8cd7b89ff0..4d3ac499bdf 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs @@ -30,22 +30,27 @@ public List BuildCommand() { return commands; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,34 +63,56 @@ public Command BuildCreateCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -111,7 +138,7 @@ public ColumnLinksRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// Request query parameters @@ -132,7 +159,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// /// Request headers /// Request options @@ -150,7 +177,7 @@ public RequestInformation CreatePostRequestInformation(ColumnLink body, Action - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +189,7 @@ public async Task GetAsync(Action q = d return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// @@ -174,7 +201,7 @@ public async Task PostAsync(ColumnLink model, Action(requestInfo, responseHandler, cancellationToken); } - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Sites/Item/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs index 463e023731d..7376a65292a 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs @@ -20,20 +20,24 @@ public class ColumnLinkRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, columnLinkId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,24 +45,34 @@ public Command BuildDeleteCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, contentTypeId, columnLinkId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, contentTypeId, columnLinkId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,24 +85,30 @@ public Command BuildGetCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, columnLinkId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -109,7 +129,7 @@ public ColumnLinkRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// @@ -124,7 +144,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// Request query parameters @@ -145,7 +165,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// /// Request headers /// Request options @@ -163,7 +183,7 @@ public RequestInformation CreatePatchRequestInformation(ColumnLink body, Action< return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +194,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -186,7 +206,7 @@ public async Task GetAsync(Action q = default, A return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// @@ -198,7 +218,7 @@ public async Task PatchAsync(ColumnLink model, ActionThe collection of columns that are required by this content type. + /// The collection of columns that are required by this content type public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Sites/Item/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs index f8c49f0b8a7..b58cb59e924 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs @@ -25,24 +25,40 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (siteId, contentTypeId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (siteId, contentTypeId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -61,16 +77,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs index 4e7fb67df9e..c6202948f13 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs @@ -26,28 +26,50 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs index 47a33d27ce4..e412ec00eab 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,28 +70,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs index bb823673431..54c15bed679 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, contentTypeId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, contentTypeId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,18 +92,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs index 908a9ff5311..cd75a816b67 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs @@ -19,20 +19,24 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -40,20 +44,24 @@ public Command BuildDeleteCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, columnDefinitionId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,24 +74,30 @@ public Command BuildGetCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -104,7 +118,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -119,7 +133,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -134,7 +148,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// /// Request headers /// Request options @@ -152,7 +166,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.Sites.Item.ContentT return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -163,7 +177,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +188,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/Sites/Item/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs index 3bf37969fed..2cc39e4717f 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs @@ -21,24 +21,34 @@ public class SourceColumnRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, contentTypeId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, contentTypeId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,7 +82,7 @@ public SourceColumnRequestBuilder(Dictionary pathParameters, IRe RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// Request query parameters @@ -93,7 +103,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -104,7 +114,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The source column for the content type column. + /// The source column for content type column. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Sites/Item/ContentTypes/Item/ContentTypeRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/ContentTypeRequestBuilder.cs index 7f28843f3f8..ef07faaf638 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/ContentTypeRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/ContentTypeRequestBuilder.cs @@ -88,12 +88,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of content types defined for this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -107,16 +110,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types defined for this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, contentTypeId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, contentTypeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -135,16 +147,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of content types defined for this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs index 71bf0061d46..07b4905dbe3 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToDefaultContentLocation"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs index 0fdfb6b3841..474149c1a20 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function isPublished"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/Publish/PublishRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/Publish/PublishRequestBuilder.cs index bfc86906398..321109acf51 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/Publish/PublishRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/Publish/PublishRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action publish"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs b/src/generated/Sites/Item/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs index 870342e3df2..ce64a88b082 100644 --- a/src/generated/Sites/Item/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs +++ b/src/generated/Sites/Item/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unpublish"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Drive/DriveRequestBuilder.cs b/src/generated/Sites/Item/Drive/DriveRequestBuilder.cs index f43cb25dd14..1fe016c110d 100644 --- a/src/generated/Sites/Item/Drive/DriveRequestBuilder.cs +++ b/src/generated/Sites/Item/Drive/DriveRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The default drive (document library) for this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); command.Handler = CommandHandler.Create(async (siteId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The default drive (document library) for this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The default drive (document library) for this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Drives/DrivesRequestBuilder.cs b/src/generated/Sites/Item/Drives/DrivesRequestBuilder.cs index 85b5b34aa21..c3932fb1f63 100644 --- a/src/generated/Sites/Item/Drives/DrivesRequestBuilder.cs +++ b/src/generated/Sites/Item/Drives/DrivesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of drives (document libraries) under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of drives (document libraries) under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Drives/Item/DriveRequestBuilder.cs b/src/generated/Sites/Item/Drives/Item/DriveRequestBuilder.cs index 6a247fee5c3..19fecc26ced 100644 --- a/src/generated/Sites/Item/Drives/Item/DriveRequestBuilder.cs +++ b/src/generated/Sites/Item/Drives/Item/DriveRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of drives (document libraries) under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--drive-id", description: "key: id of drive")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); command.Handler = CommandHandler.Create(async (siteId, driveId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of drives (document libraries) under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, driveId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, driveId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of drives (document libraries) under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/ExternalColumns/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/ExternalColumns/@Ref/RefRequestBuilder.cs index b37c995cc86..90cf3b6e65f 100644 --- a/src/generated/Sites/Item/ExternalColumns/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/ExternalColumns/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of column definitions available in the site that are referenced from the sites in the parent hierarchy of the current site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The collection of column definitions available in the site that are referenced from the sites in the parent hierarchy of the current site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/ExternalColumns/ExternalColumnsRequestBuilder.cs b/src/generated/Sites/Item/ExternalColumns/ExternalColumnsRequestBuilder.cs index 9ec6ec646a3..fc3ef1a750e 100644 --- a/src/generated/Sites/Item/ExternalColumns/ExternalColumnsRequestBuilder.cs +++ b/src/generated/Sites/Item/ExternalColumns/ExternalColumnsRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of column definitions available in the site that are referenced from the sites in the parent hierarchy of the current site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs b/src/generated/Sites/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs index a7d714f2974..fbd5f76bbd5 100644 --- a/src/generated/Sites/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs +++ b/src/generated/Sites/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); command.Handler = CommandHandler.Create(async (siteId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs b/src/generated/Sites/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs index 16e4d2e2ee1..7b2c2521da1 100644 --- a/src/generated/Sites/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs +++ b/src/generated/Sites/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}")); - command.AddOption(new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}")); - command.AddOption(new Option("--interval", description: "Usage: interval={interval}")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var intervalOption = new Option("--interval", description: "Usage: interval={interval}"); + intervalOption.IsRequired = true; + command.AddOption(intervalOption); command.Handler = CommandHandler.Create(async (siteId, startDateTime, endDateTime, interval) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.PathParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.PathParameters.Add("endDateTime", endDateTime); - if (!String.IsNullOrEmpty(interval)) requestInfo.PathParameters.Add("interval", interval); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/GetApplicableContentTypesForListWithListId/GetApplicableContentTypesForListWithListIdRequestBuilder.cs b/src/generated/Sites/Item/GetApplicableContentTypesForListWithListId/GetApplicableContentTypesForListWithListIdRequestBuilder.cs index 3d1f6ea6a29..56c7ebeaa09 100644 --- a/src/generated/Sites/Item/GetApplicableContentTypesForListWithListId/GetApplicableContentTypesForListWithListIdRequestBuilder.cs +++ b/src/generated/Sites/Item/GetApplicableContentTypesForListWithListId/GetApplicableContentTypesForListWithListIdRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getApplicableContentTypesForList"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--listid", description: "Usage: listId={listId}")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--listid", description: "Usage: listId={listId}"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); command.Handler = CommandHandler.Create(async (siteId, listId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("listId", listId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/GetByPathWithPath/GetByPathWithPathRequestBuilder.cs b/src/generated/Sites/Item/GetByPathWithPath/GetByPathWithPathRequestBuilder.cs index ab4eedb8afe..6d6e9f1320d 100644 --- a/src/generated/Sites/Item/GetByPathWithPath/GetByPathWithPathRequestBuilder.cs +++ b/src/generated/Sites/Item/GetByPathWithPath/GetByPathWithPathRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getByPath"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--path", description: "Usage: path={path}")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var pathOption = new Option("--path", description: "Usage: path={path}"); + pathOption.IsRequired = true; + command.AddOption(pathOption); command.Handler = CommandHandler.Create(async (siteId, path) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(path)) requestInfo.PathParameters.Add("path", path); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Items/Item/BaseItemRequestBuilder.cs b/src/generated/Sites/Item/Items/Item/BaseItemRequestBuilder.cs index f536cd07f74..ca4b15d5f15 100644 --- a/src/generated/Sites/Item/Items/Item/BaseItemRequestBuilder.cs +++ b/src/generated/Sites/Item/Items/Item/BaseItemRequestBuilder.cs @@ -20,18 +20,21 @@ public class BaseItemRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Used to address any item contained in this site. This collection can't be enumerated."; + command.Description = "Used to address any item contained in this site. This collection cannot be enumerated."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--baseitem-id", description: "key: id of baseItem")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var baseItemIdOption = new Option("--baseitem-id", description: "key: id of baseItem"); + baseItemIdOption.IsRequired = true; + command.AddOption(baseItemIdOption); command.Handler = CommandHandler.Create(async (siteId, baseItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(baseItemId)) requestInfo.PathParameters.Add("baseItem_id", baseItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Used to address any item contained in this site. This collection can't be enumerated."; + command.Description = "Used to address any item contained in this site. This collection cannot be enumerated."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--baseitem-id", description: "key: id of baseItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, baseItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(baseItemId)) requestInfo.PathParameters.Add("baseItem_id", baseItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var baseItemIdOption = new Option("--baseitem-id", description: "key: id of baseItem"); + baseItemIdOption.IsRequired = true; + command.AddOption(baseItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, baseItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Used to address any item contained in this site. This collection can't be enumerated."; + command.Description = "Used to address any item contained in this site. This collection cannot be enumerated."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--baseitem-id", description: "key: id of baseItem")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var baseItemIdOption = new Option("--baseitem-id", description: "key: id of baseItem"); + baseItemIdOption.IsRequired = true; + command.AddOption(baseItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, baseItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(baseItemId)) requestInfo.PathParameters.Add("baseItem_id", baseItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public BaseItemRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(BaseItem body, Action - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = default, Act return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(BaseItem model, Action> var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Sites/Item/Items/ItemsRequestBuilder.cs b/src/generated/Sites/Item/Items/ItemsRequestBuilder.cs index fa6eafbade0..a17da06937c 100644 --- a/src/generated/Sites/Item/Items/ItemsRequestBuilder.cs +++ b/src/generated/Sites/Item/Items/ItemsRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Used to address any item contained in this site. This collection can't be enumerated."; + command.Description = "Used to address any item contained in this site. This collection cannot be enumerated."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,32 +60,53 @@ public Command BuildCreateCommand() { return command; } /// - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Used to address any item contained in this site. This collection can't be enumerated."; + command.Description = "Used to address any item contained in this site. This collection cannot be enumerated."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,7 +132,7 @@ public ItemsRequestBuilder(Dictionary pathParameters, IRequestAd RequestAdapter = requestAdapter; } /// - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// Request headers /// Request options /// Request query parameters @@ -128,7 +153,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// /// Request headers /// Request options @@ -146,7 +171,7 @@ public RequestInformation CreatePostRequestInformation(BaseItem body, Action - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -158,7 +183,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -170,7 +195,7 @@ public async Task PostAsync(BaseItem model, Action(requestInfo, responseHandler, cancellationToken); } - /// Used to address any item contained in this site. This collection can't be enumerated. + /// Used to address any item contained in this site. This collection cannot be enumerated. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Sites/Item/Lists/Item/Columns/ColumnsRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Columns/ColumnsRequestBuilder.cs index 093c6790396..47b89e42853 100644 --- a/src/generated/Sites/Item/Lists/Item/Columns/ColumnsRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Columns/ColumnsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,28 +70,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs index ef9bbccb7ea..34027e77ebb 100644 --- a/src/generated/Sites/Item/Lists/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,18 +92,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of field definitions for this list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs index 1ae8b3837bd..8486b6fd222 100644 --- a/src/generated/Sites/Item/Lists/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs @@ -19,20 +19,24 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -40,20 +44,24 @@ public Command BuildDeleteCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, columnDefinitionId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,24 +74,30 @@ public Command BuildGetCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -104,7 +118,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -119,7 +133,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -134,7 +148,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// /// Request headers /// Request options @@ -152,7 +166,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.Sites.Item.Lists.It return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -163,7 +177,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +188,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/Sites/Item/Lists/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs index f66dba86c1a..5e3d0948995 100644 --- a/src/generated/Sites/Item/Lists/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs @@ -21,24 +21,34 @@ public class SourceColumnRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,7 +82,7 @@ public SourceColumnRequestBuilder(Dictionary pathParameters, IRe RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// Request query parameters @@ -93,7 +103,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -104,7 +114,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The source column for the content type column. + /// The source column for content type column. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/AddCopy/AddCopyRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/AddCopy/AddCopyRequestBuilder.cs index b766ed91769..968b6059518 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/AddCopy/AddCopyRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/AddCopy/AddCopyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addCopy"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/ContentTypesRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/ContentTypesRequestBuilder.cs index 588b7f441c9..54f07edeb91 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/ContentTypesRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/ContentTypesRequestBuilder.cs @@ -52,16 +52,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,28 +85,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs index 647a522ac79..4a3cbbb3fa9 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/@Ref/RefRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,14 +50,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,18 +80,24 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs index bbe28ad331a..1f8fb663b33 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action associateWithHubSites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/BaseRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/BaseRequestBuilder.cs index 9ee8e350b32..50f1a0548fa 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/BaseRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/BaseRequestBuilder.cs @@ -44,18 +44,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Parent contentType from which this content type is derived."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs index 7343086d0c6..0239edfef83 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToDefaultContentLocation"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs index 9ae1caf35c5..246e203ecf1 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/IsPublished/IsPublishedRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function isPublished"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs index ea5deaf992f..2d5f23263b7 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/Publish/PublishRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action publish"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs index 321ee8d8ed8..5ee73cf4e55 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/@Base/Unpublish/UnpublishRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unpublish"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs index 61ace2e8a12..c4f769aff2d 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action associateWithHubSites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs index fb0248ce1aa..5cbbd180bd9 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/BaseTypes/@Ref/RefRequestBuilder.cs @@ -25,26 +25,43 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,18 +80,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs index 7e28ce78d06..f4fbc222e5f 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/BaseTypes/AddCopy/AddCopyRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addCopy"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs index 812eb6f04dd..5c4a4cf3a14 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs @@ -33,30 +33,53 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types that are ancestors of this content type."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs index e284b9ae8df..ecd42c14b55 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs @@ -30,24 +30,30 @@ public List BuildCommand() { return commands; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,36 +66,59 @@ public Command BuildCreateCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -115,7 +144,7 @@ public ColumnLinksRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// Request query parameters @@ -136,7 +165,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// /// Request headers /// Request options @@ -154,7 +183,7 @@ public RequestInformation CreatePostRequestInformation(ColumnLink body, Action - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -166,7 +195,7 @@ public async Task GetAsync(Action q = d return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// @@ -178,7 +207,7 @@ public async Task PostAsync(ColumnLink model, Action(requestInfo, responseHandler, cancellationToken); } - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs index 92efa7072b1..30c92b1fc8e 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnLinks/Item/ColumnLinkRequestBuilder.cs @@ -20,22 +20,27 @@ public class ColumnLinkRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, columnLinkId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,26 +48,37 @@ public Command BuildDeleteCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, columnLinkId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, columnLinkId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,26 +91,33 @@ public Command BuildGetCommand() { return command; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The collection of columns that are required by this content type."; + command.Description = "The collection of columns that are required by this content type"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columnlink-id", description: "key: id of columnLink")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--columnlink-id", description: "key: id of columnLink"); + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, columnLinkId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnLinkId)) requestInfo.PathParameters.Add("columnLink_id", columnLinkId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -115,7 +138,7 @@ public ColumnLinkRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// @@ -130,7 +153,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Request headers /// Request options /// Request query parameters @@ -151,7 +174,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// /// Request headers /// Request options @@ -169,7 +192,7 @@ public RequestInformation CreatePatchRequestInformation(ColumnLink body, Action< return requestInfo; } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +203,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -192,7 +215,7 @@ public async Task GetAsync(Action q = default, A return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of columns that are required by this content type. + /// The collection of columns that are required by this content type /// Cancellation token to use when cancelling requests /// Request headers /// @@ -204,7 +227,7 @@ public async Task PatchAsync(ColumnLink model, ActionThe collection of columns that are required by this content type. + /// The collection of columns that are required by this content type public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs index fecc97be83f..e799b66bbae 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnPositions/@Ref/RefRequestBuilder.cs @@ -25,26 +25,43 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,18 +80,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs index f76ad01e70b..9707fff4e81 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs @@ -26,30 +26,53 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Column order information in a content type."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs index b8741ffe404..2d1b341ad76 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs @@ -37,18 +37,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,30 +73,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs index 889021518f8..67031a1cdc9 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/Item/ColumnDefinitionRequestBuilder.cs @@ -27,16 +27,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,20 +55,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,20 +98,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of column definitions for this contentType."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs index 45833a783a8..b241b88f147 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/Item/SourceColumn/@Ref/RefRequestBuilder.cs @@ -19,22 +19,27 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, columnDefinitionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,22 +47,27 @@ public Command BuildDeleteCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, columnDefinitionId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,26 +80,33 @@ public Command BuildGetCommand() { return command; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, columnDefinitionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -110,7 +127,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -125,7 +142,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// @@ -140,7 +157,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The source column for the content type column. + /// The source column for content type column. /// /// Request headers /// Request options @@ -158,7 +175,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.Sites.Item.Lists.It return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -169,7 +186,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs index afd7b2aa90f..48b35661ca3 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs @@ -21,26 +21,37 @@ public class SourceColumnRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The source column for the content type column. + /// The source column for content type column. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The source column for the content type column."; + command.Description = "The source column for content type column."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--columndefinition-id", description: "key: id of columnDefinition")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, columnDefinitionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - if (!String.IsNullOrEmpty(columnDefinitionId)) requestInfo.PathParameters.Add("columnDefinition_id", columnDefinitionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--columndefinition-id", description: "key: id of columnDefinition"); + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, columnDefinitionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,7 +85,7 @@ public SourceColumnRequestBuilder(Dictionary pathParameters, IRe RequestAdapter = requestAdapter; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Request headers /// Request options /// Request query parameters @@ -95,7 +106,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The source column for the content type column. + /// The source column for content type column. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -106,7 +117,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The source column for the content type column. + /// The source column for content type column. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ContentTypeRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ContentTypeRequestBuilder.cs index ac9ee1d14d3..72c803f5f4e 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ContentTypeRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/ContentTypeRequestBuilder.cs @@ -88,14 +88,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -109,18 +113,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -139,18 +153,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of content types present in this list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs index c8d2e713476..5633c14ee2e 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToDefaultContentLocation"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs index 1fa9d528c63..8364b063388 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function isPublished"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Publish/PublishRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Publish/PublishRequestBuilder.cs index a2fdfde3f20..92546178cd4 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Publish/PublishRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Publish/PublishRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action publish"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs index 90f33b77846..5f5fcbd3cbd 100644 --- a/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unpublish"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--contenttype-id", description: "key: id of contentType")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var contentTypeIdOption = new Option("--contenttype-id", description: "key: id of contentType"); + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, contentTypeId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(contentTypeId)) requestInfo.PathParameters.Add("contentType_id", contentTypeId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/Drive/DriveRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Drive/DriveRequestBuilder.cs index 4c2ebc5c258..778135642aa 100644 --- a/src/generated/Sites/Item/Lists/Item/Drive/DriveRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Drive/DriveRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Only present on document libraries. Allows access to the list as a [drive][] resource with [driveItems][driveItem]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); command.Handler = CommandHandler.Create(async (siteId, listId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Only present on document libraries. Allows access to the list as a [drive][] resource with [driveItems][driveItem]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Only present on document libraries. Allows access to the list as a [drive][] resource with [driveItems][driveItem]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/Items/Item/Analytics/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Items/Item/Analytics/@Ref/RefRequestBuilder.cs index ae371cef941..4ddac590dcb 100644 --- a/src/generated/Sites/Item/Lists/Item/Items/Item/Analytics/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Items/Item/Analytics/@Ref/RefRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,14 +50,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,18 +80,24 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/Items/Item/Analytics/AnalyticsRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Items/Item/Analytics/AnalyticsRequestBuilder.cs index def3f7587d5..4288aab80ca 100644 --- a/src/generated/Sites/Item/Lists/Item/Items/Item/Analytics/AnalyticsRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Items/Item/Analytics/AnalyticsRequestBuilder.cs @@ -27,18 +27,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/Items/Item/DriveItem/Content/ContentRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Items/Item/DriveItem/Content/ContentRequestBuilder.cs index d39f021050b..75b955a4075 100644 --- a/src/generated/Sites/Item/Lists/Item/Items/Item/DriveItem/Content/ContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Items/Item/DriveItem/Content/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property driveItem from sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property driveItem in sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/Items/Item/DriveItem/DriveItemRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Items/Item/DriveItem/DriveItemRequestBuilder.cs index f2f584ed32c..5f6450c3b59 100644 --- a/src/generated/Sites/Item/Lists/Item/Items/Item/DriveItem/DriveItemRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Items/Item/DriveItem/DriveItemRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/Items/Item/Fields/FieldsRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Items/Item/Fields/FieldsRequestBuilder.cs index 29efb3f95a6..222f68e5a04 100644 --- a/src/generated/Sites/Item/Lists/Item/Items/Item/Fields/FieldsRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Items/Item/Fields/FieldsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs index 08fa554438f..b71dee9cf81 100644 --- a/src/generated/Sites/Item/Lists/Item/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs index fdc00bab598..f30823936bd 100644 --- a/src/generated/Sites/Item/Lists/Item/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}")); - command.AddOption(new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}")); - command.AddOption(new Option("--interval", description: "Usage: interval={interval}")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var intervalOption = new Option("--interval", description: "Usage: interval={interval}"); + intervalOption.IsRequired = true; + command.AddOption(intervalOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, startDateTime, endDateTime, interval) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.PathParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.PathParameters.Add("endDateTime", endDateTime); - if (!String.IsNullOrEmpty(interval)) requestInfo.PathParameters.Add("interval", interval); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/Items/Item/ListItemRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Items/Item/ListItemRequestBuilder.cs index 1f0e8b5cbae..6493f71c39f 100644 --- a/src/generated/Sites/Item/Lists/Item/Items/Item/ListItemRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Items/Item/ListItemRequestBuilder.cs @@ -39,14 +39,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -77,18 +81,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,18 +121,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs index 7603281dfb3..416361b271a 100644 --- a/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, listItemVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, listItemVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, listItemVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, listItemVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs index 2bc9b28f999..34ec9a7b79b 100644 --- a/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/Item/ListItemVersionRequestBuilder.cs @@ -28,16 +28,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, listItemVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,20 +64,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, listItemVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, listItemVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,20 +107,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, listItemVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs index 4a411d16d22..b599869510f 100644 --- a/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restoreVersion"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, listItemVersionId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/VersionsRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/VersionsRequestBuilder.cs index ad59e739783..71e9a29ba11 100644 --- a/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/VersionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Items/Item/Versions/VersionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--listitem-id", description: "key: id of listItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(listItemId)) requestInfo.PathParameters.Add("listItem_id", listItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var listItemIdOption = new Option("--listitem-id", description: "key: id of listItem"); + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, listItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/Items/ItemsRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Items/ItemsRequestBuilder.cs index 67f50d7273d..ed3770f70fc 100644 --- a/src/generated/Sites/Item/Lists/Item/Items/ItemsRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Items/ItemsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All items contained in the list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/Item/ListRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/ListRequestBuilder.cs index 8ae0e19405c..13fef159e3f 100644 --- a/src/generated/Sites/Item/Lists/Item/ListRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/ListRequestBuilder.cs @@ -46,12 +46,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of lists under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); command.Handler = CommandHandler.Create(async (siteId, listId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -73,16 +76,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of lists under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,16 +120,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of lists under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/Subscriptions/Item/SubscriptionRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Subscriptions/Item/SubscriptionRequestBuilder.cs index eea3a952166..4566e11cd0e 100644 --- a/src/generated/Sites/Item/Lists/Item/Subscriptions/Item/SubscriptionRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Subscriptions/Item/SubscriptionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); command.Handler = CommandHandler.Create(async (siteId, listId, subscriptionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, subscriptionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, subscriptionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, subscriptionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Lists/Item/Subscriptions/SubscriptionsRequestBuilder.cs b/src/generated/Sites/Item/Lists/Item/Subscriptions/SubscriptionsRequestBuilder.cs index 872433258fb..035ee96c0b1 100644 --- a/src/generated/Sites/Item/Lists/Item/Subscriptions/SubscriptionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/Item/Subscriptions/SubscriptionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, listId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The set of subscriptions on the list."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--list-id", description: "key: id of list")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, listId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(listId)) requestInfo.PathParameters.Add("list_id", listId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var listIdOption = new Option("--list-id", description: "key: id of list"); + listIdOption.IsRequired = true; + command.AddOption(listIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, listId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Lists/ListsRequestBuilder.cs b/src/generated/Sites/Item/Lists/ListsRequestBuilder.cs index 16f0d5322be..431da087afe 100644 --- a/src/generated/Sites/Item/Lists/ListsRequestBuilder.cs +++ b/src/generated/Sites/Item/Lists/ListsRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of lists under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,26 +71,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of lists under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs index 4abf75c626a..f43623132bf 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getNotebookFromWebUrl"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs index 4ba7e24a752..4a6f3143e94 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getRecentNotebooks"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--includepersonalnotebooks", description: "Usage: includePersonalNotebooks={includePersonalNotebooks}")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var includePersonalNotebooksOption = new Option("--includepersonalnotebooks", description: "Usage: includePersonalNotebooks={includePersonalNotebooks}"); + includePersonalNotebooksOption.IsRequired = true; + command.AddOption(includePersonalNotebooksOption); command.Handler = CommandHandler.Create(async (siteId, includePersonalNotebooks) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.PathParameters.Add("includePersonalNotebooks", includePersonalNotebooks); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs index 8c81ca00203..7a196e3a391 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/NotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/NotebookRequestBuilder.cs index 24d8836c54c..3c2a95ce59c 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/NotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/NotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index b9fe64373f9..4349a431a69 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index b27ca186df6..29564d12853 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 6e06bc70069..5b0b11c766c 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 4b08f63462d..8fdf354bdba 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,18 +55,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,18 +112,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 295585a2e01..bd906c183ec 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index a73e675e8c9..bc82920dc55 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 0b1cbe531a5..fbfeeddc3cf 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index a7869257989..b14b2fed69e 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index ecdf1043fa2..95fb6a2063f 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,16 +43,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,20 +71,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,20 +138,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index b5502f2bde5..a268e20ae81 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,19 +25,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -60,20 +66,28 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 4fef590927b..c1862cfca9e 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 864f75f675a..45de6807324 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,18 +45,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -70,22 +76,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -129,22 +147,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 9815ac7d6ef..4f6cfb8e151 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 143532ebd67..e3cd08d117f 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 76aac1c1d75..250faf28934 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,18 +33,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,22 +64,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,22 +110,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 4423417a6d6..92c85fbc36d 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 343cac6c772..062efe2558b 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index f69788f2d05..82d26f8f029 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -65,22 +71,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,22 +117,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 4c9a3ba9a0a..f60fb0d349d 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs index a2ee8b07224..031a3cc393e 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,20 +41,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,32 +80,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index efe280029ba..981a1392256 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 19325354c96..d9e1eb246b4 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 8e1c5c1a4fe..d47660b2ef9 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index ca7a03ea66a..400ada928d9 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs index f39b8712596..0a0215c1143 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 11fbfe90d2d..6a097d31ee5 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 11fab6cfba7..a8a137502cd 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index c83755c00e6..f2eeb5be882 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,18 +136,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index bbc479c165c..d69d8dc5366 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,17 +25,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -58,18 +63,25 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 1c4cf30cab8..961e53ececc 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index e9173cd9f4c..2bb6f95e0f6 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,16 +45,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -68,20 +73,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -125,20 +141,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 01a7254af6f..5f565783d37 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index e0a888adcdc..0ce24ad8708 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index f6e02264b2f..52e60ccb34e 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 82e652c6906..9e30a5f427a 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index b5a0c540df6..b9e9c78bac2 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index 8ed02db6ad6..48191b9441c 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 101bffb2343..3b1414e5b7d 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs index a77a9e2a9a2..edfc4eecbff 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 1c6d84418d2..518e30fc1a9 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 7e88308f13e..98196b62675 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 97b121b91f9..c935bfdd2bc 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index 3677c92f73e..7b4dacca542 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 24817d09ceb..79fe1514c45 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 6477a42b116..1428818da36 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,14 +29,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +54,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -101,18 +115,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index e690cf49b22..b40825b3501 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index 2972cbfe176..091119c2934 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 80c4c70b58c..03c51d09387 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 36cbdfd198e..7dedb609a9e 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index 943bd78696f..fcfe28284b5 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index 4e925dd865d..5af1e734822 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs index 306964b4908..42ae3622b60 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, notebookId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, notebookId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Notebooks/NotebooksRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Notebooks/NotebooksRequestBuilder.cs index 700c949f849..7f91e796aa6 100644 --- a/src/generated/Sites/Item/Onenote/Notebooks/NotebooksRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Notebooks/NotebooksRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,26 +77,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/OnenoteRequestBuilder.cs b/src/generated/Sites/Item/Onenote/OnenoteRequestBuilder.cs index 131daa1f149..396d1f0d7f9 100644 --- a/src/generated/Sites/Item/Onenote/OnenoteRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/OnenoteRequestBuilder.cs @@ -32,10 +32,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Calls the OneNote service for notebook related operations."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); command.Handler = CommandHandler.Create(async (siteId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,14 +51,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Calls the OneNote service for notebook related operations."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,14 +107,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Calls the OneNote service for notebook related operations."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs index 21e9b44ca15..b50411e824a 100644 --- a/src/generated/Sites/Item/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenoteoperation-id", description: "key: id of onenoteOperation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteOperationIdOption = new Option("--onenoteoperation-id", description: "key: id of onenoteOperation"); + onenoteOperationIdOption.IsRequired = true; + command.AddOption(onenoteOperationIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteOperationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteOperationId)) requestInfo.PathParameters.Add("onenoteOperation_id", onenoteOperationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenoteoperation-id", description: "key: id of onenoteOperation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteOperationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteOperationId)) requestInfo.PathParameters.Add("onenoteOperation_id", onenoteOperationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteOperationIdOption = new Option("--onenoteoperation-id", description: "key: id of onenoteOperation"); + onenoteOperationIdOption.IsRequired = true; + command.AddOption(onenoteOperationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteOperationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenoteoperation-id", description: "key: id of onenoteOperation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteOperationIdOption = new Option("--onenoteoperation-id", description: "key: id of onenoteOperation"); + onenoteOperationIdOption.IsRequired = true; + command.AddOption(onenoteOperationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteOperationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteOperationId)) requestInfo.PathParameters.Add("onenoteOperation_id", onenoteOperationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Operations/OperationsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Operations/OperationsRequestBuilder.cs index 6f2b4495964..4921b872bf3 100644 --- a/src/generated/Sites/Item/Onenote/Operations/OperationsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Operations/OperationsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/Content/ContentRequestBuilder.cs index 26c2e61e788..2ee823332bc 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 50952d48a5d..65ebd3bc9e2 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/OnenotePageRequestBuilder.cs index 5430efe51ce..4ca1bb1d7d2 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,12 +45,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,16 +67,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,16 +134,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index cf6e2a0f0ea..19eb7781dea 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 00b6293f1fb..d559b1ae942 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 45789afa096..5b767620be3 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 75dd1b3ab8b..3e1b8c46186 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index b2ed9cf62f3..b2665c62949 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index b85326173c5..3765f75b8ad 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 858143aee48..755c130f5c0 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,18 +55,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,18 +112,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 4cebf2227e1..12450b00239 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 4ffb87ccd59..d2ad3f0c8a8 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 25ddc98ea63..7ca48212528 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 8aa65728645..151903308f0 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 6378dc3d266..56bab1436bf 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,16 +43,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,20 +71,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,20 +138,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 8bdda535e36..f6dbdc3eac6 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,19 +25,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -60,20 +66,28 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 88d880e714d..4653f265796 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 243f4c59012..b392daa1832 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -43,18 +43,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -68,22 +74,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,22 +126,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 0e0ef988888..b30faacd166 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 5868360a60e..cd3ea72ef8c 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs index 0bd42369302..a99589e174b 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -39,20 +39,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,32 +78,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 8f85adbee30..d6b07952abb 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index acbe1fad310..3dded00cc66 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index c71bb526938..11a1406bae1 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index 15a70f67a27..aa0d398d304 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index d99db4b37b4..a1f4ce0f21d 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 2df0d47f454..59ccdfaca01 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 52dac74ef93..7267c790b9b 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index ba20ce2d541..78cd6042502 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,18 +136,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 99d3936be36..fa17d858f23 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,17 +25,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenotePageId1, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -58,18 +63,25 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenotePageId1, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index d95f2240f48..ace3cc7934f 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 7af308da6d7..c315bbbca5d 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -43,16 +43,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,20 +71,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenotePageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenotePageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -104,20 +120,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 0965fcc0bcb..d4b2d9cc02b 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 63f731217eb..5d6654eb9b6 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs index a5451e80b77..20d2135c4b5 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs @@ -39,18 +39,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,30 +75,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index b9365e7aac1..adf6f5b9713 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index ac07cb181a4..23bef275555 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 9b8c65622c1..1a2f6c41d22 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index cc72091f43e..02b1c9e9849 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index c303b07abb2..c614b1e5465 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index d140a02210e..ac922198121 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,14 +29,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +54,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -101,18 +115,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index 1929b5890e3..4abf7b1d915 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index ebddfe4f93f..8b71639bda0 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index b72ef95886e..b94d3007076 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 368e57f5672..8cca46fd99a 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index 1c47f75804b..eb3da95d541 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index 434ccba37bc..4aeca294a77 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 61e18deef3d..235ed09cd52 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 8e08cf4972d..21c72bf8c32 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 461ca5dcf76..33e240e5ec8 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs index 1460d130104..d488df3d2c4 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenotePageId1, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenotePageId1, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index d93f3ab9619..2f795022f96 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs index 60087ddd61f..d9476a44671 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenotePageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenotePageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenotePageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -100,18 +114,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 2931b5416db..ea05466b626 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs index cc037ec6ced..a0019619092 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenotePageId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs index d74a6373ee3..20eb4f22c01 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs @@ -39,16 +39,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,28 +72,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 6f9fa84fcd8..18075de5f72 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs index d3ddd560046..01c8a668bfb 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index f0d93e6e74a..5780937cac8 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 5e5ebb8c8bd..33ee5d03b8b 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index b257502cc97..f3445b7848b 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index bb798fe58f3..482c289732a 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,18 +55,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,18 +112,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 05cb1f6be1d..417eae2bc2f 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 931e632c12b..f22b4beda02 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 563087ae097..b343b4eea02 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index b2f48c35203..a411f26cbd6 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 7da2dfb95c5..06e02aa6fbc 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index 278166a896d..52154256009 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 3e2d9e2186b..345377bdfb5 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index d5f31500698..0cdb6c7c91c 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index bf165678e52..7570883c1ff 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index f421e1755b6..0beac9928a9 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs index e23bfec74f1..d8cb4872da3 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 098f477c743..5ef39e58dde 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index a594509523e..6d15af9846c 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 3871a95fe5d..fb2df3813d3 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 7b27b026c47..19c5a624364 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 13b880a576a..aed89137cd0 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 0ce39f300b9..9bb80cbe811 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index fa4505f061c..8af9b44c53c 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs index b616cb20524..0222d62e97d 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 47b2ad52577..29b1ba2e0d5 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 31257f726e7..6282f0f938e 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,12 +29,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +51,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,16 +111,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index fd348521fbf..be24a4fc922 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index 8c54cdd2583..aab164622a4 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index a924103cf5e..049d65c21e7 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 3085d709995..314d11a18f9 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index 67e0801d10d..f179ab40b18 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index f17fd7da3ad..fe436545d26 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index 0330d1132a5..f1d380b3a10 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,16 +65,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,16 +132,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs index a2848e19473..fd351052d0d 100644 --- a/src/generated/Sites/Item/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Pages/PagesRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Pages/PagesRequestBuilder.cs index 2c4f1889d87..ccb39abbcf7 100644 --- a/src/generated/Sites/Item/Onenote/Pages/PagesRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Pages/PagesRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,26 +71,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Resources/Item/Content/ContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Resources/Item/Content/ContentRequestBuilder.cs index 30d319576fd..cdb370403bc 100644 --- a/src/generated/Sites/Item/Onenote/Resources/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Resources/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property resources from sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (siteId, onenoteResourceId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property resources in sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); - command.AddOption(new Option("--file", description: "Binary request body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (siteId, onenoteResourceId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs index 408c1307962..5687ee95fa1 100644 --- a/src/generated/Sites/Item/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteResourceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteResourceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteResourceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Resources/ResourcesRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Resources/ResourcesRequestBuilder.cs index a71f3ae51c4..7aaaf9658c1 100644 --- a/src/generated/Sites/Item/Onenote/Resources/ResourcesRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Resources/ResourcesRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 560839ba513..beb6cd1d30a 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 90889c0335b..a890362b1c3 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 56a5787eed5..60ffe665167 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index e60249925ef..56c1187ba16 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index c607cd02d55..b0423c3de21 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index f596b7410b8..22c7bf8b99d 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 724f23273a6..a0d2ee23bbf 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -118,18 +132,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 229c599ee40..4c4f601554c 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,17 +25,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -58,18 +63,25 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index a59c1287bb7..0c2d3e29224 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 5c3bf34dc74..f4d2907ca8c 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,16 +45,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -68,20 +73,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -125,20 +141,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 3ad93b88738..60efa2d87d0 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 6c0974669e1..4fff3a3231f 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 48c5c743719..6377946eaa8 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 4feb48b6669..37b17ca9429 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 7132d193870..ee4421b9432 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index 847c7df080a..20eb3a5d4fe 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index a8c3d6651bf..d66878465c2 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs index 76a50aa7183..868f10925d3 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index c3ffa798d29..919b4047919 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index d5a6b9748d9..c358be491df 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 0fadc3d30ad..3caaf33784d 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index e00f5887e6f..36359c83103 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 4dc6454c476..4b848884281 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs index d2d0f93dfa3..a75b0a0297d 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,12 +30,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,16 +52,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,16 +108,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 2746d1e72ea..e617e4b21ad 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 296c7e625ba..3b2ef11a3d3 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 2f533c695fe..7060965520d 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 19d6dd72150..cf3259f18be 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index e4df5593d3a..19144b45194 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,18 +134,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index cb02f54cedc..3bd6265584e 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,17 +25,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -58,18 +63,25 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index e363664b852..f86ff7537e2 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index f344d0286c0..d5fa411146f 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,16 +45,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -68,20 +73,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -127,20 +143,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index bce8fd7b728..d681dd8be20 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 191ec1e7da8..1cc2ea7163b 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 9d1312c5395..c4bad35b2b5 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,16 +35,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,20 +63,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -90,20 +106,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 3da0d59f859..dfb3b7fe4cc 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index dcde1a5fb95..20169dfa727 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 4bef7b2cbf1..394814c647f 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 4aebac0e003..9fc9653b6ab 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index db2f34b1cd8..f8c5c98c509 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -65,22 +71,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,22 +117,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 3dbd07040cd..524082d66ef 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,20 +38,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,32 +77,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 6786274647c..4968a38b1f5 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index ec80fa01d33..a750d033f92 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index d195838b4d6..54109d8a312 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 142732d4bf6..39637181633 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs index 6d2e6a9a040..5a5521cf14b 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 97c88ebc774..a98727ca238 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 6477514c13b..d067d09c39c 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,14 +35,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index a9a20d4fe32..88105238e94 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index f24f14ca4b8..e77095db6a0 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 181aa1802a6..5e679c5375a 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 4f09f57b17e..5759500807f 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 5bad43ca3d2..fcc216556f1 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 472e88b007c..9b678cc3a8a 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index b50b1c460ca..3dc8bfb0893 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index bb3d0bf5a58..b122a643a05 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs index f48aeee55cf..5d580b903c8 100644 --- a/src/generated/Sites/Item/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +70,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index dca77893caf..dec4efc67e8 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 5ae32ad52dc..8d5dd33ae44 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs index 12acfebc0c6..12a25ae6db6 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,16 +65,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,16 +132,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 5b1ac09836f..56b0087ffa0 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 507d9cc4588..dba01908894 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index f3bee64288d..98966fb7b99 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,14 +45,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,18 +70,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -123,18 +137,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index defc7193de0..8a0486311d5 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 4bc9711f3a2..87108453935 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index b0598b5aeb4..a73582cb42a 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,14 +35,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 75ba8918271..3b0800e6fdd 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 8fddf0356ff..6244767485d 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 6c3b2fccd42..e75a8b947c3 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 1fbc19cb8ad..b31a7d1eac3 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,16 +30,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,20 +58,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -102,20 +118,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 0fd8e7a85db..db83d104a88 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 76842f7c349..ebff24061a4 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index e98a24fe27f..1b0eebca353 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index bdbf4db8708..3fef02bc8e5 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 5bd36010b8e..40868a86e98 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -65,22 +71,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,22 +117,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index 5fd86c88f16..3543305796f 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -38,20 +38,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,32 +77,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index c4c0ac4a2ca..b07b4a6aeb4 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,30 +76,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index f9e04ba6e4c..e5b0f27c262 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 01e05ae9e1a..5d5cfc4a219 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 737e382af3e..63364296e23 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 13eb206d90d..9986e3df5ee 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index f6fac7fec13..7eab65aebbb 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index affbc2846da..40127fd6477 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index 119b2f18534..4c9119aaba4 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 9ed87076323..4af34949301 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs index 90111d1f09f..0ceb01d401c 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index b0c32b18dcf..5af87eea148 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index ea835492c15..7f00f160432 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 44afe1b6528..d6e5b507277 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 113cc3df8bd..a7503c38f14 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 4ee5d95cbb6..7479184be80 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index adf1b0bbf08..f802a09b06f 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,18 +55,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,18 +112,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index d1c914e4e49..b465af76658 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index cbe862cdc3f..02c950b0b12 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 099a0236907..34b4334aebb 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 7499a99d0cf..218ddcf3027 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index f70ef2c8933..fc7b6fc28fd 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index 238dc571d12..11a82403876 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index e64a0dfae3f..e5c35fca3c5 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 8c05c786b56..c50600de758 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 1179c251065..767cca65d1a 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index d49a1c7f528..73a2d414b66 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index d66dfd5cc09..6b89e295c72 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 17d61726cd3..2ab93452c39 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index 1e1ea5d7e10..c147e42b342 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 02349184251..99809039b60 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 26f16ea9e1a..09a1d9ddc9c 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 72b25c55611..678e5578719 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 612b9e372fd..d75812ba8da 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 8b6cd58dfcf..655b0d670dc 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs index de6ff47ece6..630dbff9a2e 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index ee618610723..bee9c119419 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 591f6822a27..f4c448f10ea 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,12 +29,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +51,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,16 +111,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index fb30ebe3026..f7210407e04 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index 316681000f8..32465a2b2ae 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index f544b2e4ebc..ee5b10f0d58 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 0f065284f88..053d6a951a8 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index d782d67e44e..3904bdf132e 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index ec4a7e90417..7b301689922 100644 --- a/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Onenote/Sections/SectionsRequestBuilder.cs b/src/generated/Sites/Item/Onenote/Sections/SectionsRequestBuilder.cs index 3bad5cd04d6..07648e11393 100644 --- a/src/generated/Sites/Item/Onenote/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Onenote/Sections/SectionsRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,26 +71,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Permissions/Item/Grant/GrantRequestBuilder.cs b/src/generated/Sites/Item/Permissions/Item/Grant/GrantRequestBuilder.cs index 30e6093ae79..95d1b8813a1 100644 --- a/src/generated/Sites/Item/Permissions/Item/Grant/GrantRequestBuilder.cs +++ b/src/generated/Sites/Item/Permissions/Item/Grant/GrantRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action grant"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--permission-id", description: "key: id of permission")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var permissionIdOption = new Option("--permission-id", description: "key: id of permission"); + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, permissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(permissionId)) requestInfo.PathParameters.Add("permission_id", permissionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/Permissions/Item/PermissionRequestBuilder.cs b/src/generated/Sites/Item/Permissions/Item/PermissionRequestBuilder.cs index fa405cf1199..fd8dc8c9384 100644 --- a/src/generated/Sites/Item/Permissions/Item/PermissionRequestBuilder.cs +++ b/src/generated/Sites/Item/Permissions/Item/PermissionRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permissions associated with the site. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--permission-id", description: "key: id of permission")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var permissionIdOption = new Option("--permission-id", description: "key: id of permission"); + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); command.Handler = CommandHandler.Create(async (siteId, permissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(permissionId)) requestInfo.PathParameters.Add("permission_id", permissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permissions associated with the site. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--permission-id", description: "key: id of permission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, permissionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(permissionId)) requestInfo.PathParameters.Add("permission_id", permissionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var permissionIdOption = new Option("--permission-id", description: "key: id of permission"); + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, permissionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,16 +92,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permissions associated with the site. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--permission-id", description: "key: id of permission")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var permissionIdOption = new Option("--permission-id", description: "key: id of permission"); + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, permissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(permissionId)) requestInfo.PathParameters.Add("permission_id", permissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Permissions/PermissionsRequestBuilder.cs b/src/generated/Sites/Item/Permissions/PermissionsRequestBuilder.cs index 285a0fb8b0f..85c7996de6c 100644 --- a/src/generated/Sites/Item/Permissions/PermissionsRequestBuilder.cs +++ b/src/generated/Sites/Item/Permissions/PermissionsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permissions associated with the site. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permissions associated with the site. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/SiteRequestBuilder.cs b/src/generated/Sites/Item/SiteRequestBuilder.cs index 571708d4167..8c004cd8dc1 100644 --- a/src/generated/Sites/Item/SiteRequestBuilder.cs +++ b/src/generated/Sites/Item/SiteRequestBuilder.cs @@ -65,10 +65,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); command.Handler = CommandHandler.Create(async (siteId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -104,14 +106,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from sites by key"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -158,14 +168,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in sites"; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Sites/Item/SiteRequestBuilder.cs b/src/generated/Sites/Item/Sites/Item/SiteRequestBuilder.cs index 6931c386e01..b99c3fb985d 100644 --- a/src/generated/Sites/Item/Sites/Item/SiteRequestBuilder.cs +++ b/src/generated/Sites/Item/Sites/Item/SiteRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of the sub-sites under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--site-id1", description: "key: id of site")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var siteId1Option = new Option("--site-id1", description: "key: id of site"); + siteId1Option.IsRequired = true; + command.AddOption(siteId1Option); command.Handler = CommandHandler.Create(async (siteId, siteId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(siteId1)) requestInfo.PathParameters.Add("site_id1", siteId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of the sub-sites under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--site-id1", description: "key: id of site")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, siteId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(siteId1)) requestInfo.PathParameters.Add("site_id1", siteId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var siteId1Option = new Option("--site-id1", description: "key: id of site"); + siteId1Option.IsRequired = true; + command.AddOption(siteId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, siteId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of the sub-sites under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--site-id1", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var siteId1Option = new Option("--site-id1", description: "key: id of site"); + siteId1Option.IsRequired = true; + command.AddOption(siteId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, siteId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(siteId1)) requestInfo.PathParameters.Add("site_id1", siteId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/Sites/SitesRequestBuilder.cs b/src/generated/Sites/Item/Sites/SitesRequestBuilder.cs index d4fea566564..31cb899cf09 100644 --- a/src/generated/Sites/Item/Sites/SitesRequestBuilder.cs +++ b/src/generated/Sites/Item/Sites/SitesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of the sub-sites under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of the sub-sites under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/GroupsRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/GroupsRequestBuilder.cs index e7e92b507f9..ae03aa986f5 100644 --- a/src/generated/Sites/Item/TermStore/Groups/GroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/GroupsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of all groups available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of all groups available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/GroupRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/GroupRequestBuilder.cs index c39641df216..fe1c1fdd2a8 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/GroupRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/GroupRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of all groups available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of all groups available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of all groups available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/ChildrenRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/ChildrenRequestBuilder.cs index 661f7ca31cf..ccad1a03ed2 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/ChildrenRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/ChildrenRequestBuilder.cs @@ -39,18 +39,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,30 +75,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs index 8d1233e95b5..971065bb1aa 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs index 66697908905..ffbb85aa30b 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, termId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, termId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, termId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, termId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs index f2f107a7a50..aa9664b3c79 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs index bd76289d93d..f382562e7de 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs index 54fef9dfa34..93fce42433a 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs @@ -29,18 +29,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,22 +67,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,22 +113,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs index fbc5bdd3a22..6919599f15c 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs index 022c86d9c35..76a081c1429 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs index c433d95ed84..284e01292aa 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs index 30b16f3f5b0..9ac2cb4e503 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs index 62b67bfdfcd..ff00555fdc8 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs @@ -39,20 +39,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,32 +78,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs index 0b4da9cfcf0..1916179f9ce 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Set/SetRequestBuilder.cs index 0b311ad8a31..b0c9858b16f 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/Set/SetRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/TermRequestBuilder.cs index 0ed04508020..3155d045180 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Children/Item/TermRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,20 +64,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,20 +107,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs index 8bbcce8c9de..6f92aed387f 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The parent [group] that contains the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The parent [group] that contains the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The parent [group] that contains the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs index 0a32f0b0661..599223dcff1 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs index 020fb5b4a63..a49dfd9b4e5 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/RelationRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/RelationRequestBuilder.cs index a9e36168c9c..e11611ba073 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/RelationRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/RelationRequestBuilder.cs @@ -29,16 +29,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,20 +64,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,20 +107,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs index 049b0403fdd..143c728b5d8 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs index 3f68e245d33..da3a7a7044e 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs index 63b228d362d..c99b535d226 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs index 5eec237a263..472440aeb77 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/RelationsRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/RelationsRequestBuilder.cs index a31886b6fc8..f0149c2151b 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/RelationsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Relations/RelationsRequestBuilder.cs @@ -39,18 +39,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,30 +75,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/SetRequestBuilder.cs index 61dc35a13af..fbe4fb1fcc9 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/SetRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,18 +62,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,18 +110,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs index a28a968c1f8..5df0e44501c 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs index 7e11a9f2dd6..f3fb5b0eb3a 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, termId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, termId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, termId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, termId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs index 463d671a510..9e1d100081c 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs index a47e34230ea..35ba066a0a8 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs index 8b58c357c51..3a120b2bd85 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs @@ -29,18 +29,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,22 +67,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,22 +113,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs index e664ddaff1d..a017434e4d2 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs index b7ec54a1384..d4af9ff8b5c 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs index 58fbd423cc2..1dd9812fb32 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs index 38d7beeb3e2..6a95c8b55f3 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs index ab04fec8ed1..cc5dc27b75e 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs @@ -39,20 +39,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,32 +78,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs index 4f393e511a3..54045557670 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs index b5dd1f19b1e..e7f464a0c4a 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/TermRequestBuilder.cs index 525f63951d5..cbe094be0c2 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/Item/TermRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,20 +64,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,20 +107,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/TermsRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/TermsRequestBuilder.cs index ed7d8f2cd6d..f798b9425ef 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/TermsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/Item/Terms/TermsRequestBuilder.cs @@ -39,18 +39,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,30 +75,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, setId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, setId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/SetsRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/SetsRequestBuilder.cs index 998ec84f5cb..93342c14ed5 100644 --- a/src/generated/Sites/Item/TermStore/Groups/Item/Sets/SetsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Groups/Item/Sets/SetsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Children/ChildrenRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Children/ChildrenRequestBuilder.cs index 993613111fc..ec03fb4352a 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Children/ChildrenRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Children/ChildrenRequestBuilder.cs @@ -39,16 +39,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,28 +72,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs index 000dd8b8237..e2a3975eb61 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs index 4ec5b61d4e4..50e59177915 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); command.Handler = CommandHandler.Create(async (siteId, setId, termId, termId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, termId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, termId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, termId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs index 4c84de4266a..a17bee3d823 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs index 506ce1aece1..777f6d20c2e 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs index 3f5c51b5a27..f5d71fc1490 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs @@ -29,16 +29,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,20 +64,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,20 +107,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs index c1ce157fd0a..989905fb26e 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs index 919512c4214..5a245b88918 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs index 9af1766863a..8ed3d413324 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs index 244e8903b0b..47deab62a0c 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs index 343ad4ac77b..71410a46ad9 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs @@ -39,18 +39,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,30 +75,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs index c5c91393374..afdaea58328 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,14 +50,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,18 +80,24 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Set/SetRequestBuilder.cs index 18fb3ffe15c..581fce694c1 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/Set/SetRequestBuilder.cs @@ -27,18 +27,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/TermRequestBuilder.cs index 386058f6279..1fffd7ba288 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Children/Item/TermRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs index 04c357b148a..4c8d313c88e 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The parent [group] that contains the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); command.Handler = CommandHandler.Create(async (siteId, setId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The parent [group] that contains the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The parent [group] that contains the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/ParentGroup/Sets/Item/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/ParentGroup/Sets/Item/SetRequestBuilder.cs index 83867125345..47d6d59678b 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/ParentGroup/Sets/Item/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/ParentGroup/Sets/Item/SetRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--set-id1", description: "key: id of set")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var setId1Option = new Option("--set-id1", description: "key: id of set"); + setId1Option.IsRequired = true; + command.AddOption(setId1Option); command.Handler = CommandHandler.Create(async (siteId, setId, setId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(setId1)) requestInfo.PathParameters.Add("set_id1", setId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--set-id1", description: "key: id of set")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, setId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(setId1)) requestInfo.PathParameters.Add("set_id1", setId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var setId1Option = new Option("--set-id1", description: "key: id of set"); + setId1Option.IsRequired = true; + command.AddOption(setId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, setId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--set-id1", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var setId1Option = new Option("--set-id1", description: "key: id of set"); + setId1Option.IsRequired = true; + command.AddOption(setId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, setId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(setId1)) requestInfo.PathParameters.Add("set_id1", setId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/ParentGroup/Sets/SetsRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/ParentGroup/Sets/SetsRequestBuilder.cs index f610ba25947..d791e1f17b2 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/ParentGroup/Sets/SetsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/ParentGroup/Sets/SetsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs index 4a9c8dfe5f8..e8dee2ebc4b 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,14 +50,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,18 +80,24 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs index 2f1d9e3fe4a..a4e41c3b905 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs @@ -27,18 +27,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/RelationRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/RelationRequestBuilder.cs index b4020f91443..577d04e426d 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/RelationRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/RelationRequestBuilder.cs @@ -29,14 +29,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs index 12c2a49ab5e..5a22a1c20aa 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,14 +50,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,18 +80,24 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs index 702e8299cec..1e5a977d256 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs @@ -27,18 +27,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs index 82df2e0550c..8adc383f64e 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,14 +50,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,18 +80,24 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs index 2dc1a25a0c1..d5cb17ea736 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs @@ -27,18 +27,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/RelationsRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/RelationsRequestBuilder.cs index fb70b1ec78d..e7b661d2bca 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Relations/RelationsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Relations/RelationsRequestBuilder.cs @@ -39,16 +39,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,28 +72,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/SetRequestBuilder.cs index 0d4847e5d14..e4e93c07ce9 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/SetRequestBuilder.cs @@ -37,12 +37,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of all sets available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); command.Handler = CommandHandler.Create(async (siteId, setId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,16 +59,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of all sets available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -93,16 +105,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of all sets available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs index 2e1ac8cd6b9..e18c18de2a5 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs index 60514c36b37..64fe5ed018d 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); command.Handler = CommandHandler.Create(async (siteId, setId, termId, termId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, termId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, termId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, termId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs index c432ec5d4f3..20df436ba7f 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs index e59754a8f3b..611b175737c 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs index 5a5ae7fd158..89c9bf548bc 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs @@ -29,16 +29,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,20 +64,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,20 +107,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs index 0fd03446ed9..c86212e4c0d 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs index a876317f0bd..c6190e023a3 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs index 428a231c172..06c6a293fd0 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs index 0808bcacda9..8a0b57d91ad 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs index 9eb6acd0dd0..5f4d4495b61 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs @@ -39,18 +39,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,30 +75,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs index 26f02b67e35..94fba3a04ec 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,14 +50,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,18 +80,24 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs index aab9cb77619..d7fcc8bbd88 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs @@ -27,18 +27,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/TermRequestBuilder.cs index 01a7dbba5d4..545cf3e979b 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/Item/TermRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/TermsRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/TermsRequestBuilder.cs index 2d6ed5140f6..e37f9759c4e 100644 --- a/src/generated/Sites/Item/TermStore/Sets/Item/Terms/TermsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/Item/Terms/TermsRequestBuilder.cs @@ -39,16 +39,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,28 +72,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, setId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, setId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/Sets/SetsRequestBuilder.cs b/src/generated/Sites/Item/TermStore/Sets/SetsRequestBuilder.cs index d95179e2c73..118956d61f9 100644 --- a/src/generated/Sites/Item/TermStore/Sets/SetsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/Sets/SetsRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of all sets available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +70,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of all sets available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStore/TermStoreRequestBuilder.cs b/src/generated/Sites/Item/TermStore/TermStoreRequestBuilder.cs index 06d9b3e874d..bf2f59d24f8 100644 --- a/src/generated/Sites/Item/TermStore/TermStoreRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStore/TermStoreRequestBuilder.cs @@ -22,16 +22,18 @@ public class TermStoreRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The default termStore under this site. + /// The termStore under this site. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The default termStore under this site."; + command.Description = "The termStore under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); command.Handler = CommandHandler.Create(async (siteId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,20 +41,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// The default termStore under this site. + /// The termStore under this site. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The default termStore under this site."; + command.Description = "The termStore under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,20 +82,24 @@ public Command BuildGroupsCommand() { return command; } /// - /// The default termStore under this site. + /// The termStore under this site. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The default termStore under this site."; + command.Description = "The termStore under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -113,7 +127,7 @@ public TermStoreRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// The default termStore under this site. + /// The termStore under this site. /// Request headers /// Request options /// @@ -128,7 +142,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The default termStore under this site. + /// The termStore under this site. /// Request headers /// Request options /// Request query parameters @@ -149,7 +163,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The default termStore under this site. + /// The termStore under this site. /// /// Request headers /// Request options @@ -167,7 +181,7 @@ public RequestInformation CreatePatchRequestInformation(Store body, Action - /// The default termStore under this site. + /// The termStore under this site. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -178,7 +192,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The default termStore under this site. + /// The termStore under this site. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -190,7 +204,7 @@ public async Task GetAsync(Action q = default, Action return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The default termStore under this site. + /// The termStore under this site. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -202,7 +216,7 @@ public async Task PatchAsync(Store model, Action> h var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// The default termStore under this site. + /// The termStore under this site. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/GroupsRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/GroupsRequestBuilder.cs index 2e471789931..633b0112079 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/GroupsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/GroupsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of all groups available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,28 +70,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of all groups available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/GroupRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/GroupRequestBuilder.cs index 5c47fcc418e..77dbe4b4220 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/GroupRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/GroupRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of all groups available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of all groups available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,18 +92,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of all groups available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/ChildrenRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/ChildrenRequestBuilder.cs index 508de9a04dc..75f993b0fd1 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/ChildrenRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/ChildrenRequestBuilder.cs @@ -39,20 +39,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,32 +78,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs index 5047a05d8c2..307cab107de 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs @@ -36,22 +36,30 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,34 +78,59 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs index 6b2ecc40000..73ba91b9f8a 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, termId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,24 +60,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, termId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, termId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -89,24 +109,33 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, termId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs index b3d5f612044..8399fb6c731 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,20 +59,27 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,24 +98,33 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs index bcab1f35744..18c46e091bb 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs @@ -27,24 +27,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs index 0092c98ceb4..5947a3d13ba 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs @@ -29,20 +29,27 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,24 +70,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,24 +119,33 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs index 2f37f986413..9d76b17360d 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,20 +59,27 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,24 +98,33 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs index 9d10a6959ba..d81790afcc4 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs @@ -27,24 +27,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs index 1cfb73da63d..65a38d3bcda 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,20 +59,27 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,24 +98,33 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs index 2493fed35a1..8b783b08737 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs @@ -27,24 +27,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs index 4497a035247..a94ffd5412c 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs @@ -39,22 +39,30 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,34 +81,59 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs index 8468bf16208..386e34e30c2 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Set/SetRequestBuilder.cs index 6e66ca7ed21..d2aa30a753c 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/Set/SetRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/TermRequestBuilder.cs index c4120a03f6d..7f0bc0178c0 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Children/Item/TermRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,22 +67,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,22 +113,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs index 866d01cee60..b355b86126a 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The parent [group] that contains the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The parent [group] that contains the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The parent [group] that contains the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs index 88d03a4280d..133af17dcf1 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs index 4f1f53cb440..29a36eb385b 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/RelationRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/RelationRequestBuilder.cs index 3d5845ae2b2..ed2fbc32ced 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/RelationRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/RelationRequestBuilder.cs @@ -29,18 +29,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,22 +67,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,22 +113,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs index ac7383de5b3..9b026a96cf1 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs index e83731c709f..c0e83439db8 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs index 5d8846fb461..41d3e8a4474 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs index c9210d32fab..b7243374732 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/RelationsRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/RelationsRequestBuilder.cs index 295322b4d03..12a02dc9dfa 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/RelationsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Relations/RelationsRequestBuilder.cs @@ -39,20 +39,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,32 +78,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/SetRequestBuilder.cs index dcfcae7d84e..92721efcd7b 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/SetRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -60,20 +65,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -100,20 +116,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs index eab3c90147c..0a29be8c2d6 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs @@ -36,22 +36,30 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,34 +78,59 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs index 66226b5d069..d001664b0ac 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, termId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,24 +60,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, termId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, termId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -89,24 +109,33 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, termId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs index a989e1cff81..fdaebf4ba29 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,20 +59,27 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,24 +98,33 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs index d7c331d4adc..166c2361b2f 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs @@ -27,24 +27,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs index 25b8ae53ec0..f0cb7aea965 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs @@ -29,20 +29,27 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,24 +70,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,24 +119,33 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs index 11cab2b0e2d..aba3e6ea2ba 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,20 +59,27 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,24 +98,33 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs index 3444b71b873..4afa0a0aec6 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs @@ -27,24 +27,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs index cc63b1d911f..e75cc17951a 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,20 +59,27 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,24 +98,33 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs index e08bd8798a0..63f2855409f 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs @@ -27,24 +27,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs index facd53cc130..9335305c7f1 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs @@ -39,22 +39,30 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,34 +81,59 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs index 344ee60aea2..f42a1ddd49d 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs index a23e3f13f94..d15a7cae880 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/TermRequestBuilder.cs index 64d7431d1d7..972f1cdc75c 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/Item/TermRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,22 +67,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,22 +113,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/TermsRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/TermsRequestBuilder.cs index f87568b797b..3bf5f731732 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/TermsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/Item/Terms/TermsRequestBuilder.cs @@ -39,20 +39,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,32 +78,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, setId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/SetsRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/SetsRequestBuilder.cs index 46ebd3739ec..f6ef170fedc 100644 --- a/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/SetsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Groups/Item/Sets/SetsRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,30 +76,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--group-id", description: "key: id of group")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(groupId)) requestInfo.PathParameters.Add("group_id", groupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var groupIdOption = new Option("--group-id", description: "key: id of group"); + groupIdOption.IsRequired = true; + command.AddOption(groupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, groupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/ChildrenRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/ChildrenRequestBuilder.cs index ea21baf1e80..439cabf7982 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/ChildrenRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/ChildrenRequestBuilder.cs @@ -39,18 +39,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,30 +75,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs index 40ad5dcbe64..d0ffab1e639 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Children/ChildrenRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs index 463da836ad9..eb67d95018c 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Children/Item/TermRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, termId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, termId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, termId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, termId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs index b5ce705c3ef..e402ac0d3bc 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs index 1880f7bb885..8bc5262ac28 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs index b3a7c74aa4d..4699ced26e6 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/RelationRequestBuilder.cs @@ -29,18 +29,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,22 +67,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,22 +113,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs index a2acc6896fc..26ba992cefc 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs index 1923bae6dd9..e6acb1fc933 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/Set/SetRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs index 88ac9f3cb4d..cf7556431c1 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs index 86a15b7e66b..401a9d92806 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs index bfe62dc9335..087a9ebc04a 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Relations/RelationsRequestBuilder.cs @@ -39,20 +39,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,32 +78,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs index 8c28c205a04..d0c620f7eb7 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Set/SetRequestBuilder.cs index 0acbe38aae7..2f8da106e7d 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/Set/SetRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/TermRequestBuilder.cs index 89f7baeb1a3..8350c630557 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Children/Item/TermRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,20 +64,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,20 +107,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Children terms of set in term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs index 2cb28bcc53f..451ce99d3b4 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/ParentGroup/ParentGroupRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The parent [group] that contains the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The parent [group] that contains the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,18 +92,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The parent [group] that contains the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/ParentGroup/Sets/Item/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/ParentGroup/Sets/Item/SetRequestBuilder.cs index a67ca3b168f..b53fb19240a 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/ParentGroup/Sets/Item/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/ParentGroup/Sets/Item/SetRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--set-id1", description: "key: id of set")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var setId1Option = new Option("--set-id1", description: "key: id of set"); + setId1Option.IsRequired = true; + command.AddOption(setId1Option); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, setId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(setId1)) requestInfo.PathParameters.Add("set_id1", setId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--set-id1", description: "key: id of set")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, setId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(setId1)) requestInfo.PathParameters.Add("set_id1", setId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var setId1Option = new Option("--set-id1", description: "key: id of set"); + setId1Option.IsRequired = true; + command.AddOption(setId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, setId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--set-id1", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var setId1Option = new Option("--set-id1", description: "key: id of set"); + setId1Option.IsRequired = true; + command.AddOption(setId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, setId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(setId1)) requestInfo.PathParameters.Add("set_id1", setId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/ParentGroup/Sets/SetsRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/ParentGroup/Sets/SetsRequestBuilder.cs index 2e1fbd8ac6d..c47cb810b8d 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/ParentGroup/Sets/SetsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/ParentGroup/Sets/SetsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All sets under the group in a term [store]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs index 309d62cbd69..5d154fa71e4 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs index 86dc6e8ea2c..4a21afeb02a 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/RelationRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/RelationRequestBuilder.cs index 5f1c72985b5..303d4d50b7b 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/RelationRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/RelationRequestBuilder.cs @@ -29,16 +29,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,20 +64,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,20 +107,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs index 7f03cdef6c2..6a8d8b9c888 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs index 36ff0b25b95..1d9dc2d7dda 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/Set/SetRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs index 3335596d142..eb92589edec 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs index 09ed1a4d018..75fb9a51899 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/RelationsRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/RelationsRequestBuilder.cs index 7a803c5eee6..8234bde7110 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/RelationsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Relations/RelationsRequestBuilder.cs @@ -39,18 +39,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,30 +75,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Indicates which terms have been pinned or reused directly under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/SetRequestBuilder.cs index d91d009ebe6..705985c0349 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/SetRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of all sets available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,18 +62,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of all sets available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,18 +111,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of all sets available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs index 5683628d890..73e3ec24227 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Children/ChildrenRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs index f947e268ba9..d1a6d23d8b1 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Children/Item/TermRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, termId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, termId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, termId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Children of current term."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--term-id1", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var termId1Option = new Option("--term-id1", description: "key: id of term"); + termId1Option.IsRequired = true; + command.AddOption(termId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, termId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(termId1)) requestInfo.PathParameters.Add("term_id1", termId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs index b225c24c59e..76390db3f41 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs index 5f8fd7bdc97..b67f7c97cda 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/FromTerm/FromTermRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs index 9e0ec93cd2f..da67fdeeb5a 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/RelationRequestBuilder.cs @@ -29,18 +29,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,22 +67,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,22 +113,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs index 19a6fa8aa13..767061f5c67 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs index ed1e6e4dc7f..ed4aef1edfa 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/Set/SetRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the relation is relevant."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs index aab72b3fcf5..5eb09434077 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/@Ref/RefRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +56,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,22 +92,30 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs index 776a02a049a..78ba60ddd34 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/Item/ToTerm/ToTermRequestBuilder.cs @@ -27,22 +27,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The to [term] of the relation. The term to which the relationship is defined."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--relation-id", description: "key: id of relation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - if (!String.IsNullOrEmpty(relationId)) requestInfo.PathParameters.Add("relation_id", relationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var relationIdOption = new Option("--relation-id", description: "key: id of relation"); + relationIdOption.IsRequired = true; + command.AddOption(relationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, relationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs index f5ed1fd9395..79fcc7df3b8 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Relations/RelationsRequestBuilder.cs @@ -39,20 +39,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,32 +78,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "To indicate which terms are related to the current term as either pinned or reused."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs index deb14eb99b5..e8ac828fabb 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Set/@Ref/RefRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +53,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,20 +86,27 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs index 340db8464f2..1007ed8b0f8 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/Set/SetRequestBuilder.cs @@ -27,20 +27,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The [set] in which the term is created."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/TermRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/TermRequestBuilder.cs index 5d4c592e2e2..7522e3fa02a 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/TermRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/Item/TermRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,20 +64,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,20 +107,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--term-id", description: "key: id of term")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var termIdOption = new Option("--term-id", description: "key: id of term"); + termIdOption.IsRequired = true; + command.AddOption(termIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, termId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - if (!String.IsNullOrEmpty(termId)) requestInfo.PathParameters.Add("term_id", termId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/TermsRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/TermsRequestBuilder.cs index 3b443e1e3b2..188b3b2707c 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/TermsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/Item/Terms/TermsRequestBuilder.cs @@ -39,18 +39,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, setId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,30 +75,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "All the terms under the set."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--set-id", description: "key: id of set")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, setId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - if (!String.IsNullOrEmpty(setId)) requestInfo.PathParameters.Add("set_id", setId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var setIdOption = new Option("--set-id", description: "key: id of set"); + setIdOption.IsRequired = true; + command.AddOption(setIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, setId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/Sets/SetsRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/Sets/SetsRequestBuilder.cs index 6f0ca4a7ca5..fcf66137a9a 100644 --- a/src/generated/Sites/Item/TermStores/Item/Sets/SetsRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/Sets/SetsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of all sets available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of all sets available in the term store."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/Item/TermStores/Item/StoreRequestBuilder.cs b/src/generated/Sites/Item/TermStores/Item/StoreRequestBuilder.cs index 1f626439e1a..03e43f5bb69 100644 --- a/src/generated/Sites/Item/TermStores/Item/StoreRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/Item/StoreRequestBuilder.cs @@ -28,12 +28,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of termStores under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); command.Handler = CommandHandler.Create(async (siteId, storeId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,16 +50,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of termStores under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, storeId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, storeId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of termStores under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--store-id", description: "key: id of store")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var storeIdOption = new Option("--store-id", description: "key: id of store"); + storeIdOption.IsRequired = true; + command.AddOption(storeIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, storeId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - if (!String.IsNullOrEmpty(storeId)) requestInfo.PathParameters.Add("store_id", storeId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Sites/Item/TermStores/TermStoresRequestBuilder.cs b/src/generated/Sites/Item/TermStores/TermStoresRequestBuilder.cs index d1cd4f3f4af..371abd6b529 100644 --- a/src/generated/Sites/Item/TermStores/TermStoresRequestBuilder.cs +++ b/src/generated/Sites/Item/TermStores/TermStoresRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of termStores under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--body")); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (siteId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +68,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of termStores under this site."; // Create options for all the parameters - command.AddOption(new Option("--site-id", description: "key: id of site")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(siteId)) requestInfo.PathParameters.Add("site_id", siteId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var siteIdOption = new Option("--site-id", description: "key: id of site"); + siteIdOption.IsRequired = true; + command.AddOption(siteIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (siteId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Sites/SitesRequestBuilder.cs b/src/generated/Sites/SitesRequestBuilder.cs index c68a1b8e518..709414ace1b 100644 --- a/src/generated/Sites/SitesRequestBuilder.cs +++ b/src/generated/Sites/SitesRequestBuilder.cs @@ -57,12 +57,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to sites"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,24 +84,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from sites"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Solutions/BookingBusinesses/BookingBusinessesRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/BookingBusinessesRequestBuilder.cs new file mode 100644 index 00000000000..7d243b6c277 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/BookingBusinessesRequestBuilder.cs @@ -0,0 +1,220 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Solutions.BookingBusinesses.Item; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses { + /// Builds and executes requests for operations under \solutions\bookingBusinesses + public class BookingBusinessesRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new BookingBusinessRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildAppointmentsCommand(), + builder.BuildCalendarViewCommand(), + builder.BuildCustomersCommand(), + builder.BuildCustomQuestionsCommand(), + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + builder.BuildPublishCommand(), + builder.BuildServicesCommand(), + builder.BuildStaffMembersCommand(), + builder.BuildUnpublishCommand(), + }; + return commands; + } + /// + /// Create new navigation property to bookingBusinesses for solutions + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Create new navigation property to bookingBusinesses for solutions"; + // Create options for all the parameters + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Get bookingBusinesses from solutions + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Get bookingBusinesses from solutions"; + // Create options for all the parameters + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new BookingBusinessesRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public BookingBusinessesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Get bookingBusinesses from solutions + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Create new navigation property to bookingBusinesses for solutions + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(BookingBusiness body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Get bookingBusinesses from solutions + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Create new navigation property to bookingBusinesses for solutions + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(BookingBusiness model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Get bookingBusinesses from solutions + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/BookingBusinessesResponse.cs b/src/generated/Solutions/BookingBusinesses/BookingBusinessesResponse.cs new file mode 100644 index 00000000000..90e1270f21a --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/BookingBusinessesResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Solutions.BookingBusinesses { + public class BookingBusinessesResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new bookingBusinessesResponse and sets the default values. + /// + public BookingBusinessesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as BookingBusinessesResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as BookingBusinessesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/Appointments/AppointmentsRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/Appointments/AppointmentsRequestBuilder.cs new file mode 100644 index 00000000000..68c9d6f1919 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/Appointments/AppointmentsRequestBuilder.cs @@ -0,0 +1,219 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Solutions.BookingBusinesses.Item.Appointments.Item; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.Appointments { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\appointments + public class AppointmentsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new BookingAppointmentRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildCancelCommand(), + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "All the appointments of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "All the appointments of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new AppointmentsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AppointmentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/appointments{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(BookingAppointment body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(BookingAppointment model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// All the appointments of this business. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/Appointments/AppointmentsResponse.cs b/src/generated/Solutions/BookingBusinesses/Item/Appointments/AppointmentsResponse.cs new file mode 100644 index 00000000000..c76a80082fd --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/Appointments/AppointmentsResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Solutions.BookingBusinesses.Item.Appointments { + public class AppointmentsResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new appointmentsResponse and sets the default values. + /// + public AppointmentsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as AppointmentsResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as AppointmentsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/Appointments/Item/BookingAppointmentRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/Appointments/Item/BookingAppointmentRequestBuilder.cs new file mode 100644 index 00000000000..8ba2d3e0c4a --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/Appointments/Item/BookingAppointmentRequestBuilder.cs @@ -0,0 +1,227 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Solutions.BookingBusinesses.Item.Appointments.Item.Cancel; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.Appointments.Item { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\appointments\{bookingAppointment-id} + public class BookingAppointmentRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public Command BuildCancelCommand() { + var command = new Command("cancel"); + var builder = new ApiSdk.Solutions.BookingBusinesses.Item.Appointments.Item.Cancel.CancelRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "All the appointments of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingAppointmentIdOption = new Option("--bookingappointment-id", description: "key: id of bookingAppointment"); + bookingAppointmentIdOption.IsRequired = true; + command.AddOption(bookingAppointmentIdOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingAppointmentId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "All the appointments of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingAppointmentIdOption = new Option("--bookingappointment-id", description: "key: id of bookingAppointment"); + bookingAppointmentIdOption.IsRequired = true; + command.AddOption(bookingAppointmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingAppointmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "All the appointments of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingAppointmentIdOption = new Option("--bookingappointment-id", description: "key: id of bookingAppointment"); + bookingAppointmentIdOption.IsRequired = true; + command.AddOption(bookingAppointmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingAppointmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new BookingAppointmentRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public BookingAppointmentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/appointments/{bookingAppointment_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(BookingAppointment body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the appointments of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(BookingAppointment model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// All the appointments of this business. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/Appointments/Item/Cancel/CancelRequestBody.cs b/src/generated/Solutions/BookingBusinesses/Item/Appointments/Item/Cancel/CancelRequestBody.cs new file mode 100644 index 00000000000..ca1a16b3612 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/Appointments/Item/Cancel/CancelRequestBody.cs @@ -0,0 +1,35 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Solutions.BookingBusinesses.Item.Appointments.Item.Cancel { + public class CancelRequestBody : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string CancellationMessage { get; set; } + /// + /// Instantiates a new cancelRequestBody and sets the default values. + /// + public CancelRequestBody() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"cancellationMessage", (o,n) => { (o as CancelRequestBody).CancellationMessage = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("cancellationMessage", CancellationMessage); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/Appointments/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/Appointments/Item/Cancel/CancelRequestBuilder.cs new file mode 100644 index 00000000000..c49322e8c82 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/Appointments/Item/Cancel/CancelRequestBuilder.cs @@ -0,0 +1,94 @@ +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.Appointments.Item.Cancel { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\appointments\{bookingAppointment-id}\microsoft.graph.cancel + public class CancelRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Cancels the giving booking appointment, sending a message to the involved parties. + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Cancels the giving booking appointment, sending a message to the involved parties."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingAppointmentIdOption = new Option("--bookingappointment-id", description: "key: id of bookingAppointment"); + bookingAppointmentIdOption.IsRequired = true; + command.AddOption(bookingAppointmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingAppointmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new CancelRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public CancelRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/appointments/{bookingAppointment_id}/microsoft.graph.cancel"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Cancels the giving booking appointment, sending a message to the involved parties. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(CancelRequestBody body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Cancels the giving booking appointment, sending a message to the involved parties. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(CancelRequestBody model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/BookingBusinessRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/BookingBusinessRequestBuilder.cs new file mode 100644 index 00000000000..e34299d3086 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/BookingBusinessRequestBuilder.cs @@ -0,0 +1,273 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Solutions.BookingBusinesses.Item.Appointments; +using ApiSdk.Solutions.BookingBusinesses.Item.CalendarView; +using ApiSdk.Solutions.BookingBusinesses.Item.Customers; +using ApiSdk.Solutions.BookingBusinesses.Item.CustomQuestions; +using ApiSdk.Solutions.BookingBusinesses.Item.Publish; +using ApiSdk.Solutions.BookingBusinesses.Item.Services; +using ApiSdk.Solutions.BookingBusinesses.Item.StaffMembers; +using ApiSdk.Solutions.BookingBusinesses.Item.Unpublish; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id} + public class BookingBusinessRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public Command BuildAppointmentsCommand() { + var command = new Command("appointments"); + var builder = new ApiSdk.Solutions.BookingBusinesses.Item.Appointments.AppointmentsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + public Command BuildCalendarViewCommand() { + var command = new Command("calendar-view"); + var builder = new ApiSdk.Solutions.BookingBusinesses.Item.CalendarView.CalendarViewRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + public Command BuildCustomersCommand() { + var command = new Command("customers"); + var builder = new ApiSdk.Solutions.BookingBusinesses.Item.Customers.CustomersRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + public Command BuildCustomQuestionsCommand() { + var command = new Command("custom-questions"); + var builder = new ApiSdk.Solutions.BookingBusinesses.Item.CustomQuestions.CustomQuestionsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + /// + /// Delete navigation property bookingBusinesses for solutions + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Delete navigation property bookingBusinesses for solutions"; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Get bookingBusinesses from solutions + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Get bookingBusinesses from solutions"; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Update the navigation property bookingBusinesses in solutions + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Update the navigation property bookingBusinesses in solutions"; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + public Command BuildPublishCommand() { + var command = new Command("publish"); + var builder = new ApiSdk.Solutions.BookingBusinesses.Item.Publish.PublishRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + public Command BuildServicesCommand() { + var command = new Command("services"); + var builder = new ApiSdk.Solutions.BookingBusinesses.Item.Services.ServicesRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + public Command BuildStaffMembersCommand() { + var command = new Command("staff-members"); + var builder = new ApiSdk.Solutions.BookingBusinesses.Item.StaffMembers.StaffMembersRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + public Command BuildUnpublishCommand() { + var command = new Command("unpublish"); + var builder = new ApiSdk.Solutions.BookingBusinesses.Item.Unpublish.UnpublishRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + /// + /// Instantiates a new BookingBusinessRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public BookingBusinessRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Delete navigation property bookingBusinesses for solutions + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Get bookingBusinesses from solutions + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Update the navigation property bookingBusinesses in solutions + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(BookingBusiness body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Delete navigation property bookingBusinesses for solutions + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Get bookingBusinesses from solutions + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Update the navigation property bookingBusinesses in solutions + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(BookingBusiness model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Get bookingBusinesses from solutions + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/CalendarView/CalendarViewRequestBuilder.cs new file mode 100644 index 00000000000..454c0e34fd6 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/CalendarView/CalendarViewRequestBuilder.cs @@ -0,0 +1,219 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Solutions.BookingBusinesses.Item.CalendarView.Item; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.CalendarView { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\calendarView + public class CalendarViewRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new BookingAppointmentRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildCancelCommand(), + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "The set of appointments of this business in a specified date range. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "The set of appointments of this business in a specified date range. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new CalendarViewRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public CalendarViewRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/calendarView{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(BookingAppointment body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(BookingAppointment model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/CalendarView/CalendarViewResponse.cs b/src/generated/Solutions/BookingBusinesses/Item/CalendarView/CalendarViewResponse.cs new file mode 100644 index 00000000000..47bcfb96a00 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/CalendarView/CalendarViewResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Solutions.BookingBusinesses.Item.CalendarView { + public class CalendarViewResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new calendarViewResponse and sets the default values. + /// + public CalendarViewResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as CalendarViewResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as CalendarViewResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/CalendarView/Item/BookingAppointmentRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/CalendarView/Item/BookingAppointmentRequestBuilder.cs new file mode 100644 index 00000000000..19839917a77 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/CalendarView/Item/BookingAppointmentRequestBuilder.cs @@ -0,0 +1,227 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Solutions.BookingBusinesses.Item.CalendarView.Item.Cancel; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.CalendarView.Item { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\calendarView\{bookingAppointment-id} + public class BookingAppointmentRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public Command BuildCancelCommand() { + var command = new Command("cancel"); + var builder = new ApiSdk.Solutions.BookingBusinesses.Item.CalendarView.Item.Cancel.CancelRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildPostCommand()); + return command; + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "The set of appointments of this business in a specified date range. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingAppointmentIdOption = new Option("--bookingappointment-id", description: "key: id of bookingAppointment"); + bookingAppointmentIdOption.IsRequired = true; + command.AddOption(bookingAppointmentIdOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingAppointmentId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "The set of appointments of this business in a specified date range. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingAppointmentIdOption = new Option("--bookingappointment-id", description: "key: id of bookingAppointment"); + bookingAppointmentIdOption.IsRequired = true; + command.AddOption(bookingAppointmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingAppointmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "The set of appointments of this business in a specified date range. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingAppointmentIdOption = new Option("--bookingappointment-id", description: "key: id of bookingAppointment"); + bookingAppointmentIdOption.IsRequired = true; + command.AddOption(bookingAppointmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingAppointmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new BookingAppointmentRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public BookingAppointmentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/calendarView/{bookingAppointment_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(BookingAppointment body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(BookingAppointment model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// The set of appointments of this business in a specified date range. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/CalendarView/Item/Cancel/CancelRequestBody.cs b/src/generated/Solutions/BookingBusinesses/Item/CalendarView/Item/Cancel/CancelRequestBody.cs new file mode 100644 index 00000000000..a61a9cf395f --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/CalendarView/Item/Cancel/CancelRequestBody.cs @@ -0,0 +1,35 @@ +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Solutions.BookingBusinesses.Item.CalendarView.Item.Cancel { + public class CancelRequestBody : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string CancellationMessage { get; set; } + /// + /// Instantiates a new cancelRequestBody and sets the default values. + /// + public CancelRequestBody() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"cancellationMessage", (o,n) => { (o as CancelRequestBody).CancellationMessage = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("cancellationMessage", CancellationMessage); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs new file mode 100644 index 00000000000..f05a740248e --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -0,0 +1,94 @@ +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.CalendarView.Item.Cancel { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\calendarView\{bookingAppointment-id}\microsoft.graph.cancel + public class CancelRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Cancels the giving booking appointment, sending a message to the involved parties. + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Cancels the giving booking appointment, sending a message to the involved parties."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingAppointmentIdOption = new Option("--bookingappointment-id", description: "key: id of bookingAppointment"); + bookingAppointmentIdOption.IsRequired = true; + command.AddOption(bookingAppointmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingAppointmentId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new CancelRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public CancelRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/calendarView/{bookingAppointment_id}/microsoft.graph.cancel"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Cancels the giving booking appointment, sending a message to the involved parties. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(CancelRequestBody body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Cancels the giving booking appointment, sending a message to the involved parties. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(CancelRequestBody model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/CustomQuestions/CustomQuestionsRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/CustomQuestions/CustomQuestionsRequestBuilder.cs new file mode 100644 index 00000000000..642ed672e9b --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/CustomQuestions/CustomQuestionsRequestBuilder.cs @@ -0,0 +1,218 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Solutions.BookingBusinesses.Item.CustomQuestions.Item; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.CustomQuestions { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\customQuestions + public class CustomQuestionsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new BookingCustomQuestionRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "All the custom questions of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "All the custom questions of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new CustomQuestionsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public CustomQuestionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/customQuestions{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(BookingCustomQuestion body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(BookingCustomQuestion model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// All the custom questions of this business. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/CustomQuestions/CustomQuestionsResponse.cs b/src/generated/Solutions/BookingBusinesses/Item/CustomQuestions/CustomQuestionsResponse.cs new file mode 100644 index 00000000000..e3ebcac5732 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/CustomQuestions/CustomQuestionsResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Solutions.BookingBusinesses.Item.CustomQuestions { + public class CustomQuestionsResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new customQuestionsResponse and sets the default values. + /// + public CustomQuestionsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as CustomQuestionsResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as CustomQuestionsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/CustomQuestions/Item/BookingCustomQuestionRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/CustomQuestions/Item/BookingCustomQuestionRequestBuilder.cs new file mode 100644 index 00000000000..8d71c760815 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/CustomQuestions/Item/BookingCustomQuestionRequestBuilder.cs @@ -0,0 +1,220 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.CustomQuestions.Item { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\customQuestions\{bookingCustomQuestion-id} + public class BookingCustomQuestionRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "All the custom questions of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingCustomQuestionIdOption = new Option("--bookingcustomquestion-id", description: "key: id of bookingCustomQuestion"); + bookingCustomQuestionIdOption.IsRequired = true; + command.AddOption(bookingCustomQuestionIdOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingCustomQuestionId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "All the custom questions of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingCustomQuestionIdOption = new Option("--bookingcustomquestion-id", description: "key: id of bookingCustomQuestion"); + bookingCustomQuestionIdOption.IsRequired = true; + command.AddOption(bookingCustomQuestionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingCustomQuestionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "All the custom questions of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingCustomQuestionIdOption = new Option("--bookingcustomquestion-id", description: "key: id of bookingCustomQuestion"); + bookingCustomQuestionIdOption.IsRequired = true; + command.AddOption(bookingCustomQuestionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingCustomQuestionId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new BookingCustomQuestionRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public BookingCustomQuestionRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/customQuestions/{bookingCustomQuestion_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(BookingCustomQuestion body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the custom questions of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(BookingCustomQuestion model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// All the custom questions of this business. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/Customers/CustomersRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/Customers/CustomersRequestBuilder.cs new file mode 100644 index 00000000000..aa4407176ca --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/Customers/CustomersRequestBuilder.cs @@ -0,0 +1,218 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Solutions.BookingBusinesses.Item.Customers.Item; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.Customers { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\customers + public class CustomersRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new BookingCustomerBaseRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// All the customers of this business. Read-only. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "All the customers of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// All the customers of this business. Read-only. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "All the customers of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new CustomersRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public CustomersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/customers{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// All the customers of this business. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the customers of this business. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(BookingCustomerBase body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the customers of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the customers of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(BookingCustomerBase model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// All the customers of this business. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/Customers/CustomersResponse.cs b/src/generated/Solutions/BookingBusinesses/Item/Customers/CustomersResponse.cs new file mode 100644 index 00000000000..5e3f069c27b --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/Customers/CustomersResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Solutions.BookingBusinesses.Item.Customers { + public class CustomersResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new customersResponse and sets the default values. + /// + public CustomersResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as CustomersResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as CustomersResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/Customers/Item/BookingCustomerBaseRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/Customers/Item/BookingCustomerBaseRequestBuilder.cs new file mode 100644 index 00000000000..e899de50fb7 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/Customers/Item/BookingCustomerBaseRequestBuilder.cs @@ -0,0 +1,220 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.Customers.Item { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\customers\{bookingCustomerBase-id} + public class BookingCustomerBaseRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// All the customers of this business. Read-only. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "All the customers of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingCustomerBaseIdOption = new Option("--bookingcustomerbase-id", description: "key: id of bookingCustomerBase"); + bookingCustomerBaseIdOption.IsRequired = true; + command.AddOption(bookingCustomerBaseIdOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingCustomerBaseId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// All the customers of this business. Read-only. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "All the customers of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingCustomerBaseIdOption = new Option("--bookingcustomerbase-id", description: "key: id of bookingCustomerBase"); + bookingCustomerBaseIdOption.IsRequired = true; + command.AddOption(bookingCustomerBaseIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingCustomerBaseId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// All the customers of this business. Read-only. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "All the customers of this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingCustomerBaseIdOption = new Option("--bookingcustomerbase-id", description: "key: id of bookingCustomerBase"); + bookingCustomerBaseIdOption.IsRequired = true; + command.AddOption(bookingCustomerBaseIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingCustomerBaseId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new BookingCustomerBaseRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public BookingCustomerBaseRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/customers/{bookingCustomerBase_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// All the customers of this business. Read-only. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the customers of this business. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the customers of this business. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(BookingCustomerBase body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the customers of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the customers of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the customers of this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(BookingCustomerBase model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// All the customers of this business. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/Publish/PublishRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/Publish/PublishRequestBuilder.cs new file mode 100644 index 00000000000..52cfcd4790a --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/Publish/PublishRequestBuilder.cs @@ -0,0 +1,80 @@ +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.Publish { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\microsoft.graph.publish + public class PublishRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Makes the scheduling page of this business available to the general public. + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Makes the scheduling page of this business available to the general public."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new PublishRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public PublishRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/microsoft.graph.publish"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Makes the scheduling page of this business available to the general public. + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Makes the scheduling page of this business available to the general public. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/Services/Item/BookingServiceRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/Services/Item/BookingServiceRequestBuilder.cs new file mode 100644 index 00000000000..b4b74b30d90 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/Services/Item/BookingServiceRequestBuilder.cs @@ -0,0 +1,220 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.Services.Item { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\services\{bookingService-id} + public class BookingServiceRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// All the services offered by this business. Read-only. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "All the services offered by this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingServiceIdOption = new Option("--bookingservice-id", description: "key: id of bookingService"); + bookingServiceIdOption.IsRequired = true; + command.AddOption(bookingServiceIdOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingServiceId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// All the services offered by this business. Read-only. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "All the services offered by this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingServiceIdOption = new Option("--bookingservice-id", description: "key: id of bookingService"); + bookingServiceIdOption.IsRequired = true; + command.AddOption(bookingServiceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingServiceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// All the services offered by this business. Read-only. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "All the services offered by this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingServiceIdOption = new Option("--bookingservice-id", description: "key: id of bookingService"); + bookingServiceIdOption.IsRequired = true; + command.AddOption(bookingServiceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingServiceId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new BookingServiceRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public BookingServiceRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/services/{bookingService_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// All the services offered by this business. Read-only. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the services offered by this business. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the services offered by this business. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(BookingService body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the services offered by this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the services offered by this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the services offered by this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(BookingService model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// All the services offered by this business. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/Services/ServicesRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/Services/ServicesRequestBuilder.cs new file mode 100644 index 00000000000..bdfb3a486ed --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/Services/ServicesRequestBuilder.cs @@ -0,0 +1,218 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Solutions.BookingBusinesses.Item.Services.Item; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.Services { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\services + public class ServicesRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new BookingServiceRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// All the services offered by this business. Read-only. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "All the services offered by this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// All the services offered by this business. Read-only. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "All the services offered by this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new ServicesRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public ServicesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/services{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// All the services offered by this business. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the services offered by this business. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(BookingService body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the services offered by this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the services offered by this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(BookingService model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// All the services offered by this business. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/Services/ServicesResponse.cs b/src/generated/Solutions/BookingBusinesses/Item/Services/ServicesResponse.cs new file mode 100644 index 00000000000..c784c98dcd3 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/Services/ServicesResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Solutions.BookingBusinesses.Item.Services { + public class ServicesResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new servicesResponse and sets the default values. + /// + public ServicesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as ServicesResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as ServicesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/StaffMembers/Item/BookingStaffMemberBaseRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/StaffMembers/Item/BookingStaffMemberBaseRequestBuilder.cs new file mode 100644 index 00000000000..2d58dc1fc7d --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/StaffMembers/Item/BookingStaffMemberBaseRequestBuilder.cs @@ -0,0 +1,220 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.StaffMembers.Item { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\staffMembers\{bookingStaffMemberBase-id} + public class BookingStaffMemberBaseRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "All the staff members that provide services in this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingStaffMemberBaseIdOption = new Option("--bookingstaffmemberbase-id", description: "key: id of bookingStaffMemberBase"); + bookingStaffMemberBaseIdOption.IsRequired = true; + command.AddOption(bookingStaffMemberBaseIdOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingStaffMemberBaseId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "All the staff members that provide services in this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingStaffMemberBaseIdOption = new Option("--bookingstaffmemberbase-id", description: "key: id of bookingStaffMemberBase"); + bookingStaffMemberBaseIdOption.IsRequired = true; + command.AddOption(bookingStaffMemberBaseIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingStaffMemberBaseId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "All the staff members that provide services in this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bookingStaffMemberBaseIdOption = new Option("--bookingstaffmemberbase-id", description: "key: id of bookingStaffMemberBase"); + bookingStaffMemberBaseIdOption.IsRequired = true; + command.AddOption(bookingStaffMemberBaseIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, bookingStaffMemberBaseId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new BookingStaffMemberBaseRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public BookingStaffMemberBaseRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/staffMembers/{bookingStaffMemberBase_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(BookingStaffMemberBase body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(BookingStaffMemberBase model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// All the staff members that provide services in this business. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/StaffMembers/StaffMembersRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/StaffMembers/StaffMembersRequestBuilder.cs new file mode 100644 index 00000000000..8604c6937b9 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/StaffMembers/StaffMembersRequestBuilder.cs @@ -0,0 +1,218 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Solutions.BookingBusinesses.Item.StaffMembers.Item; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.StaffMembers { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\staffMembers + public class StaffMembersRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new BookingStaffMemberBaseRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "All the staff members that provide services in this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "All the staff members that provide services in this business. Read-only. Nullable."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new StaffMembersRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public StaffMembersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/staffMembers{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(BookingStaffMemberBase body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// All the staff members that provide services in this business. Read-only. Nullable. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(BookingStaffMemberBase model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// All the staff members that provide services in this business. Read-only. Nullable. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/StaffMembers/StaffMembersResponse.cs b/src/generated/Solutions/BookingBusinesses/Item/StaffMembers/StaffMembersResponse.cs new file mode 100644 index 00000000000..19abf78f788 --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/StaffMembers/StaffMembersResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Solutions.BookingBusinesses.Item.StaffMembers { + public class StaffMembersResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new staffMembersResponse and sets the default values. + /// + public StaffMembersResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as StaffMembersResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as StaffMembersResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Solutions/BookingBusinesses/Item/Unpublish/UnpublishRequestBuilder.cs b/src/generated/Solutions/BookingBusinesses/Item/Unpublish/UnpublishRequestBuilder.cs new file mode 100644 index 00000000000..8771cc57f1b --- /dev/null +++ b/src/generated/Solutions/BookingBusinesses/Item/Unpublish/UnpublishRequestBuilder.cs @@ -0,0 +1,80 @@ +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingBusinesses.Item.Unpublish { + /// Builds and executes requests for operations under \solutions\bookingBusinesses\{bookingBusiness-id}\microsoft.graph.unpublish + public class UnpublishRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Prevents the general public from seeing the scheduling page of this business. + /// + public Command BuildPostCommand() { + var command = new Command("post"); + command.Description = "Prevents the general public from seeing the scheduling page of this business."; + // Create options for all the parameters + var bookingBusinessIdOption = new Option("--bookingbusiness-id", description: "key: id of bookingBusiness"); + bookingBusinessIdOption.IsRequired = true; + command.AddOption(bookingBusinessIdOption); + command.Handler = CommandHandler.Create(async (bookingBusinessId) => { + var requestInfo = CreatePostRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new UnpublishRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public UnpublishRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingBusinesses/{bookingBusiness_id}/microsoft.graph.unpublish"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Prevents the general public from seeing the scheduling page of this business. + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Prevents the general public from seeing the scheduling page of this business. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreatePostRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + } +} diff --git a/src/generated/Solutions/BookingCurrencies/BookingCurrenciesRequestBuilder.cs b/src/generated/Solutions/BookingCurrencies/BookingCurrenciesRequestBuilder.cs new file mode 100644 index 00000000000..34d09619c6e --- /dev/null +++ b/src/generated/Solutions/BookingCurrencies/BookingCurrenciesRequestBuilder.cs @@ -0,0 +1,212 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Solutions.BookingCurrencies.Item; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingCurrencies { + /// Builds and executes requests for operations under \solutions\bookingCurrencies + public class BookingCurrenciesRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new BookingCurrencyRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// Create new navigation property to bookingCurrencies for solutions + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "Create new navigation property to bookingCurrencies for solutions"; + // Create options for all the parameters + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Get bookingCurrencies from solutions + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "Get bookingCurrencies from solutions"; + // Create options for all the parameters + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new BookingCurrenciesRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public BookingCurrenciesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingCurrencies{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Get bookingCurrencies from solutions + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Create new navigation property to bookingCurrencies for solutions + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(BookingCurrency body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Get bookingCurrencies from solutions + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Create new navigation property to bookingCurrencies for solutions + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(BookingCurrency model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// Get bookingCurrencies from solutions + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Solutions/BookingCurrencies/BookingCurrenciesResponse.cs b/src/generated/Solutions/BookingCurrencies/BookingCurrenciesResponse.cs new file mode 100644 index 00000000000..f054eaf0d90 --- /dev/null +++ b/src/generated/Solutions/BookingCurrencies/BookingCurrenciesResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Solutions.BookingCurrencies { + public class BookingCurrenciesResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new bookingCurrenciesResponse and sets the default values. + /// + public BookingCurrenciesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as BookingCurrenciesResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as BookingCurrenciesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Solutions/BookingCurrencies/Item/BookingCurrencyRequestBuilder.cs b/src/generated/Solutions/BookingCurrencies/Item/BookingCurrencyRequestBuilder.cs new file mode 100644 index 00000000000..6a1800f01d9 --- /dev/null +++ b/src/generated/Solutions/BookingCurrencies/Item/BookingCurrencyRequestBuilder.cs @@ -0,0 +1,211 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions.BookingCurrencies.Item { + /// Builds and executes requests for operations under \solutions\bookingCurrencies\{bookingCurrency-id} + public class BookingCurrencyRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// Delete navigation property bookingCurrencies for solutions + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "Delete navigation property bookingCurrencies for solutions"; + // Create options for all the parameters + var bookingCurrencyIdOption = new Option("--bookingcurrency-id", description: "key: id of bookingCurrency"); + bookingCurrencyIdOption.IsRequired = true; + command.AddOption(bookingCurrencyIdOption); + command.Handler = CommandHandler.Create(async (bookingCurrencyId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Get bookingCurrencies from solutions + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Get bookingCurrencies from solutions"; + // Create options for all the parameters + var bookingCurrencyIdOption = new Option("--bookingcurrency-id", description: "key: id of bookingCurrency"); + bookingCurrencyIdOption.IsRequired = true; + command.AddOption(bookingCurrencyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (bookingCurrencyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Update the navigation property bookingCurrencies in solutions + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Update the navigation property bookingCurrencies in solutions"; + // Create options for all the parameters + var bookingCurrencyIdOption = new Option("--bookingcurrency-id", description: "key: id of bookingCurrency"); + bookingCurrencyIdOption.IsRequired = true; + command.AddOption(bookingCurrencyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (bookingCurrencyId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new BookingCurrencyRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public BookingCurrencyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions/bookingCurrencies/{bookingCurrency_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Delete navigation property bookingCurrencies for solutions + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Get bookingCurrencies from solutions + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Update the navigation property bookingCurrencies in solutions + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(BookingCurrency body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Delete navigation property bookingCurrencies for solutions + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Get bookingCurrencies from solutions + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Update the navigation property bookingCurrencies in solutions + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(BookingCurrency model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Get bookingCurrencies from solutions + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Solutions/SolutionsRequestBuilder.cs b/src/generated/Solutions/SolutionsRequestBuilder.cs new file mode 100644 index 00000000000..243dcf42bb4 --- /dev/null +++ b/src/generated/Solutions/SolutionsRequestBuilder.cs @@ -0,0 +1,176 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Solutions.BookingBusinesses; +using ApiSdk.Solutions.BookingCurrencies; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Solutions { + /// Builds and executes requests for operations under \solutions + public class SolutionsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public Command BuildBookingBusinessesCommand() { + var command = new Command("booking-businesses"); + var builder = new ApiSdk.Solutions.BookingBusinesses.BookingBusinessesRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + public Command BuildBookingCurrenciesCommand() { + var command = new Command("booking-currencies"); + var builder = new ApiSdk.Solutions.BookingCurrencies.BookingCurrenciesRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + /// + /// Get solutions + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "Get solutions"; + // Create options for all the parameters + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Update solutions + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "Update solutions"; + // Create options for all the parameters + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new SolutionsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public SolutionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/solutions{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// Get solutions + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Update solutions + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(ApiSdk.Models.Microsoft.Graph.Solutions body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// Get solutions + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// Update solutions + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(ApiSdk.Models.Microsoft.Graph.Solutions model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// Get solutions + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/SubscribedSkus/Item/SubscribedSkuRequestBuilder.cs b/src/generated/SubscribedSkus/Item/SubscribedSkuRequestBuilder.cs index b6224e8fec6..adeb3494f21 100644 --- a/src/generated/SubscribedSkus/Item/SubscribedSkuRequestBuilder.cs +++ b/src/generated/SubscribedSkus/Item/SubscribedSkuRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from subscribedSkus"; // Create options for all the parameters - command.AddOption(new Option("--subscribedsku-id", description: "key: id of subscribedSku")); + var subscribedSkuIdOption = new Option("--subscribedsku-id", description: "key: id of subscribedSku"); + subscribedSkuIdOption.IsRequired = true; + command.AddOption(subscribedSkuIdOption); command.Handler = CommandHandler.Create(async (subscribedSkuId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(subscribedSkuId)) requestInfo.PathParameters.Add("subscribedSku_id", subscribedSkuId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,12 +45,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from subscribedSkus by key"; // Create options for all the parameters - command.AddOption(new Option("--subscribedsku-id", description: "key: id of subscribedSku")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (subscribedSkuId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(subscribedSkuId)) requestInfo.PathParameters.Add("subscribedSku_id", subscribedSkuId); - requestInfo.QueryParameters.Add("select", select); + var subscribedSkuIdOption = new Option("--subscribedsku-id", description: "key: id of subscribedSku"); + subscribedSkuIdOption.IsRequired = true; + command.AddOption(subscribedSkuIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (subscribedSkuId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,14 +74,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in subscribedSkus"; // Create options for all the parameters - command.AddOption(new Option("--subscribedsku-id", description: "key: id of subscribedSku")); - command.AddOption(new Option("--body")); + var subscribedSkuIdOption = new Option("--subscribedsku-id", description: "key: id of subscribedSku"); + subscribedSkuIdOption.IsRequired = true; + command.AddOption(subscribedSkuIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (subscribedSkuId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(subscribedSkuId)) requestInfo.PathParameters.Add("subscribedSku_id", subscribedSkuId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/SubscribedSkus/SubscribedSkusRequestBuilder.cs b/src/generated/SubscribedSkus/SubscribedSkusRequestBuilder.cs index 966f38cc3af..35e02b71f99 100644 --- a/src/generated/SubscribedSkus/SubscribedSkusRequestBuilder.cs +++ b/src/generated/SubscribedSkus/SubscribedSkusRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to subscribedSkus"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,14 +63,23 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from subscribedSkus"; // Create options for all the parameters - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (search, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (search, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(search)) q.Search = search; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Subscriptions/Item/SubscriptionRequestBuilder.cs b/src/generated/Subscriptions/Item/SubscriptionRequestBuilder.cs index 7a2100f23fa..f2988610352 100644 --- a/src/generated/Subscriptions/Item/SubscriptionRequestBuilder.cs +++ b/src/generated/Subscriptions/Item/SubscriptionRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from subscriptions"; // Create options for all the parameters - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); command.Handler = CommandHandler.Create(async (subscriptionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,12 +45,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from subscriptions by key"; // Create options for all the parameters - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (subscriptionId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); - requestInfo.QueryParameters.Add("select", select); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (subscriptionId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,14 +74,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in subscriptions"; // Create options for all the parameters - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); - command.AddOption(new Option("--body")); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (subscriptionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Subscriptions/SubscriptionsRequestBuilder.cs b/src/generated/Subscriptions/SubscriptionsRequestBuilder.cs index fa957f8479d..7fea5fdf0f2 100644 --- a/src/generated/Subscriptions/SubscriptionsRequestBuilder.cs +++ b/src/generated/Subscriptions/SubscriptionsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to subscriptions"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,12 +63,18 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from subscriptions"; // Create options for all the parameters - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (search, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - requestInfo.QueryParameters.Add("select", select); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (search, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(search)) q.Search = search; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/GetAllMessages/GetAllMessagesRequestBuilder.cs b/src/generated/Teams/GetAllMessages/GetAllMessagesRequestBuilder.cs index f799621541b..2593150a823 100644 --- a/src/generated/Teams/GetAllMessages/GetAllMessagesRequestBuilder.cs +++ b/src/generated/Teams/GetAllMessages/GetAllMessagesRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function getAllMessages"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Archive/ArchiveRequestBuilder.cs b/src/generated/Teams/Item/Archive/ArchiveRequestBuilder.cs index b15d34515d5..bd25d528f12 100644 --- a/src/generated/Teams/Item/Archive/ArchiveRequestBuilder.cs +++ b/src/generated/Teams/Item/Archive/ArchiveRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action archive"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Channels/ChannelsRequestBuilder.cs b/src/generated/Teams/Item/Channels/ChannelsRequestBuilder.cs index 14f688e12f4..183eae1a736 100644 --- a/src/generated/Teams/Item/Channels/ChannelsRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/ChannelsRequestBuilder.cs @@ -44,14 +44,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of channels & messages associated with the team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,26 +74,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of channels & messages associated with the team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Channels/GetAllMessages/GetAllMessagesRequestBuilder.cs b/src/generated/Teams/Item/Channels/GetAllMessages/GetAllMessagesRequestBuilder.cs index cfb5f36b054..6ab3a505f57 100644 --- a/src/generated/Teams/Item/Channels/GetAllMessages/GetAllMessagesRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/GetAllMessages/GetAllMessagesRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getAllMessages"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Channels/Item/ChannelRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/ChannelRequestBuilder.cs index 75e7eca39c8..e4ffcf6d372 100644 --- a/src/generated/Teams/Item/Channels/Item/ChannelRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/ChannelRequestBuilder.cs @@ -39,12 +39,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of channels & messages associated with the team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); command.Handler = CommandHandler.Create(async (teamId, channelId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,16 +70,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of channels & messages associated with the team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, channelId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, channelId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -110,16 +122,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of channels & messages associated with the team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, channelId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Channels/Item/CompleteMigration/CompleteMigrationRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/CompleteMigration/CompleteMigrationRequestBuilder.cs index 55bc24f3387..faba6ba4819 100644 --- a/src/generated/Teams/Item/Channels/Item/CompleteMigration/CompleteMigrationRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/CompleteMigration/CompleteMigrationRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action completeMigration"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); command.Handler = CommandHandler.Create(async (teamId, channelId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Channels/Item/FilesFolder/Content/ContentRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/FilesFolder/Content/ContentRequestBuilder.cs index 366f51c0871..7d2fd576110 100644 --- a/src/generated/Teams/Item/Channels/Item/FilesFolder/Content/ContentRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/FilesFolder/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property filesFolder from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (teamId, channelId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property filesFolder in teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--file", description: "Binary request body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (teamId, channelId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Channels/Item/FilesFolder/FilesFolderRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/FilesFolder/FilesFolderRequestBuilder.cs index 687a16d9891..8e3a548e299 100644 --- a/src/generated/Teams/Item/Channels/Item/FilesFolder/FilesFolderRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/FilesFolder/FilesFolderRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Metadata for the location where the channel's files are stored."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); command.Handler = CommandHandler.Create(async (teamId, channelId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Metadata for the location where the channel's files are stored."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, channelId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, channelId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Metadata for the location where the channel's files are stored."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, channelId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Channels/Item/Members/@Add/AddRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Members/@Add/AddRequestBuilder.cs index c8cbbe3a6b3..9ac2719e822 100644 --- a/src/generated/Teams/Item/Channels/Item/Members/@Add/AddRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Members/@Add/AddRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, channelId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Channels/Item/Members/Item/ConversationMemberRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Members/Item/ConversationMemberRequestBuilder.cs index 007a055eb4f..49c9c6418a4 100644 --- a/src/generated/Teams/Item/Channels/Item/Members/Item/ConversationMemberRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Members/Item/ConversationMemberRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of membership records associated with the channel."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--conversationmember-id", description: "key: id of conversationMember")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var conversationMemberIdOption = new Option("--conversationmember-id", description: "key: id of conversationMember"); + conversationMemberIdOption.IsRequired = true; + command.AddOption(conversationMemberIdOption); command.Handler = CommandHandler.Create(async (teamId, channelId, conversationMemberId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(conversationMemberId)) requestInfo.PathParameters.Add("conversationMember_id", conversationMemberId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of membership records associated with the channel."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--conversationmember-id", description: "key: id of conversationMember")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, channelId, conversationMemberId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(conversationMemberId)) requestInfo.PathParameters.Add("conversationMember_id", conversationMemberId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var conversationMemberIdOption = new Option("--conversationmember-id", description: "key: id of conversationMember"); + conversationMemberIdOption.IsRequired = true; + command.AddOption(conversationMemberIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, channelId, conversationMemberId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of membership records associated with the channel."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--conversationmember-id", description: "key: id of conversationMember")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var conversationMemberIdOption = new Option("--conversationmember-id", description: "key: id of conversationMember"); + conversationMemberIdOption.IsRequired = true; + command.AddOption(conversationMemberIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, channelId, conversationMemberId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(conversationMemberId)) requestInfo.PathParameters.Add("conversationMember_id", conversationMemberId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Channels/Item/Members/MembersRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Members/MembersRequestBuilder.cs index 1f6191e11e7..2b1969d4e58 100644 --- a/src/generated/Teams/Item/Channels/Item/Members/MembersRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Members/MembersRequestBuilder.cs @@ -43,16 +43,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of membership records associated with the channel."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, channelId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,28 +76,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of membership records associated with the channel."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, channelId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, channelId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Channels/Item/Messages/Delta/DeltaRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Messages/Delta/DeltaRequestBuilder.cs index d7bef36a057..4e3bdfa803b 100644 --- a/src/generated/Teams/Item/Channels/Item/Messages/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Messages/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); command.Handler = CommandHandler.Create(async (teamId, channelId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Channels/Item/Messages/Item/ChatMessageRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Messages/Item/ChatMessageRequestBuilder.cs index fbc93f6b89e..78bb51aa75c 100644 --- a/src/generated/Teams/Item/Channels/Item/Messages/Item/ChatMessageRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Messages/Item/ChatMessageRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of all the messages in the channel. A navigation property. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,18 +53,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of all the messages in the channel. A navigation property. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of all the messages in the channel. A navigation property. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Channels/Item/Messages/Item/HostedContents/HostedContentsRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Messages/Item/HostedContents/HostedContentsRequestBuilder.cs index 64a7fc42c63..7fd190f23bc 100644 --- a/src/generated/Teams/Item/Channels/Item/Messages/Item/HostedContents/HostedContentsRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Messages/Item/HostedContents/HostedContentsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Channels/Item/Messages/Item/HostedContents/Item/ChatMessageHostedContentRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Messages/Item/HostedContents/Item/ChatMessageHostedContentRequestBuilder.cs index f616a5e946d..b74fd2410dd 100644 --- a/src/generated/Teams/Item/Channels/Item/Messages/Item/HostedContents/Item/ChatMessageHostedContentRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Messages/Item/HostedContents/Item/ChatMessageHostedContentRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageHostedContentIdOption = new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent"); + chatMessageHostedContentIdOption.IsRequired = true; + command.AddOption(chatMessageHostedContentIdOption); command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, chatMessageHostedContentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageHostedContentId)) requestInfo.PathParameters.Add("chatMessageHostedContent_id", chatMessageHostedContentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, chatMessageHostedContentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageHostedContentId)) requestInfo.PathParameters.Add("chatMessageHostedContent_id", chatMessageHostedContentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageHostedContentIdOption = new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent"); + chatMessageHostedContentIdOption.IsRequired = true; + command.AddOption(chatMessageHostedContentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, chatMessageHostedContentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageHostedContentIdOption = new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent"); + chatMessageHostedContentIdOption.IsRequired = true; + command.AddOption(chatMessageHostedContentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, chatMessageHostedContentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageHostedContentId)) requestInfo.PathParameters.Add("chatMessageHostedContent_id", chatMessageHostedContentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Channels/Item/Messages/Item/Replies/Delta/DeltaRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Messages/Item/Replies/Delta/DeltaRequestBuilder.cs index 9bc903ba422..26019379b72 100644 --- a/src/generated/Teams/Item/Channels/Item/Messages/Item/Replies/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Messages/Item/Replies/Delta/DeltaRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Channels/Item/Messages/Item/Replies/Item/ChatMessageRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Messages/Item/Replies/Item/ChatMessageRequestBuilder.cs index 32dbabeb903..4be3c617a6b 100644 --- a/src/generated/Teams/Item/Channels/Item/Messages/Item/Replies/Item/ChatMessageRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Messages/Item/Replies/Item/ChatMessageRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessage-id1", description: "key: id of chatMessage")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageId1Option = new Option("--chatmessage-id1", description: "key: id of chatMessage"); + chatMessageId1Option.IsRequired = true; + command.AddOption(chatMessageId1Option); command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, chatMessageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageId1)) requestInfo.PathParameters.Add("chatMessage_id1", chatMessageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessage-id1", description: "key: id of chatMessage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, chatMessageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageId1)) requestInfo.PathParameters.Add("chatMessage_id1", chatMessageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageId1Option = new Option("--chatmessage-id1", description: "key: id of chatMessage"); + chatMessageId1Option.IsRequired = true; + command.AddOption(chatMessageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, chatMessageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessage-id1", description: "key: id of chatMessage")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageId1Option = new Option("--chatmessage-id1", description: "key: id of chatMessage"); + chatMessageId1Option.IsRequired = true; + command.AddOption(chatMessageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, chatMessageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageId1)) requestInfo.PathParameters.Add("chatMessage_id1", chatMessageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Channels/Item/Messages/Item/Replies/RepliesRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Messages/Item/Replies/RepliesRequestBuilder.cs index fd597ddbc69..798c3fd8e59 100644 --- a/src/generated/Teams/Item/Channels/Item/Messages/Item/Replies/RepliesRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Messages/Item/Replies/RepliesRequestBuilder.cs @@ -37,18 +37,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,30 +73,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, channelId, chatMessageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Channels/Item/Messages/MessagesRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Messages/MessagesRequestBuilder.cs index ef9da80de26..b5c4a364910 100644 --- a/src/generated/Teams/Item/Channels/Item/Messages/MessagesRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Messages/MessagesRequestBuilder.cs @@ -39,16 +39,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of all the messages in the channel. A navigation property. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, channelId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,28 +72,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of all the messages in the channel. A navigation property. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, channelId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, channelId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Channels/Item/ProvisionEmail/ProvisionEmailRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/ProvisionEmail/ProvisionEmailRequestBuilder.cs index 66ed0231aed..77888e08c93 100644 --- a/src/generated/Teams/Item/Channels/Item/ProvisionEmail/ProvisionEmailRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/ProvisionEmail/ProvisionEmailRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action provisionEmail"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); command.Handler = CommandHandler.Create(async (teamId, channelId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Channels/Item/RemoveEmail/RemoveEmailRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/RemoveEmail/RemoveEmailRequestBuilder.cs index d26e32b01a0..92236353416 100644 --- a/src/generated/Teams/Item/Channels/Item/RemoveEmail/RemoveEmailRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/RemoveEmail/RemoveEmailRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action removeEmail"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); command.Handler = CommandHandler.Create(async (teamId, channelId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Channels/Item/Tabs/Item/TeamsApp/@Ref/RefRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Tabs/Item/TeamsApp/@Ref/RefRequestBuilder.cs index caac358cefd..44a7b81ddd9 100644 --- a/src/generated/Teams/Item/Channels/Item/Tabs/Item/TeamsApp/@Ref/RefRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Tabs/Item/TeamsApp/@Ref/RefRequestBuilder.cs @@ -19,20 +19,24 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The application that is linked to the tab. This cannot be changed after tab creation."; + command.Description = "The application that is linked to the tab."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); command.Handler = CommandHandler.Create(async (teamId, channelId, teamsTabId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -40,20 +44,24 @@ public Command BuildDeleteCommand() { return command; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The application that is linked to the tab. This cannot be changed after tab creation."; + command.Description = "The application that is linked to the tab."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); command.Handler = CommandHandler.Create(async (teamId, channelId, teamsTabId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,24 +74,30 @@ public Command BuildGetCommand() { return command; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The application that is linked to the tab. This cannot be changed after tab creation."; + command.Description = "The application that is linked to the tab."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, channelId, teamsTabId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -104,7 +118,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Request headers /// Request options /// @@ -119,7 +133,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Request headers /// Request options /// @@ -134,7 +148,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// /// Request headers /// Request options @@ -152,7 +166,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.Teams.Item.Channels return requestInfo; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -163,7 +177,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +188,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/Teams/Item/Channels/Item/Tabs/Item/TeamsApp/TeamsAppRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Tabs/Item/TeamsApp/TeamsAppRequestBuilder.cs index f99b47c1959..72f7b845be5 100644 --- a/src/generated/Teams/Item/Channels/Item/Tabs/Item/TeamsApp/TeamsAppRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Tabs/Item/TeamsApp/TeamsAppRequestBuilder.cs @@ -21,24 +21,34 @@ public class TeamsAppRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The application that is linked to the tab. This cannot be changed after tab creation."; + command.Description = "The application that is linked to the tab."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, channelId, teamsTabId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, channelId, teamsTabId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,7 +82,7 @@ public TeamsAppRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Request headers /// Request options /// Request query parameters @@ -93,7 +103,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -104,7 +114,7 @@ public RequestInformation CreateGetRequestInformation(Action var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Teams/Item/Channels/Item/Tabs/Item/TeamsTabRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Tabs/Item/TeamsTabRequestBuilder.cs index b3514bff7a8..8222c56ff37 100644 --- a/src/generated/Teams/Item/Channels/Item/Tabs/Item/TeamsTabRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Tabs/Item/TeamsTabRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of all the tabs in the channel. A navigation property."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); command.Handler = CommandHandler.Create(async (teamId, channelId, teamsTabId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of all the tabs in the channel. A navigation property."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, channelId, teamsTabId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, channelId, teamsTabId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,18 +92,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of all the tabs in the channel. A navigation property."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, channelId, teamsTabId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Channels/Item/Tabs/TabsRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Tabs/TabsRequestBuilder.cs index 849b2fa3ecf..3062d04d705 100644 --- a/src/generated/Teams/Item/Channels/Item/Tabs/TabsRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Tabs/TabsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of all the tabs in the channel. A navigation property."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, channelId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,28 +70,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of all the tabs in the channel. A navigation property."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--channel-id", description: "key: id of channel")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, channelId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(channelId)) requestInfo.PathParameters.Add("channel_id", channelId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var channelIdOption = new Option("--channel-id", description: "key: id of channel"); + channelIdOption.IsRequired = true; + command.AddOption(channelIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, channelId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Clone/CloneRequestBuilder.cs b/src/generated/Teams/Item/Clone/CloneRequestBuilder.cs index b847f361240..a177fbaffc5 100644 --- a/src/generated/Teams/Item/Clone/CloneRequestBuilder.cs +++ b/src/generated/Teams/Item/Clone/CloneRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clone"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/CompleteMigration/CompleteMigrationRequestBuilder.cs b/src/generated/Teams/Item/CompleteMigration/CompleteMigrationRequestBuilder.cs index 41da42801ef..2fe17ba8009 100644 --- a/src/generated/Teams/Item/CompleteMigration/CompleteMigrationRequestBuilder.cs +++ b/src/generated/Teams/Item/CompleteMigration/CompleteMigrationRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action completeMigration"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Group/@Ref/RefRequestBuilder.cs b/src/generated/Teams/Item/Group/@Ref/RefRequestBuilder.cs index a5e6608bb4c..d32db91f7d3 100644 --- a/src/generated/Teams/Item/Group/@Ref/RefRequestBuilder.cs +++ b/src/generated/Teams/Item/Group/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete ref of navigation property group for teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of group from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update the ref of navigation property group in teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Group/GroupRequestBuilder.cs b/src/generated/Teams/Item/Group/GroupRequestBuilder.cs index a961fae5166..febebad3589 100644 --- a/src/generated/Teams/Item/Group/GroupRequestBuilder.cs +++ b/src/generated/Teams/Item/Group/GroupRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get group from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/InstalledApps/InstalledAppsRequestBuilder.cs b/src/generated/Teams/Item/InstalledApps/InstalledAppsRequestBuilder.cs index ec15f5dd769..e613ee03ecb 100644 --- a/src/generated/Teams/Item/InstalledApps/InstalledAppsRequestBuilder.cs +++ b/src/generated/Teams/Item/InstalledApps/InstalledAppsRequestBuilder.cs @@ -39,14 +39,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The apps installed in this team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,26 +69,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The apps installed in this team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/InstalledApps/Item/TeamsApp/@Ref/RefRequestBuilder.cs b/src/generated/Teams/Item/InstalledApps/Item/TeamsApp/@Ref/RefRequestBuilder.cs index 7fc3949568a..ad01f13fd60 100644 --- a/src/generated/Teams/Item/InstalledApps/Item/TeamsApp/@Ref/RefRequestBuilder.cs +++ b/src/generated/Teams/Item/InstalledApps/Item/TeamsApp/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The app that is installed."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The app that is installed."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The app that is installed."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/InstalledApps/Item/TeamsApp/TeamsAppRequestBuilder.cs b/src/generated/Teams/Item/InstalledApps/Item/TeamsApp/TeamsAppRequestBuilder.cs index fe0a5e9d37c..7083650bf1c 100644 --- a/src/generated/Teams/Item/InstalledApps/Item/TeamsApp/TeamsAppRequestBuilder.cs +++ b/src/generated/Teams/Item/InstalledApps/Item/TeamsApp/TeamsAppRequestBuilder.cs @@ -27,16 +27,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The app that is installed."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/InstalledApps/Item/TeamsAppDefinition/@Ref/RefRequestBuilder.cs b/src/generated/Teams/Item/InstalledApps/Item/TeamsAppDefinition/@Ref/RefRequestBuilder.cs index e289d9d1fd9..8462448aa22 100644 --- a/src/generated/Teams/Item/InstalledApps/Item/TeamsAppDefinition/@Ref/RefRequestBuilder.cs +++ b/src/generated/Teams/Item/InstalledApps/Item/TeamsAppDefinition/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The details of this version of the app."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The details of this version of the app."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The details of this version of the app."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/InstalledApps/Item/TeamsAppDefinition/TeamsAppDefinitionRequestBuilder.cs b/src/generated/Teams/Item/InstalledApps/Item/TeamsAppDefinition/TeamsAppDefinitionRequestBuilder.cs index 952bc56f04b..abd8ac7d972 100644 --- a/src/generated/Teams/Item/InstalledApps/Item/TeamsAppDefinition/TeamsAppDefinitionRequestBuilder.cs +++ b/src/generated/Teams/Item/InstalledApps/Item/TeamsAppDefinition/TeamsAppDefinitionRequestBuilder.cs @@ -27,16 +27,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The details of this version of the app."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/InstalledApps/Item/TeamsAppInstallationRequestBuilder.cs b/src/generated/Teams/Item/InstalledApps/Item/TeamsAppInstallationRequestBuilder.cs index 412dcf232a2..ce321166a01 100644 --- a/src/generated/Teams/Item/InstalledApps/Item/TeamsAppInstallationRequestBuilder.cs +++ b/src/generated/Teams/Item/InstalledApps/Item/TeamsAppInstallationRequestBuilder.cs @@ -29,12 +29,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The apps installed in this team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +51,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The apps installed in this team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,16 +88,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The apps installed in this team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/InstalledApps/Item/Upgrade/UpgradeRequestBuilder.cs b/src/generated/Teams/Item/InstalledApps/Item/Upgrade/UpgradeRequestBuilder.cs index 94951ef94f8..f29e39c0762 100644 --- a/src/generated/Teams/Item/InstalledApps/Item/Upgrade/UpgradeRequestBuilder.cs +++ b/src/generated/Teams/Item/InstalledApps/Item/Upgrade/UpgradeRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action upgrade"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAppInstallationIdOption = new Option("--teamsappinstallation-id", description: "key: id of teamsAppInstallation"); + teamsAppInstallationIdOption.IsRequired = true; + command.AddOption(teamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (teamId, teamsAppInstallationId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAppInstallationId)) requestInfo.PathParameters.Add("teamsAppInstallation_id", teamsAppInstallationId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Members/@Add/AddRequestBuilder.cs b/src/generated/Teams/Item/Members/@Add/AddRequestBuilder.cs index 7b1f11d2def..fc9a55dbc82 100644 --- a/src/generated/Teams/Item/Members/@Add/AddRequestBuilder.cs +++ b/src/generated/Teams/Item/Members/@Add/AddRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Members/Item/ConversationMemberRequestBuilder.cs b/src/generated/Teams/Item/Members/Item/ConversationMemberRequestBuilder.cs index b96f56f5bcc..097ab211643 100644 --- a/src/generated/Teams/Item/Members/Item/ConversationMemberRequestBuilder.cs +++ b/src/generated/Teams/Item/Members/Item/ConversationMemberRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Members and owners of the team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--conversationmember-id", description: "key: id of conversationMember")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var conversationMemberIdOption = new Option("--conversationmember-id", description: "key: id of conversationMember"); + conversationMemberIdOption.IsRequired = true; + command.AddOption(conversationMemberIdOption); command.Handler = CommandHandler.Create(async (teamId, conversationMemberId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(conversationMemberId)) requestInfo.PathParameters.Add("conversationMember_id", conversationMemberId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Members and owners of the team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--conversationmember-id", description: "key: id of conversationMember")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, conversationMemberId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(conversationMemberId)) requestInfo.PathParameters.Add("conversationMember_id", conversationMemberId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var conversationMemberIdOption = new Option("--conversationmember-id", description: "key: id of conversationMember"); + conversationMemberIdOption.IsRequired = true; + command.AddOption(conversationMemberIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, conversationMemberId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Members and owners of the team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--conversationmember-id", description: "key: id of conversationMember")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var conversationMemberIdOption = new Option("--conversationmember-id", description: "key: id of conversationMember"); + conversationMemberIdOption.IsRequired = true; + command.AddOption(conversationMemberIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, conversationMemberId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(conversationMemberId)) requestInfo.PathParameters.Add("conversationMember_id", conversationMemberId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Members/MembersRequestBuilder.cs b/src/generated/Teams/Item/Members/MembersRequestBuilder.cs index 73725e2b0c6..9e82089110e 100644 --- a/src/generated/Teams/Item/Members/MembersRequestBuilder.cs +++ b/src/generated/Teams/Item/Members/MembersRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Members and owners of the team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,26 +73,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Members and owners of the team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Operations/Item/TeamsAsyncOperationRequestBuilder.cs b/src/generated/Teams/Item/Operations/Item/TeamsAsyncOperationRequestBuilder.cs index 81f90cd32c7..2415f8a967e 100644 --- a/src/generated/Teams/Item/Operations/Item/TeamsAsyncOperationRequestBuilder.cs +++ b/src/generated/Teams/Item/Operations/Item/TeamsAsyncOperationRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The async operations that ran or are running on this team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsasyncoperation-id", description: "key: id of teamsAsyncOperation")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAsyncOperationIdOption = new Option("--teamsasyncoperation-id", description: "key: id of teamsAsyncOperation"); + teamsAsyncOperationIdOption.IsRequired = true; + command.AddOption(teamsAsyncOperationIdOption); command.Handler = CommandHandler.Create(async (teamId, teamsAsyncOperationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAsyncOperationId)) requestInfo.PathParameters.Add("teamsAsyncOperation_id", teamsAsyncOperationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The async operations that ran or are running on this team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsasyncoperation-id", description: "key: id of teamsAsyncOperation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, teamsAsyncOperationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAsyncOperationId)) requestInfo.PathParameters.Add("teamsAsyncOperation_id", teamsAsyncOperationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAsyncOperationIdOption = new Option("--teamsasyncoperation-id", description: "key: id of teamsAsyncOperation"); + teamsAsyncOperationIdOption.IsRequired = true; + command.AddOption(teamsAsyncOperationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, teamsAsyncOperationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The async operations that ran or are running on this team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamsasyncoperation-id", description: "key: id of teamsAsyncOperation")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsAsyncOperationIdOption = new Option("--teamsasyncoperation-id", description: "key: id of teamsAsyncOperation"); + teamsAsyncOperationIdOption.IsRequired = true; + command.AddOption(teamsAsyncOperationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, teamsAsyncOperationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsAsyncOperationId)) requestInfo.PathParameters.Add("teamsAsyncOperation_id", teamsAsyncOperationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Operations/OperationsRequestBuilder.cs b/src/generated/Teams/Item/Operations/OperationsRequestBuilder.cs index 91f8980d910..57c89e46e60 100644 --- a/src/generated/Teams/Item/Operations/OperationsRequestBuilder.cs +++ b/src/generated/Teams/Item/Operations/OperationsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The async operations that ran or are running on this team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The async operations that ran or are running on this team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/PrimaryChannel/CompleteMigration/CompleteMigrationRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/CompleteMigration/CompleteMigrationRequestBuilder.cs index 5d6d45548a0..7e048d43b44 100644 --- a/src/generated/Teams/Item/PrimaryChannel/CompleteMigration/CompleteMigrationRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/CompleteMigration/CompleteMigrationRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action completeMigration"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/PrimaryChannel/FilesFolder/Content/ContentRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/FilesFolder/Content/ContentRequestBuilder.cs index 7282ef1defb..f29e7196beb 100644 --- a/src/generated/Teams/Item/PrimaryChannel/FilesFolder/Content/ContentRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/FilesFolder/Content/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property filesFolder from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (teamId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property filesFolder in teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--file", description: "Binary request body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (teamId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/PrimaryChannel/FilesFolder/FilesFolderRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/FilesFolder/FilesFolderRequestBuilder.cs index 4de9a543535..99b90caa41d 100644 --- a/src/generated/Teams/Item/PrimaryChannel/FilesFolder/FilesFolderRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/FilesFolder/FilesFolderRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Metadata for the location where the channel's files are stored."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Metadata for the location where the channel's files are stored."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Metadata for the location where the channel's files are stored."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/PrimaryChannel/Members/@Add/AddRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Members/@Add/AddRequestBuilder.cs index fa7be6a626b..6913f17f90d 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Members/@Add/AddRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Members/@Add/AddRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/PrimaryChannel/Members/Item/ConversationMemberRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Members/Item/ConversationMemberRequestBuilder.cs index fe4d02e69ce..6f570f68c9c 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Members/Item/ConversationMemberRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Members/Item/ConversationMemberRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of membership records associated with the channel."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--conversationmember-id", description: "key: id of conversationMember")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var conversationMemberIdOption = new Option("--conversationmember-id", description: "key: id of conversationMember"); + conversationMemberIdOption.IsRequired = true; + command.AddOption(conversationMemberIdOption); command.Handler = CommandHandler.Create(async (teamId, conversationMemberId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(conversationMemberId)) requestInfo.PathParameters.Add("conversationMember_id", conversationMemberId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of membership records associated with the channel."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--conversationmember-id", description: "key: id of conversationMember")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, conversationMemberId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(conversationMemberId)) requestInfo.PathParameters.Add("conversationMember_id", conversationMemberId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var conversationMemberIdOption = new Option("--conversationmember-id", description: "key: id of conversationMember"); + conversationMemberIdOption.IsRequired = true; + command.AddOption(conversationMemberIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, conversationMemberId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of membership records associated with the channel."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--conversationmember-id", description: "key: id of conversationMember")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var conversationMemberIdOption = new Option("--conversationmember-id", description: "key: id of conversationMember"); + conversationMemberIdOption.IsRequired = true; + command.AddOption(conversationMemberIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, conversationMemberId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(conversationMemberId)) requestInfo.PathParameters.Add("conversationMember_id", conversationMemberId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/PrimaryChannel/Members/MembersRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Members/MembersRequestBuilder.cs index 01d67b49167..8d947270cdc 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Members/MembersRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Members/MembersRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of membership records associated with the channel."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,26 +73,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of membership records associated with the channel."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/PrimaryChannel/Messages/Delta/DeltaRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Messages/Delta/DeltaRequestBuilder.cs index bb8fb2c82b8..f598047befb 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Messages/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Messages/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/PrimaryChannel/Messages/Item/ChatMessageRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Messages/Item/ChatMessageRequestBuilder.cs index 674a90a11e8..1dce6adc903 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Messages/Item/ChatMessageRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Messages/Item/ChatMessageRequestBuilder.cs @@ -28,12 +28,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of all the messages in the channel. A navigation property. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); command.Handler = CommandHandler.Create(async (teamId, chatMessageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,16 +50,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of all the messages in the channel. A navigation property. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, chatMessageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, chatMessageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of all the messages in the channel. A navigation property. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, chatMessageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/PrimaryChannel/Messages/Item/HostedContents/HostedContentsRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Messages/Item/HostedContents/HostedContentsRequestBuilder.cs index 928f09d329a..3b7ee2c5ccf 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Messages/Item/HostedContents/HostedContentsRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Messages/Item/HostedContents/HostedContentsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, chatMessageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, chatMessageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, chatMessageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/PrimaryChannel/Messages/Item/HostedContents/Item/ChatMessageHostedContentRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Messages/Item/HostedContents/Item/ChatMessageHostedContentRequestBuilder.cs index ef861e9b500..cd5ece4c1a9 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Messages/Item/HostedContents/Item/ChatMessageHostedContentRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Messages/Item/HostedContents/Item/ChatMessageHostedContentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageHostedContentIdOption = new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent"); + chatMessageHostedContentIdOption.IsRequired = true; + command.AddOption(chatMessageHostedContentIdOption); command.Handler = CommandHandler.Create(async (teamId, chatMessageId, chatMessageHostedContentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageHostedContentId)) requestInfo.PathParameters.Add("chatMessageHostedContent_id", chatMessageHostedContentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, chatMessageId, chatMessageHostedContentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageHostedContentId)) requestInfo.PathParameters.Add("chatMessageHostedContent_id", chatMessageHostedContentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageHostedContentIdOption = new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent"); + chatMessageHostedContentIdOption.IsRequired = true; + command.AddOption(chatMessageHostedContentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, chatMessageId, chatMessageHostedContentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Content in a message hosted by Microsoft Teams - for example, images or code snippets."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageHostedContentIdOption = new Option("--chatmessagehostedcontent-id", description: "key: id of chatMessageHostedContent"); + chatMessageHostedContentIdOption.IsRequired = true; + command.AddOption(chatMessageHostedContentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, chatMessageId, chatMessageHostedContentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageHostedContentId)) requestInfo.PathParameters.Add("chatMessageHostedContent_id", chatMessageHostedContentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/PrimaryChannel/Messages/Item/Replies/Delta/DeltaRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Messages/Item/Replies/Delta/DeltaRequestBuilder.cs index 4d5b6e81e9c..7ed5770667f 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Messages/Item/Replies/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Messages/Item/Replies/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); command.Handler = CommandHandler.Create(async (teamId, chatMessageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/PrimaryChannel/Messages/Item/Replies/Item/ChatMessageRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Messages/Item/Replies/Item/ChatMessageRequestBuilder.cs index a12a403bbb0..fab46ddd906 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Messages/Item/Replies/Item/ChatMessageRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Messages/Item/Replies/Item/ChatMessageRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessage-id1", description: "key: id of chatMessage")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageId1Option = new Option("--chatmessage-id1", description: "key: id of chatMessage"); + chatMessageId1Option.IsRequired = true; + command.AddOption(chatMessageId1Option); command.Handler = CommandHandler.Create(async (teamId, chatMessageId, chatMessageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageId1)) requestInfo.PathParameters.Add("chatMessage_id1", chatMessageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessage-id1", description: "key: id of chatMessage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, chatMessageId, chatMessageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageId1)) requestInfo.PathParameters.Add("chatMessage_id1", chatMessageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageId1Option = new Option("--chatmessage-id1", description: "key: id of chatMessage"); + chatMessageId1Option.IsRequired = true; + command.AddOption(chatMessageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, chatMessageId, chatMessageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--chatmessage-id1", description: "key: id of chatMessage")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var chatMessageId1Option = new Option("--chatmessage-id1", description: "key: id of chatMessage"); + chatMessageId1Option.IsRequired = true; + command.AddOption(chatMessageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, chatMessageId, chatMessageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - if (!String.IsNullOrEmpty(chatMessageId1)) requestInfo.PathParameters.Add("chatMessage_id1", chatMessageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/PrimaryChannel/Messages/Item/Replies/RepliesRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Messages/Item/Replies/RepliesRequestBuilder.cs index c52ee0d142f..147721b676c 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Messages/Item/Replies/RepliesRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Messages/Item/Replies/RepliesRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, chatMessageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,28 +70,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Replies for a specified message."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--chatmessage-id", description: "key: id of chatMessage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, chatMessageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(chatMessageId)) requestInfo.PathParameters.Add("chatMessage_id", chatMessageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var chatMessageIdOption = new Option("--chatmessage-id", description: "key: id of chatMessage"); + chatMessageIdOption.IsRequired = true; + command.AddOption(chatMessageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, chatMessageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/PrimaryChannel/Messages/MessagesRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Messages/MessagesRequestBuilder.cs index 770daf68931..c8a02bc0945 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Messages/MessagesRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Messages/MessagesRequestBuilder.cs @@ -39,14 +39,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of all the messages in the channel. A navigation property. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,26 +69,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of all the messages in the channel. A navigation property. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/PrimaryChannel/PrimaryChannelRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/PrimaryChannelRequestBuilder.cs index edb6fbfb7ac..7132b50c870 100644 --- a/src/generated/Teams/Item/PrimaryChannel/PrimaryChannelRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/PrimaryChannelRequestBuilder.cs @@ -39,10 +39,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The general channel for the team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -65,14 +67,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The general channel for the team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -106,14 +116,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The general channel for the team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/PrimaryChannel/ProvisionEmail/ProvisionEmailRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/ProvisionEmail/ProvisionEmailRequestBuilder.cs index 88faec99070..10342392511 100644 --- a/src/generated/Teams/Item/PrimaryChannel/ProvisionEmail/ProvisionEmailRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/ProvisionEmail/ProvisionEmailRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action provisionEmail"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/PrimaryChannel/RemoveEmail/RemoveEmailRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/RemoveEmail/RemoveEmailRequestBuilder.cs index 109033d86ce..d37b3f09b50 100644 --- a/src/generated/Teams/Item/PrimaryChannel/RemoveEmail/RemoveEmailRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/RemoveEmail/RemoveEmailRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action removeEmail"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/PrimaryChannel/Tabs/Item/TeamsApp/@Ref/RefRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Tabs/Item/TeamsApp/@Ref/RefRequestBuilder.cs index 0aad8d9f9a7..9bcec8ff630 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Tabs/Item/TeamsApp/@Ref/RefRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Tabs/Item/TeamsApp/@Ref/RefRequestBuilder.cs @@ -19,18 +19,21 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The application that is linked to the tab. This cannot be changed after tab creation."; + command.Description = "The application that is linked to the tab."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); command.Handler = CommandHandler.Create(async (teamId, teamsTabId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -38,18 +41,21 @@ public Command BuildDeleteCommand() { return command; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The application that is linked to the tab. This cannot be changed after tab creation."; + command.Description = "The application that is linked to the tab."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); command.Handler = CommandHandler.Create(async (teamId, teamsTabId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +68,27 @@ public Command BuildGetCommand() { return command; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "The application that is linked to the tab. This cannot be changed after tab creation."; + command.Description = "The application that is linked to the tab."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, teamsTabId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -98,7 +109,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Request headers /// Request options /// @@ -113,7 +124,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Request headers /// Request options /// @@ -128,7 +139,7 @@ public RequestInformation CreateGetRequestInformation(Action - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// /// Request headers /// Request options @@ -146,7 +157,7 @@ public RequestInformation CreatePutRequestInformation(ApiSdk.Teams.Item.PrimaryC return requestInfo; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -157,7 +168,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +179,7 @@ public async Task GetAsync(Action> h = defau return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Cancellation token to use when cancelling requests /// Request headers /// diff --git a/src/generated/Teams/Item/PrimaryChannel/Tabs/Item/TeamsApp/TeamsAppRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Tabs/Item/TeamsApp/TeamsAppRequestBuilder.cs index 7654f59b5ed..69cb942ba75 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Tabs/Item/TeamsApp/TeamsAppRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Tabs/Item/TeamsApp/TeamsAppRequestBuilder.cs @@ -21,22 +21,31 @@ public class TeamsAppRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The application that is linked to the tab. This cannot be changed after tab creation."; + command.Description = "The application that is linked to the tab."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, teamsTabId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, teamsTabId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,7 +79,7 @@ public TeamsAppRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Request headers /// Request options /// Request query parameters @@ -91,7 +100,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -102,7 +111,7 @@ public RequestInformation CreateGetRequestInformation(Action var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The application that is linked to the tab. This cannot be changed after tab creation. + /// The application that is linked to the tab. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Teams/Item/PrimaryChannel/Tabs/Item/TeamsTabRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Tabs/Item/TeamsTabRequestBuilder.cs index 694d8c2e623..3cec42c12a4 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Tabs/Item/TeamsTabRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Tabs/Item/TeamsTabRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of all the tabs in the channel. A navigation property."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); command.Handler = CommandHandler.Create(async (teamId, teamsTabId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of all the tabs in the channel. A navigation property."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, teamsTabId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, teamsTabId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of all the tabs in the channel. A navigation property."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--teamstab-id", description: "key: id of teamsTab")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var teamsTabIdOption = new Option("--teamstab-id", description: "key: id of teamsTab"); + teamsTabIdOption.IsRequired = true; + command.AddOption(teamsTabIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, teamsTabId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(teamsTabId)) requestInfo.PathParameters.Add("teamsTab_id", teamsTabId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/PrimaryChannel/Tabs/TabsRequestBuilder.cs b/src/generated/Teams/Item/PrimaryChannel/Tabs/TabsRequestBuilder.cs index a8871ffc7c1..d24ab064203 100644 --- a/src/generated/Teams/Item/PrimaryChannel/Tabs/TabsRequestBuilder.cs +++ b/src/generated/Teams/Item/PrimaryChannel/Tabs/TabsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of all the tabs in the channel. A navigation property."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of all the tabs in the channel. A navigation property."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Schedule/OfferShiftRequests/Item/OfferShiftRequestRequestBuilder.cs b/src/generated/Teams/Item/Schedule/OfferShiftRequests/Item/OfferShiftRequestRequestBuilder.cs index 128efea781b..f82683d7eb6 100644 --- a/src/generated/Teams/Item/Schedule/OfferShiftRequests/Item/OfferShiftRequestRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/OfferShiftRequests/Item/OfferShiftRequestRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property offerShiftRequests for teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--offershiftrequest-id", description: "key: id of offerShiftRequest")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var offerShiftRequestIdOption = new Option("--offershiftrequest-id", description: "key: id of offerShiftRequest"); + offerShiftRequestIdOption.IsRequired = true; + command.AddOption(offerShiftRequestIdOption); command.Handler = CommandHandler.Create(async (teamId, offerShiftRequestId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(offerShiftRequestId)) requestInfo.PathParameters.Add("offerShiftRequest_id", offerShiftRequestId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get offerShiftRequests from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--offershiftrequest-id", description: "key: id of offerShiftRequest")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, offerShiftRequestId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(offerShiftRequestId)) requestInfo.PathParameters.Add("offerShiftRequest_id", offerShiftRequestId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var offerShiftRequestIdOption = new Option("--offershiftrequest-id", description: "key: id of offerShiftRequest"); + offerShiftRequestIdOption.IsRequired = true; + command.AddOption(offerShiftRequestIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, offerShiftRequestId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property offerShiftRequests in teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--offershiftrequest-id", description: "key: id of offerShiftRequest")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var offerShiftRequestIdOption = new Option("--offershiftrequest-id", description: "key: id of offerShiftRequest"); + offerShiftRequestIdOption.IsRequired = true; + command.AddOption(offerShiftRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, offerShiftRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(offerShiftRequestId)) requestInfo.PathParameters.Add("offerShiftRequest_id", offerShiftRequestId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Schedule/OfferShiftRequests/OfferShiftRequestsRequestBuilder.cs b/src/generated/Teams/Item/Schedule/OfferShiftRequests/OfferShiftRequestsRequestBuilder.cs index c8a9827e87f..290cb653621 100644 --- a/src/generated/Teams/Item/Schedule/OfferShiftRequests/OfferShiftRequestsRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/OfferShiftRequests/OfferShiftRequestsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to offerShiftRequests for teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get offerShiftRequests from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Schedule/OpenShiftChangeRequests/Item/OpenShiftChangeRequestRequestBuilder.cs b/src/generated/Teams/Item/Schedule/OpenShiftChangeRequests/Item/OpenShiftChangeRequestRequestBuilder.cs index 473446900aa..d860471cbd3 100644 --- a/src/generated/Teams/Item/Schedule/OpenShiftChangeRequests/Item/OpenShiftChangeRequestRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/OpenShiftChangeRequests/Item/OpenShiftChangeRequestRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property openShiftChangeRequests for teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--openshiftchangerequest-id", description: "key: id of openShiftChangeRequest")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var openShiftChangeRequestIdOption = new Option("--openshiftchangerequest-id", description: "key: id of openShiftChangeRequest"); + openShiftChangeRequestIdOption.IsRequired = true; + command.AddOption(openShiftChangeRequestIdOption); command.Handler = CommandHandler.Create(async (teamId, openShiftChangeRequestId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(openShiftChangeRequestId)) requestInfo.PathParameters.Add("openShiftChangeRequest_id", openShiftChangeRequestId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get openShiftChangeRequests from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--openshiftchangerequest-id", description: "key: id of openShiftChangeRequest")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, openShiftChangeRequestId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(openShiftChangeRequestId)) requestInfo.PathParameters.Add("openShiftChangeRequest_id", openShiftChangeRequestId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var openShiftChangeRequestIdOption = new Option("--openshiftchangerequest-id", description: "key: id of openShiftChangeRequest"); + openShiftChangeRequestIdOption.IsRequired = true; + command.AddOption(openShiftChangeRequestIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, openShiftChangeRequestId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property openShiftChangeRequests in teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--openshiftchangerequest-id", description: "key: id of openShiftChangeRequest")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var openShiftChangeRequestIdOption = new Option("--openshiftchangerequest-id", description: "key: id of openShiftChangeRequest"); + openShiftChangeRequestIdOption.IsRequired = true; + command.AddOption(openShiftChangeRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, openShiftChangeRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(openShiftChangeRequestId)) requestInfo.PathParameters.Add("openShiftChangeRequest_id", openShiftChangeRequestId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Schedule/OpenShiftChangeRequests/OpenShiftChangeRequestsRequestBuilder.cs b/src/generated/Teams/Item/Schedule/OpenShiftChangeRequests/OpenShiftChangeRequestsRequestBuilder.cs index 9e50cdac40f..36d0c6e9d4a 100644 --- a/src/generated/Teams/Item/Schedule/OpenShiftChangeRequests/OpenShiftChangeRequestsRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/OpenShiftChangeRequests/OpenShiftChangeRequestsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to openShiftChangeRequests for teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get openShiftChangeRequests from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Schedule/OpenShifts/Item/OpenShiftRequestBuilder.cs b/src/generated/Teams/Item/Schedule/OpenShifts/Item/OpenShiftRequestBuilder.cs index c471bce5dcb..d136c78fa99 100644 --- a/src/generated/Teams/Item/Schedule/OpenShifts/Item/OpenShiftRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/OpenShifts/Item/OpenShiftRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property openShifts for teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--openshift-id", description: "key: id of openShift")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var openShiftIdOption = new Option("--openshift-id", description: "key: id of openShift"); + openShiftIdOption.IsRequired = true; + command.AddOption(openShiftIdOption); command.Handler = CommandHandler.Create(async (teamId, openShiftId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(openShiftId)) requestInfo.PathParameters.Add("openShift_id", openShiftId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get openShifts from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--openshift-id", description: "key: id of openShift")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, openShiftId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(openShiftId)) requestInfo.PathParameters.Add("openShift_id", openShiftId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var openShiftIdOption = new Option("--openshift-id", description: "key: id of openShift"); + openShiftIdOption.IsRequired = true; + command.AddOption(openShiftIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, openShiftId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property openShifts in teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--openshift-id", description: "key: id of openShift")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var openShiftIdOption = new Option("--openshift-id", description: "key: id of openShift"); + openShiftIdOption.IsRequired = true; + command.AddOption(openShiftIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, openShiftId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(openShiftId)) requestInfo.PathParameters.Add("openShift_id", openShiftId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Schedule/OpenShifts/OpenShiftsRequestBuilder.cs b/src/generated/Teams/Item/Schedule/OpenShifts/OpenShiftsRequestBuilder.cs index 1b29204b935..12e8de37919 100644 --- a/src/generated/Teams/Item/Schedule/OpenShifts/OpenShiftsRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/OpenShifts/OpenShiftsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to openShifts for teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get openShifts from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Schedule/ScheduleRequestBuilder.cs b/src/generated/Teams/Item/Schedule/ScheduleRequestBuilder.cs index 1d4c5fb2359..dee3ab39ff2 100644 --- a/src/generated/Teams/Item/Schedule/ScheduleRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/ScheduleRequestBuilder.cs @@ -36,10 +36,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The schedule of shifts for this team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,14 +55,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The schedule of shifts for this team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -100,14 +110,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The schedule of shifts for this team."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Schedule/SchedulingGroups/Item/SchedulingGroupRequestBuilder.cs b/src/generated/Teams/Item/Schedule/SchedulingGroups/Item/SchedulingGroupRequestBuilder.cs index 01574fef8f7..499548342f2 100644 --- a/src/generated/Teams/Item/Schedule/SchedulingGroups/Item/SchedulingGroupRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/SchedulingGroups/Item/SchedulingGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The logical grouping of users in the schedule (usually by role)."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--schedulinggroup-id", description: "key: id of schedulingGroup")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var schedulingGroupIdOption = new Option("--schedulinggroup-id", description: "key: id of schedulingGroup"); + schedulingGroupIdOption.IsRequired = true; + command.AddOption(schedulingGroupIdOption); command.Handler = CommandHandler.Create(async (teamId, schedulingGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(schedulingGroupId)) requestInfo.PathParameters.Add("schedulingGroup_id", schedulingGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +48,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The logical grouping of users in the schedule (usually by role)."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--schedulinggroup-id", description: "key: id of schedulingGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (teamId, schedulingGroupId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(schedulingGroupId)) requestInfo.PathParameters.Add("schedulingGroup_id", schedulingGroupId); - requestInfo.QueryParameters.Add("select", select); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var schedulingGroupIdOption = new Option("--schedulinggroup-id", description: "key: id of schedulingGroup"); + schedulingGroupIdOption.IsRequired = true; + command.AddOption(schedulingGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (teamId, schedulingGroupId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,16 +80,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The logical grouping of users in the schedule (usually by role)."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--schedulinggroup-id", description: "key: id of schedulingGroup")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var schedulingGroupIdOption = new Option("--schedulinggroup-id", description: "key: id of schedulingGroup"); + schedulingGroupIdOption.IsRequired = true; + command.AddOption(schedulingGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, schedulingGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(schedulingGroupId)) requestInfo.PathParameters.Add("schedulingGroup_id", schedulingGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Schedule/SchedulingGroups/SchedulingGroupsRequestBuilder.cs b/src/generated/Teams/Item/Schedule/SchedulingGroups/SchedulingGroupsRequestBuilder.cs index 0e0f8f99752..5846219a155 100644 --- a/src/generated/Teams/Item/Schedule/SchedulingGroups/SchedulingGroupsRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/SchedulingGroups/SchedulingGroupsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The logical grouping of users in the schedule (usually by role)."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +66,42 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The logical grouping of users in the schedule (usually by role)."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Schedule/Share/ShareRequestBuilder.cs b/src/generated/Teams/Item/Schedule/Share/ShareRequestBuilder.cs index a3076f6aa05..429e5b7e48f 100644 --- a/src/generated/Teams/Item/Schedule/Share/ShareRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/Share/ShareRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action share"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Schedule/Shifts/Item/ShiftRequestBuilder.cs b/src/generated/Teams/Item/Schedule/Shifts/Item/ShiftRequestBuilder.cs index 60d8a3f547c..43da83b2489 100644 --- a/src/generated/Teams/Item/Schedule/Shifts/Item/ShiftRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/Shifts/Item/ShiftRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The shifts in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--shift-id", description: "key: id of shift")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var shiftIdOption = new Option("--shift-id", description: "key: id of shift"); + shiftIdOption.IsRequired = true; + command.AddOption(shiftIdOption); command.Handler = CommandHandler.Create(async (teamId, shiftId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(shiftId)) requestInfo.PathParameters.Add("shift_id", shiftId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +48,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The shifts in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--shift-id", description: "key: id of shift")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (teamId, shiftId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(shiftId)) requestInfo.PathParameters.Add("shift_id", shiftId); - requestInfo.QueryParameters.Add("select", select); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var shiftIdOption = new Option("--shift-id", description: "key: id of shift"); + shiftIdOption.IsRequired = true; + command.AddOption(shiftIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (teamId, shiftId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,16 +80,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The shifts in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--shift-id", description: "key: id of shift")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var shiftIdOption = new Option("--shift-id", description: "key: id of shift"); + shiftIdOption.IsRequired = true; + command.AddOption(shiftIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, shiftId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(shiftId)) requestInfo.PathParameters.Add("shift_id", shiftId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Schedule/Shifts/ShiftsRequestBuilder.cs b/src/generated/Teams/Item/Schedule/Shifts/ShiftsRequestBuilder.cs index 438a38fed20..3458b8e2c50 100644 --- a/src/generated/Teams/Item/Schedule/Shifts/ShiftsRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/Shifts/ShiftsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The shifts in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +66,42 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The shifts in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Schedule/SwapShiftsChangeRequests/Item/SwapShiftsChangeRequestRequestBuilder.cs b/src/generated/Teams/Item/Schedule/SwapShiftsChangeRequests/Item/SwapShiftsChangeRequestRequestBuilder.cs index 25a2b52a78e..63f85086be8 100644 --- a/src/generated/Teams/Item/Schedule/SwapShiftsChangeRequests/Item/SwapShiftsChangeRequestRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/SwapShiftsChangeRequests/Item/SwapShiftsChangeRequestRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property swapShiftsChangeRequests for teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--swapshiftschangerequest-id", description: "key: id of swapShiftsChangeRequest")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var swapShiftsChangeRequestIdOption = new Option("--swapshiftschangerequest-id", description: "key: id of swapShiftsChangeRequest"); + swapShiftsChangeRequestIdOption.IsRequired = true; + command.AddOption(swapShiftsChangeRequestIdOption); command.Handler = CommandHandler.Create(async (teamId, swapShiftsChangeRequestId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(swapShiftsChangeRequestId)) requestInfo.PathParameters.Add("swapShiftsChangeRequest_id", swapShiftsChangeRequestId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get swapShiftsChangeRequests from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--swapshiftschangerequest-id", description: "key: id of swapShiftsChangeRequest")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, swapShiftsChangeRequestId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(swapShiftsChangeRequestId)) requestInfo.PathParameters.Add("swapShiftsChangeRequest_id", swapShiftsChangeRequestId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var swapShiftsChangeRequestIdOption = new Option("--swapshiftschangerequest-id", description: "key: id of swapShiftsChangeRequest"); + swapShiftsChangeRequestIdOption.IsRequired = true; + command.AddOption(swapShiftsChangeRequestIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, swapShiftsChangeRequestId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property swapShiftsChangeRequests in teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--swapshiftschangerequest-id", description: "key: id of swapShiftsChangeRequest")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var swapShiftsChangeRequestIdOption = new Option("--swapshiftschangerequest-id", description: "key: id of swapShiftsChangeRequest"); + swapShiftsChangeRequestIdOption.IsRequired = true; + command.AddOption(swapShiftsChangeRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, swapShiftsChangeRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(swapShiftsChangeRequestId)) requestInfo.PathParameters.Add("swapShiftsChangeRequest_id", swapShiftsChangeRequestId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Schedule/SwapShiftsChangeRequests/SwapShiftsChangeRequestsRequestBuilder.cs b/src/generated/Teams/Item/Schedule/SwapShiftsChangeRequests/SwapShiftsChangeRequestsRequestBuilder.cs index e3155ba42dc..8036785394c 100644 --- a/src/generated/Teams/Item/Schedule/SwapShiftsChangeRequests/SwapShiftsChangeRequestsRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/SwapShiftsChangeRequests/SwapShiftsChangeRequestsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to swapShiftsChangeRequests for teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get swapShiftsChangeRequests from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Schedule/TimeOffReasons/Item/TimeOffReasonRequestBuilder.cs b/src/generated/Teams/Item/Schedule/TimeOffReasons/Item/TimeOffReasonRequestBuilder.cs index 5ac6a5d37e3..89307591e08 100644 --- a/src/generated/Teams/Item/Schedule/TimeOffReasons/Item/TimeOffReasonRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/TimeOffReasons/Item/TimeOffReasonRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The set of reasons for a time off in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--timeoffreason-id", description: "key: id of timeOffReason")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var timeOffReasonIdOption = new Option("--timeoffreason-id", description: "key: id of timeOffReason"); + timeOffReasonIdOption.IsRequired = true; + command.AddOption(timeOffReasonIdOption); command.Handler = CommandHandler.Create(async (teamId, timeOffReasonId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(timeOffReasonId)) requestInfo.PathParameters.Add("timeOffReason_id", timeOffReasonId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +48,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The set of reasons for a time off in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--timeoffreason-id", description: "key: id of timeOffReason")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (teamId, timeOffReasonId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(timeOffReasonId)) requestInfo.PathParameters.Add("timeOffReason_id", timeOffReasonId); - requestInfo.QueryParameters.Add("select", select); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var timeOffReasonIdOption = new Option("--timeoffreason-id", description: "key: id of timeOffReason"); + timeOffReasonIdOption.IsRequired = true; + command.AddOption(timeOffReasonIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (teamId, timeOffReasonId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,16 +80,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The set of reasons for a time off in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--timeoffreason-id", description: "key: id of timeOffReason")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var timeOffReasonIdOption = new Option("--timeoffreason-id", description: "key: id of timeOffReason"); + timeOffReasonIdOption.IsRequired = true; + command.AddOption(timeOffReasonIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, timeOffReasonId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(timeOffReasonId)) requestInfo.PathParameters.Add("timeOffReason_id", timeOffReasonId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Schedule/TimeOffReasons/TimeOffReasonsRequestBuilder.cs b/src/generated/Teams/Item/Schedule/TimeOffReasons/TimeOffReasonsRequestBuilder.cs index a0799cd4828..1af4823208b 100644 --- a/src/generated/Teams/Item/Schedule/TimeOffReasons/TimeOffReasonsRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/TimeOffReasons/TimeOffReasonsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The set of reasons for a time off in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +66,42 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The set of reasons for a time off in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Schedule/TimeOffRequests/Item/TimeOffRequestRequestBuilder.cs b/src/generated/Teams/Item/Schedule/TimeOffRequests/Item/TimeOffRequestRequestBuilder.cs index af6ef33788f..987a9867b90 100644 --- a/src/generated/Teams/Item/Schedule/TimeOffRequests/Item/TimeOffRequestRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/TimeOffRequests/Item/TimeOffRequestRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property timeOffRequests for teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--timeoffrequest-id", description: "key: id of timeOffRequest")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var timeOffRequestIdOption = new Option("--timeoffrequest-id", description: "key: id of timeOffRequest"); + timeOffRequestIdOption.IsRequired = true; + command.AddOption(timeOffRequestIdOption); command.Handler = CommandHandler.Create(async (teamId, timeOffRequestId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(timeOffRequestId)) requestInfo.PathParameters.Add("timeOffRequest_id", timeOffRequestId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +48,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get timeOffRequests from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--timeoffrequest-id", description: "key: id of timeOffRequest")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (teamId, timeOffRequestId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(timeOffRequestId)) requestInfo.PathParameters.Add("timeOffRequest_id", timeOffRequestId); - requestInfo.QueryParameters.Add("select", select); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var timeOffRequestIdOption = new Option("--timeoffrequest-id", description: "key: id of timeOffRequest"); + timeOffRequestIdOption.IsRequired = true; + command.AddOption(timeOffRequestIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (teamId, timeOffRequestId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,16 +80,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property timeOffRequests in teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--timeoffrequest-id", description: "key: id of timeOffRequest")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var timeOffRequestIdOption = new Option("--timeoffrequest-id", description: "key: id of timeOffRequest"); + timeOffRequestIdOption.IsRequired = true; + command.AddOption(timeOffRequestIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, timeOffRequestId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(timeOffRequestId)) requestInfo.PathParameters.Add("timeOffRequest_id", timeOffRequestId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Schedule/TimeOffRequests/TimeOffRequestsRequestBuilder.cs b/src/generated/Teams/Item/Schedule/TimeOffRequests/TimeOffRequestsRequestBuilder.cs index bc6237d3da1..7f4f3e71fcc 100644 --- a/src/generated/Teams/Item/Schedule/TimeOffRequests/TimeOffRequestsRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/TimeOffRequests/TimeOffRequestsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to timeOffRequests for teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +66,42 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get timeOffRequests from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Schedule/TimesOff/Item/TimeOffRequestBuilder.cs b/src/generated/Teams/Item/Schedule/TimesOff/Item/TimeOffRequestBuilder.cs index dc6348b4b9d..95c2088cab7 100644 --- a/src/generated/Teams/Item/Schedule/TimesOff/Item/TimeOffRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/TimesOff/Item/TimeOffRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The instances of times off in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--timeoff-id", description: "key: id of timeOff")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var timeOffIdOption = new Option("--timeoff-id", description: "key: id of timeOff"); + timeOffIdOption.IsRequired = true; + command.AddOption(timeOffIdOption); command.Handler = CommandHandler.Create(async (teamId, timeOffId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(timeOffId)) requestInfo.PathParameters.Add("timeOff_id", timeOffId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +48,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The instances of times off in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--timeoff-id", description: "key: id of timeOff")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (teamId, timeOffId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(timeOffId)) requestInfo.PathParameters.Add("timeOff_id", timeOffId); - requestInfo.QueryParameters.Add("select", select); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var timeOffIdOption = new Option("--timeoff-id", description: "key: id of timeOff"); + timeOffIdOption.IsRequired = true; + command.AddOption(timeOffIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (teamId, timeOffId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,16 +80,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The instances of times off in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--timeoff-id", description: "key: id of timeOff")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var timeOffIdOption = new Option("--timeoff-id", description: "key: id of timeOff"); + timeOffIdOption.IsRequired = true; + command.AddOption(timeOffIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, timeOffId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - if (!String.IsNullOrEmpty(timeOffId)) requestInfo.PathParameters.Add("timeOff_id", timeOffId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Schedule/TimesOff/TimesOffRequestBuilder.cs b/src/generated/Teams/Item/Schedule/TimesOff/TimesOffRequestBuilder.cs index 47dcb813486..b0a15638216 100644 --- a/src/generated/Teams/Item/Schedule/TimesOff/TimesOffRequestBuilder.cs +++ b/src/generated/Teams/Item/Schedule/TimesOff/TimesOffRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The instances of times off in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,24 +66,42 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The instances of times off in the schedule."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (teamId, top, skip, search, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/SendActivityNotification/SendActivityNotificationRequestBuilder.cs b/src/generated/Teams/Item/SendActivityNotification/SendActivityNotificationRequestBuilder.cs index 5966daabf59..f6379ab082b 100644 --- a/src/generated/Teams/Item/SendActivityNotification/SendActivityNotificationRequestBuilder.cs +++ b/src/generated/Teams/Item/SendActivityNotification/SendActivityNotificationRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sendActivityNotification"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/TeamRequestBuilder.cs b/src/generated/Teams/Item/TeamRequestBuilder.cs index fe3393feb8b..d46ba433fdf 100644 --- a/src/generated/Teams/Item/TeamRequestBuilder.cs +++ b/src/generated/Teams/Item/TeamRequestBuilder.cs @@ -64,10 +64,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -81,14 +83,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from teams by key"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -136,14 +146,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in teams"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Template/@Ref/RefRequestBuilder.cs b/src/generated/Teams/Item/Template/@Ref/RefRequestBuilder.cs index 1ff4de7d233..76554b296b7 100644 --- a/src/generated/Teams/Item/Template/@Ref/RefRequestBuilder.cs +++ b/src/generated/Teams/Item/Template/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The template this team was created from. See available templates."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The template this team was created from. See available templates."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The template this team was created from. See available templates."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/Item/Template/TemplateRequestBuilder.cs b/src/generated/Teams/Item/Template/TemplateRequestBuilder.cs index 6a9d385427e..f76f3ba0cf8 100644 --- a/src/generated/Teams/Item/Template/TemplateRequestBuilder.cs +++ b/src/generated/Teams/Item/Template/TemplateRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The template this team was created from. See available templates."; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teams/Item/Unarchive/UnarchiveRequestBuilder.cs b/src/generated/Teams/Item/Unarchive/UnarchiveRequestBuilder.cs index fc5f450b2fa..e16c41112bb 100644 --- a/src/generated/Teams/Item/Unarchive/UnarchiveRequestBuilder.cs +++ b/src/generated/Teams/Item/Unarchive/UnarchiveRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unarchive"; // Create options for all the parameters - command.AddOption(new Option("--team-id", description: "key: id of team")); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (teamId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teams/TeamsRequestBuilder.cs b/src/generated/Teams/TeamsRequestBuilder.cs index 9ba4187496d..b1a86250154 100644 --- a/src/generated/Teams/TeamsRequestBuilder.cs +++ b/src/generated/Teams/TeamsRequestBuilder.cs @@ -50,12 +50,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to teams"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,24 +77,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from teams"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/TeamsTemplates/Item/TeamsTemplateRequestBuilder.cs b/src/generated/TeamsTemplates/Item/TeamsTemplateRequestBuilder.cs index 442e1b2c581..3005a3674dd 100644 --- a/src/generated/TeamsTemplates/Item/TeamsTemplateRequestBuilder.cs +++ b/src/generated/TeamsTemplates/Item/TeamsTemplateRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from teamsTemplates"; // Create options for all the parameters - command.AddOption(new Option("--teamstemplate-id", description: "key: id of teamsTemplate")); + var teamsTemplateIdOption = new Option("--teamstemplate-id", description: "key: id of teamsTemplate"); + teamsTemplateIdOption.IsRequired = true; + command.AddOption(teamsTemplateIdOption); command.Handler = CommandHandler.Create(async (teamsTemplateId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(teamsTemplateId)) requestInfo.PathParameters.Add("teamsTemplate_id", teamsTemplateId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from teamsTemplates by key"; // Create options for all the parameters - command.AddOption(new Option("--teamstemplate-id", description: "key: id of teamsTemplate")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (teamsTemplateId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(teamsTemplateId)) requestInfo.PathParameters.Add("teamsTemplate_id", teamsTemplateId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var teamsTemplateIdOption = new Option("--teamstemplate-id", description: "key: id of teamsTemplate"); + teamsTemplateIdOption.IsRequired = true; + command.AddOption(teamsTemplateIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (teamsTemplateId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in teamsTemplates"; // Create options for all the parameters - command.AddOption(new Option("--teamstemplate-id", description: "key: id of teamsTemplate")); - command.AddOption(new Option("--body")); + var teamsTemplateIdOption = new Option("--teamstemplate-id", description: "key: id of teamsTemplate"); + teamsTemplateIdOption.IsRequired = true; + command.AddOption(teamsTemplateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (teamsTemplateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(teamsTemplateId)) requestInfo.PathParameters.Add("teamsTemplate_id", teamsTemplateId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/TeamsTemplates/TeamsTemplatesRequestBuilder.cs b/src/generated/TeamsTemplates/TeamsTemplatesRequestBuilder.cs index c2ab06b5035..eea8e65b2cb 100644 --- a/src/generated/TeamsTemplates/TeamsTemplatesRequestBuilder.cs +++ b/src/generated/TeamsTemplates/TeamsTemplatesRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to teamsTemplates"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from teamsTemplates"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Teamwork/TeamworkRequestBuilder.cs b/src/generated/Teamwork/TeamworkRequestBuilder.cs index 1d019b4136a..664a97e06f9 100644 --- a/src/generated/Teamwork/TeamworkRequestBuilder.cs +++ b/src/generated/Teamwork/TeamworkRequestBuilder.cs @@ -27,12 +27,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get teamwork"; // Create options for all the parameters - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -51,12 +58,15 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update teamwork"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teamwork/WorkforceIntegrations/Item/WorkforceIntegrationRequestBuilder.cs b/src/generated/Teamwork/WorkforceIntegrations/Item/WorkforceIntegrationRequestBuilder.cs index 06df922e61c..baacbcb0989 100644 --- a/src/generated/Teamwork/WorkforceIntegrations/Item/WorkforceIntegrationRequestBuilder.cs +++ b/src/generated/Teamwork/WorkforceIntegrations/Item/WorkforceIntegrationRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property workforceIntegrations for teamwork"; // Create options for all the parameters - command.AddOption(new Option("--workforceintegration-id", description: "key: id of workforceIntegration")); + var workforceIntegrationIdOption = new Option("--workforceintegration-id", description: "key: id of workforceIntegration"); + workforceIntegrationIdOption.IsRequired = true; + command.AddOption(workforceIntegrationIdOption); command.Handler = CommandHandler.Create(async (workforceIntegrationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(workforceIntegrationId)) requestInfo.PathParameters.Add("workforceIntegration_id", workforceIntegrationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get workforceIntegrations from teamwork"; // Create options for all the parameters - command.AddOption(new Option("--workforceintegration-id", description: "key: id of workforceIntegration")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (workforceIntegrationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(workforceIntegrationId)) requestInfo.PathParameters.Add("workforceIntegration_id", workforceIntegrationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var workforceIntegrationIdOption = new Option("--workforceintegration-id", description: "key: id of workforceIntegration"); + workforceIntegrationIdOption.IsRequired = true; + command.AddOption(workforceIntegrationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (workforceIntegrationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property workforceIntegrations in teamwork"; // Create options for all the parameters - command.AddOption(new Option("--workforceintegration-id", description: "key: id of workforceIntegration")); - command.AddOption(new Option("--body")); + var workforceIntegrationIdOption = new Option("--workforceintegration-id", description: "key: id of workforceIntegration"); + workforceIntegrationIdOption.IsRequired = true; + command.AddOption(workforceIntegrationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (workforceIntegrationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(workforceIntegrationId)) requestInfo.PathParameters.Add("workforceIntegration_id", workforceIntegrationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Teamwork/WorkforceIntegrations/WorkforceIntegrationsRequestBuilder.cs b/src/generated/Teamwork/WorkforceIntegrations/WorkforceIntegrationsRequestBuilder.cs index 82f745792cc..7aa4f628b0c 100644 --- a/src/generated/Teamwork/WorkforceIntegrations/WorkforceIntegrationsRequestBuilder.cs +++ b/src/generated/Teamwork/WorkforceIntegrations/WorkforceIntegrationsRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to workforceIntegrations for teamwork"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,24 +63,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get workforceIntegrations from teamwork"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Delta/DeltaRequestBuilder.cs index 55ed9ff35d7..a1adf2f1008 100644 --- a/src/generated/Users/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Delta/DeltaRequestBuilder.cs @@ -26,7 +26,8 @@ public Command BuildGetCommand() { command.Description = "Invoke function delta"; // Create options for all the parameters command.Handler = CommandHandler.Create(async () => { - var requestInfo = CreateGetRequestInformation(); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs b/src/generated/Users/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs index 2a4f4d81011..f99b5b796dd 100644 --- a/src/generated/Users/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs +++ b/src/generated/Users/GetAvailableExtensionProperties/GetAvailableExtensionPropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getAvailableExtensionProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/GetByIds/GetByIdsRequestBuilder.cs b/src/generated/Users/GetByIds/GetByIdsRequestBuilder.cs index 21743ef5897..ba37333f2c9 100644 --- a/src/generated/Users/GetByIds/GetByIdsRequestBuilder.cs +++ b/src/generated/Users/GetByIds/GetByIdsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getByIds"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Activities/ActivitiesRequestBuilder.cs b/src/generated/Users/Item/Activities/ActivitiesRequestBuilder.cs index fd672ab69c7..35a09d52fa7 100644 --- a/src/generated/Users/Item/Activities/ActivitiesRequestBuilder.cs +++ b/src/generated/Users/Item/Activities/ActivitiesRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The user's activities across devices. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +68,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The user's activities across devices. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Activities/Item/HistoryItems/HistoryItemsRequestBuilder.cs b/src/generated/Users/Item/Activities/Item/HistoryItems/HistoryItemsRequestBuilder.cs index a15ab663da9..06008cb15d7 100644 --- a/src/generated/Users/Item/Activities/Item/HistoryItems/HistoryItemsRequestBuilder.cs +++ b/src/generated/Users/Item/Activities/Item/HistoryItems/HistoryItemsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the activity's historyItems."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, userActivityId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,28 +70,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the activity's historyItems."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, userActivityId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, userActivityId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Activities/Item/HistoryItems/Item/Activity/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/Activities/Item/HistoryItems/Item/Activity/@Ref/RefRequestBuilder.cs index 89c3ef6af15..e25c4a78366 100644 --- a/src/generated/Users/Item/Activities/Item/HistoryItems/Item/Activity/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/Activities/Item/HistoryItems/Item/Activity/@Ref/RefRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the associated activity."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var activityHistoryItemIdOption = new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem"); + activityHistoryItemIdOption.IsRequired = true; + command.AddOption(activityHistoryItemIdOption); command.Handler = CommandHandler.Create(async (userId, userActivityId, activityHistoryItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - if (!String.IsNullOrEmpty(activityHistoryItemId)) requestInfo.PathParameters.Add("activityHistoryItem_id", activityHistoryItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,14 +50,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the associated activity."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var activityHistoryItemIdOption = new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem"); + activityHistoryItemIdOption.IsRequired = true; + command.AddOption(activityHistoryItemIdOption); command.Handler = CommandHandler.Create(async (userId, userActivityId, activityHistoryItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - if (!String.IsNullOrEmpty(activityHistoryItemId)) requestInfo.PathParameters.Add("activityHistoryItem_id", activityHistoryItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,18 +80,24 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the associated activity."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var activityHistoryItemIdOption = new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem"); + activityHistoryItemIdOption.IsRequired = true; + command.AddOption(activityHistoryItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, userActivityId, activityHistoryItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - if (!String.IsNullOrEmpty(activityHistoryItemId)) requestInfo.PathParameters.Add("activityHistoryItem_id", activityHistoryItemId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Activities/Item/HistoryItems/Item/Activity/ActivityRequestBuilder.cs b/src/generated/Users/Item/Activities/Item/HistoryItems/Item/Activity/ActivityRequestBuilder.cs index 4e7ec1b65c8..bbbb92e6972 100644 --- a/src/generated/Users/Item/Activities/Item/HistoryItems/Item/Activity/ActivityRequestBuilder.cs +++ b/src/generated/Users/Item/Activities/Item/HistoryItems/Item/Activity/ActivityRequestBuilder.cs @@ -27,18 +27,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the associated activity."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, userActivityId, activityHistoryItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - if (!String.IsNullOrEmpty(activityHistoryItemId)) requestInfo.PathParameters.Add("activityHistoryItem_id", activityHistoryItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var activityHistoryItemIdOption = new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem"); + activityHistoryItemIdOption.IsRequired = true; + command.AddOption(activityHistoryItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, userActivityId, activityHistoryItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Activities/Item/HistoryItems/Item/ActivityHistoryItemRequestBuilder.cs b/src/generated/Users/Item/Activities/Item/HistoryItems/Item/ActivityHistoryItemRequestBuilder.cs index 7aeae885b56..661c4599fbc 100644 --- a/src/generated/Users/Item/Activities/Item/HistoryItems/Item/ActivityHistoryItemRequestBuilder.cs +++ b/src/generated/Users/Item/Activities/Item/HistoryItems/Item/ActivityHistoryItemRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the activity's historyItems."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var activityHistoryItemIdOption = new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem"); + activityHistoryItemIdOption.IsRequired = true; + command.AddOption(activityHistoryItemIdOption); command.Handler = CommandHandler.Create(async (userId, userActivityId, activityHistoryItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - if (!String.IsNullOrEmpty(activityHistoryItemId)) requestInfo.PathParameters.Add("activityHistoryItem_id", activityHistoryItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the activity's historyItems."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, userActivityId, activityHistoryItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - if (!String.IsNullOrEmpty(activityHistoryItemId)) requestInfo.PathParameters.Add("activityHistoryItem_id", activityHistoryItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var activityHistoryItemIdOption = new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem"); + activityHistoryItemIdOption.IsRequired = true; + command.AddOption(activityHistoryItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, userActivityId, activityHistoryItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Optional. NavigationProperty/Containment; navigation property to the activity's historyItems."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var activityHistoryItemIdOption = new Option("--activityhistoryitem-id", description: "key: id of activityHistoryItem"); + activityHistoryItemIdOption.IsRequired = true; + command.AddOption(activityHistoryItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, userActivityId, activityHistoryItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - if (!String.IsNullOrEmpty(activityHistoryItemId)) requestInfo.PathParameters.Add("activityHistoryItem_id", activityHistoryItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Activities/Item/UserActivityRequestBuilder.cs b/src/generated/Users/Item/Activities/Item/UserActivityRequestBuilder.cs index 05e19f1a4bb..8a9a9608ab6 100644 --- a/src/generated/Users/Item/Activities/Item/UserActivityRequestBuilder.cs +++ b/src/generated/Users/Item/Activities/Item/UserActivityRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's activities across devices. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); command.Handler = CommandHandler.Create(async (userId, userActivityId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's activities across devices. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, userActivityId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, userActivityId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's activities across devices. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--useractivity-id", description: "key: id of userActivity")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userActivityIdOption = new Option("--useractivity-id", description: "key: id of userActivity"); + userActivityIdOption.IsRequired = true; + command.AddOption(userActivityIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, userActivityId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userActivityId)) requestInfo.PathParameters.Add("userActivity_id", userActivityId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Activities/Recent/RecentRequestBuilder.cs b/src/generated/Users/Item/Activities/Recent/RecentRequestBuilder.cs index f8570a3f42d..8bc580a5e3b 100644 --- a/src/generated/Users/Item/Activities/Recent/RecentRequestBuilder.cs +++ b/src/generated/Users/Item/Activities/Recent/RecentRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function recent"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/AgreementAcceptances/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/AgreementAcceptances/@Ref/RefRequestBuilder.cs index 9cea14e356e..49051ba0774 100644 --- a/src/generated/Users/Item/AgreementAcceptances/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/AgreementAcceptances/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's terms of use acceptance statuses. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The user's terms of use acceptance statuses. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs b/src/generated/Users/Item/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs index 3f878ce7a33..83d06d4ed4a 100644 --- a/src/generated/Users/Item/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs +++ b/src/generated/Users/Item/AgreementAcceptances/AgreementAcceptancesRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's terms of use acceptance statuses. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs b/src/generated/Users/Item/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs index f82400c41d4..28d3abe9829 100644 --- a/src/generated/Users/Item/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs +++ b/src/generated/Users/Item/AppRoleAssignments/AppRoleAssignmentsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents the app roles a user has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents the app roles a user has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs b/src/generated/Users/Item/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs index 90338f7e332..36e30b9d49c 100644 --- a/src/generated/Users/Item/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs +++ b/src/generated/Users/Item/AppRoleAssignments/Item/AppRoleAssignmentRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the app roles a user has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); command.Handler = CommandHandler.Create(async (userId, appRoleAssignmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the app roles a user has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, appRoleAssignmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, appRoleAssignmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the app roles a user has been granted for an application. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--approleassignment-id", description: "key: id of appRoleAssignment")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var appRoleAssignmentIdOption = new Option("--approleassignment-id", description: "key: id of appRoleAssignment"); + appRoleAssignmentIdOption.IsRequired = true; + command.AddOption(appRoleAssignmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, appRoleAssignmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(appRoleAssignmentId)) requestInfo.PathParameters.Add("appRoleAssignment_id", appRoleAssignmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/AssignLicense/AssignLicenseRequestBuilder.cs b/src/generated/Users/Item/AssignLicense/AssignLicenseRequestBuilder.cs index cb4865dd9ca..2c4b90af77c 100644 --- a/src/generated/Users/Item/AssignLicense/AssignLicenseRequestBuilder.cs +++ b/src/generated/Users/Item/AssignLicense/AssignLicenseRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assignLicense"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Authentication/AuthenticationRequestBuilder.cs b/src/generated/Users/Item/Authentication/AuthenticationRequestBuilder.cs index 95c115a8d9d..3c758a84aa0 100644 --- a/src/generated/Users/Item/Authentication/AuthenticationRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/AuthenticationRequestBuilder.cs @@ -30,10 +30,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property authentication for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,14 +56,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get authentication from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -94,14 +104,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property authentication in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Authentication/Fido2Methods/Fido2MethodsRequestBuilder.cs b/src/generated/Users/Item/Authentication/Fido2Methods/Fido2MethodsRequestBuilder.cs index 5a7a29e19e7..58f6c0d1a47 100644 --- a/src/generated/Users/Item/Authentication/Fido2Methods/Fido2MethodsRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/Fido2Methods/Fido2MethodsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to fido2Methods for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get fido2Methods from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Authentication/Fido2Methods/Item/Fido2AuthenticationMethodRequestBuilder.cs b/src/generated/Users/Item/Authentication/Fido2Methods/Item/Fido2AuthenticationMethodRequestBuilder.cs index aa9cb87eefd..45ee1929fbc 100644 --- a/src/generated/Users/Item/Authentication/Fido2Methods/Item/Fido2AuthenticationMethodRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/Fido2Methods/Item/Fido2AuthenticationMethodRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property fido2Methods for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--fido2authenticationmethod-id", description: "key: id of fido2AuthenticationMethod")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var fido2AuthenticationMethodIdOption = new Option("--fido2authenticationmethod-id", description: "key: id of fido2AuthenticationMethod"); + fido2AuthenticationMethodIdOption.IsRequired = true; + command.AddOption(fido2AuthenticationMethodIdOption); command.Handler = CommandHandler.Create(async (userId, fido2AuthenticationMethodId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(fido2AuthenticationMethodId)) requestInfo.PathParameters.Add("fido2AuthenticationMethod_id", fido2AuthenticationMethodId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get fido2Methods from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--fido2authenticationmethod-id", description: "key: id of fido2AuthenticationMethod")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, fido2AuthenticationMethodId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(fido2AuthenticationMethodId)) requestInfo.PathParameters.Add("fido2AuthenticationMethod_id", fido2AuthenticationMethodId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var fido2AuthenticationMethodIdOption = new Option("--fido2authenticationmethod-id", description: "key: id of fido2AuthenticationMethod"); + fido2AuthenticationMethodIdOption.IsRequired = true; + command.AddOption(fido2AuthenticationMethodIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, fido2AuthenticationMethodId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property fido2Methods in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--fido2authenticationmethod-id", description: "key: id of fido2AuthenticationMethod")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var fido2AuthenticationMethodIdOption = new Option("--fido2authenticationmethod-id", description: "key: id of fido2AuthenticationMethod"); + fido2AuthenticationMethodIdOption.IsRequired = true; + command.AddOption(fido2AuthenticationMethodIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, fido2AuthenticationMethodId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(fido2AuthenticationMethodId)) requestInfo.PathParameters.Add("fido2AuthenticationMethod_id", fido2AuthenticationMethodId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Authentication/Methods/Item/AuthenticationMethodRequestBuilder.cs b/src/generated/Users/Item/Authentication/Methods/Item/AuthenticationMethodRequestBuilder.cs index 8f61f18d9fa..534f31e8e43 100644 --- a/src/generated/Users/Item/Authentication/Methods/Item/AuthenticationMethodRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/Methods/Item/AuthenticationMethodRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property methods for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--authenticationmethod-id", description: "key: id of authenticationMethod")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var authenticationMethodIdOption = new Option("--authenticationmethod-id", description: "key: id of authenticationMethod"); + authenticationMethodIdOption.IsRequired = true; + command.AddOption(authenticationMethodIdOption); command.Handler = CommandHandler.Create(async (userId, authenticationMethodId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(authenticationMethodId)) requestInfo.PathParameters.Add("authenticationMethod_id", authenticationMethodId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get methods from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--authenticationmethod-id", description: "key: id of authenticationMethod")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, authenticationMethodId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(authenticationMethodId)) requestInfo.PathParameters.Add("authenticationMethod_id", authenticationMethodId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var authenticationMethodIdOption = new Option("--authenticationmethod-id", description: "key: id of authenticationMethod"); + authenticationMethodIdOption.IsRequired = true; + command.AddOption(authenticationMethodIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, authenticationMethodId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property methods in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--authenticationmethod-id", description: "key: id of authenticationMethod")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var authenticationMethodIdOption = new Option("--authenticationmethod-id", description: "key: id of authenticationMethod"); + authenticationMethodIdOption.IsRequired = true; + command.AddOption(authenticationMethodIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, authenticationMethodId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(authenticationMethodId)) requestInfo.PathParameters.Add("authenticationMethod_id", authenticationMethodId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Authentication/Methods/MethodsRequestBuilder.cs b/src/generated/Users/Item/Authentication/Methods/MethodsRequestBuilder.cs index 0662c19ba96..1bf6a316ef1 100644 --- a/src/generated/Users/Item/Authentication/Methods/MethodsRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/Methods/MethodsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to methods for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get methods from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Authentication/MicrosoftAuthenticatorMethods/Item/Device/DeviceRequestBuilder.cs b/src/generated/Users/Item/Authentication/MicrosoftAuthenticatorMethods/Item/Device/DeviceRequestBuilder.cs index f462e43785c..3babc7a849a 100644 --- a/src/generated/Users/Item/Authentication/MicrosoftAuthenticatorMethods/Item/Device/DeviceRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/MicrosoftAuthenticatorMethods/Item/Device/DeviceRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The registered device on which Microsoft Authenticator resides. This property is null if the device is not registered for passwordless Phone Sign-In."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var microsoftAuthenticatorAuthenticationMethodIdOption = new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod"); + microsoftAuthenticatorAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(microsoftAuthenticatorAuthenticationMethodIdOption); command.Handler = CommandHandler.Create(async (userId, microsoftAuthenticatorAuthenticationMethodId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(microsoftAuthenticatorAuthenticationMethodId)) requestInfo.PathParameters.Add("microsoftAuthenticatorAuthenticationMethod_id", microsoftAuthenticatorAuthenticationMethodId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The registered device on which Microsoft Authenticator resides. This property is null if the device is not registered for passwordless Phone Sign-In."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, microsoftAuthenticatorAuthenticationMethodId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(microsoftAuthenticatorAuthenticationMethodId)) requestInfo.PathParameters.Add("microsoftAuthenticatorAuthenticationMethod_id", microsoftAuthenticatorAuthenticationMethodId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var microsoftAuthenticatorAuthenticationMethodIdOption = new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod"); + microsoftAuthenticatorAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(microsoftAuthenticatorAuthenticationMethodIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, microsoftAuthenticatorAuthenticationMethodId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The registered device on which Microsoft Authenticator resides. This property is null if the device is not registered for passwordless Phone Sign-In."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var microsoftAuthenticatorAuthenticationMethodIdOption = new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod"); + microsoftAuthenticatorAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(microsoftAuthenticatorAuthenticationMethodIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, microsoftAuthenticatorAuthenticationMethodId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(microsoftAuthenticatorAuthenticationMethodId)) requestInfo.PathParameters.Add("microsoftAuthenticatorAuthenticationMethod_id", microsoftAuthenticatorAuthenticationMethodId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Authentication/MicrosoftAuthenticatorMethods/Item/MicrosoftAuthenticatorAuthenticationMethodRequestBuilder.cs b/src/generated/Users/Item/Authentication/MicrosoftAuthenticatorMethods/Item/MicrosoftAuthenticatorAuthenticationMethodRequestBuilder.cs index dde39a3902c..d698e4d532d 100644 --- a/src/generated/Users/Item/Authentication/MicrosoftAuthenticatorMethods/Item/MicrosoftAuthenticatorAuthenticationMethodRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/MicrosoftAuthenticatorMethods/Item/MicrosoftAuthenticatorAuthenticationMethodRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property microsoftAuthenticatorMethods for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var microsoftAuthenticatorAuthenticationMethodIdOption = new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod"); + microsoftAuthenticatorAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(microsoftAuthenticatorAuthenticationMethodIdOption); command.Handler = CommandHandler.Create(async (userId, microsoftAuthenticatorAuthenticationMethodId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(microsoftAuthenticatorAuthenticationMethodId)) requestInfo.PathParameters.Add("microsoftAuthenticatorAuthenticationMethod_id", microsoftAuthenticatorAuthenticationMethodId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get microsoftAuthenticatorMethods from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, microsoftAuthenticatorAuthenticationMethodId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(microsoftAuthenticatorAuthenticationMethodId)) requestInfo.PathParameters.Add("microsoftAuthenticatorAuthenticationMethod_id", microsoftAuthenticatorAuthenticationMethodId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var microsoftAuthenticatorAuthenticationMethodIdOption = new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod"); + microsoftAuthenticatorAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(microsoftAuthenticatorAuthenticationMethodIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, microsoftAuthenticatorAuthenticationMethodId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property microsoftAuthenticatorMethods in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var microsoftAuthenticatorAuthenticationMethodIdOption = new Option("--microsoftauthenticatorauthenticationmethod-id", description: "key: id of microsoftAuthenticatorAuthenticationMethod"); + microsoftAuthenticatorAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(microsoftAuthenticatorAuthenticationMethodIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, microsoftAuthenticatorAuthenticationMethodId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(microsoftAuthenticatorAuthenticationMethodId)) requestInfo.PathParameters.Add("microsoftAuthenticatorAuthenticationMethod_id", microsoftAuthenticatorAuthenticationMethodId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Authentication/MicrosoftAuthenticatorMethods/MicrosoftAuthenticatorMethodsRequestBuilder.cs b/src/generated/Users/Item/Authentication/MicrosoftAuthenticatorMethods/MicrosoftAuthenticatorMethodsRequestBuilder.cs index b190d314da3..71779993b0f 100644 --- a/src/generated/Users/Item/Authentication/MicrosoftAuthenticatorMethods/MicrosoftAuthenticatorMethodsRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/MicrosoftAuthenticatorMethods/MicrosoftAuthenticatorMethodsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to microsoftAuthenticatorMethods for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get microsoftAuthenticatorMethods from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Authentication/WindowsHelloForBusinessMethods/Item/Device/DeviceRequestBuilder.cs b/src/generated/Users/Item/Authentication/WindowsHelloForBusinessMethods/Item/Device/DeviceRequestBuilder.cs index 77a74bbefbc..a60215ff0bf 100644 --- a/src/generated/Users/Item/Authentication/WindowsHelloForBusinessMethods/Item/Device/DeviceRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/WindowsHelloForBusinessMethods/Item/Device/DeviceRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The registered device on which this Windows Hello for Business key resides."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var windowsHelloForBusinessAuthenticationMethodIdOption = new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod"); + windowsHelloForBusinessAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(windowsHelloForBusinessAuthenticationMethodIdOption); command.Handler = CommandHandler.Create(async (userId, windowsHelloForBusinessAuthenticationMethodId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(windowsHelloForBusinessAuthenticationMethodId)) requestInfo.PathParameters.Add("windowsHelloForBusinessAuthenticationMethod_id", windowsHelloForBusinessAuthenticationMethodId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The registered device on which this Windows Hello for Business key resides."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, windowsHelloForBusinessAuthenticationMethodId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(windowsHelloForBusinessAuthenticationMethodId)) requestInfo.PathParameters.Add("windowsHelloForBusinessAuthenticationMethod_id", windowsHelloForBusinessAuthenticationMethodId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var windowsHelloForBusinessAuthenticationMethodIdOption = new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod"); + windowsHelloForBusinessAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(windowsHelloForBusinessAuthenticationMethodIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, windowsHelloForBusinessAuthenticationMethodId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The registered device on which this Windows Hello for Business key resides."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var windowsHelloForBusinessAuthenticationMethodIdOption = new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod"); + windowsHelloForBusinessAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(windowsHelloForBusinessAuthenticationMethodIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, windowsHelloForBusinessAuthenticationMethodId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(windowsHelloForBusinessAuthenticationMethodId)) requestInfo.PathParameters.Add("windowsHelloForBusinessAuthenticationMethod_id", windowsHelloForBusinessAuthenticationMethodId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Authentication/WindowsHelloForBusinessMethods/Item/WindowsHelloForBusinessAuthenticationMethodRequestBuilder.cs b/src/generated/Users/Item/Authentication/WindowsHelloForBusinessMethods/Item/WindowsHelloForBusinessAuthenticationMethodRequestBuilder.cs index bb7363335b6..c51c6da6a94 100644 --- a/src/generated/Users/Item/Authentication/WindowsHelloForBusinessMethods/Item/WindowsHelloForBusinessAuthenticationMethodRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/WindowsHelloForBusinessMethods/Item/WindowsHelloForBusinessAuthenticationMethodRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property windowsHelloForBusinessMethods for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var windowsHelloForBusinessAuthenticationMethodIdOption = new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod"); + windowsHelloForBusinessAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(windowsHelloForBusinessAuthenticationMethodIdOption); command.Handler = CommandHandler.Create(async (userId, windowsHelloForBusinessAuthenticationMethodId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(windowsHelloForBusinessAuthenticationMethodId)) requestInfo.PathParameters.Add("windowsHelloForBusinessAuthenticationMethod_id", windowsHelloForBusinessAuthenticationMethodId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get windowsHelloForBusinessMethods from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, windowsHelloForBusinessAuthenticationMethodId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(windowsHelloForBusinessAuthenticationMethodId)) requestInfo.PathParameters.Add("windowsHelloForBusinessAuthenticationMethod_id", windowsHelloForBusinessAuthenticationMethodId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var windowsHelloForBusinessAuthenticationMethodIdOption = new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod"); + windowsHelloForBusinessAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(windowsHelloForBusinessAuthenticationMethodIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, windowsHelloForBusinessAuthenticationMethodId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property windowsHelloForBusinessMethods in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var windowsHelloForBusinessAuthenticationMethodIdOption = new Option("--windowshelloforbusinessauthenticationmethod-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod"); + windowsHelloForBusinessAuthenticationMethodIdOption.IsRequired = true; + command.AddOption(windowsHelloForBusinessAuthenticationMethodIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, windowsHelloForBusinessAuthenticationMethodId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(windowsHelloForBusinessAuthenticationMethodId)) requestInfo.PathParameters.Add("windowsHelloForBusinessAuthenticationMethod_id", windowsHelloForBusinessAuthenticationMethodId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Authentication/WindowsHelloForBusinessMethods/WindowsHelloForBusinessMethodsRequestBuilder.cs b/src/generated/Users/Item/Authentication/WindowsHelloForBusinessMethods/WindowsHelloForBusinessMethodsRequestBuilder.cs index 11626ce3211..e14ee7f9e89 100644 --- a/src/generated/Users/Item/Authentication/WindowsHelloForBusinessMethods/WindowsHelloForBusinessMethodsRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/WindowsHelloForBusinessMethods/WindowsHelloForBusinessMethodsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to windowsHelloForBusinessMethods for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get windowsHelloForBusinessMethods from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Users/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 79e593d2a58..cb093015f2f 100644 --- a/src/generated/Users/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (userId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs index b3dd62a7384..f2f37bd772b 100644 --- a/src/generated/Users/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +66,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs index b15fa2a6368..547b9ccc953 100644 --- a/src/generated/Users/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); command.Handler = CommandHandler.Create(async (userId, calendarPermissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +48,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarPermissionId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarPermissionId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,16 +80,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarPermissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarRequestBuilder.cs index 81cf4f36772..f16f757aff9 100644 --- a/src/generated/Users/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarRequestBuilder.cs @@ -55,10 +55,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's primary calendar. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -79,12 +81,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's primary calendar. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -116,14 +123,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's primary calendar. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs index 0a6e1939e8a..1238b9ca464 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs @@ -50,14 +50,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,26 +80,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Delta/Delta.cs b/src/generated/Users/Item/Calendar/CalendarView/Delta/Delta.cs index eee5fc05112..504c1e8173d 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Delta/Delta.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.Calendar.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs index 601223ee86d..d47b32cf1e0 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs index d52722ce54c..0991ec87ac5 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs index 3f999fcf4aa..eb60c04e96c 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,26 +76,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index f8aa3e49759..5520d0679c2 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs index fcdf187ad22..b1db7c76709 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index fbcf0b77db1..423aeb46f2f 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (userId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Calendar/CalendarRequestBuilder.cs index 372453e168b..86a7558dedd 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Calendar/CalendarRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,14 +58,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,16 +96,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 2edf0fa6d5d..7ad622d48b3 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs index 09fa84f602a..82081e22c31 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs index 721300eebdf..a42bbfeacb1 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index 78ead64b8f4..d16cd9abd0e 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs index 6bbfd4d5940..8bf06490bea 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs @@ -74,12 +74,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -112,18 +115,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, startDateTime, endDateTime, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, startDateTime, endDateTime, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -156,16 +169,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs index ebc90be901b..5d66b3b114c 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +69,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs index 195a8c2e58b..a338e97a733 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs index f0749a3cc8a..c18e03ed7b5 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Delta/Delta.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Delta/Delta.cs index 4e7f408eb39..8b0e4fa84f5 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Delta/Delta.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.Calendar.CalendarView.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs index 1e74d5db452..8ff87d0b7af 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/InstancesRequestBuilder.cs index ef3fac7ceb5..aaf3d9adc44 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/InstancesRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index 2ee04fd8db7..19814a5039c 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index d10f2130286..5dd83460132 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index 934744756df..843796f7d04 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index 8acd3993cd8..5456ad350c9 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/EventRequestBuilder.cs index 7b178774767..a91353da6da 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index e54b0ea8f08..d8abe213ef4 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 0a6ab7850fc..a1cb66ceaf3 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index c35607de51b..f993c7fb007 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 2e432eab2cd..5f66b2cf496 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index fdc0869fbc7..2e009d7a27c 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 3615f496ac9..1096dfa91b2 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 2aedb7d42bf..a375a5244df 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index d6303b2168d..83b192d4a0d 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 1dc356a19e9..e147916fea3 100644 --- a/src/generated/Users/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Delta/Delta.cs b/src/generated/Users/Item/Calendar/Events/Delta/Delta.cs index 6497d41e89d..dc204d301f8 100644 --- a/src/generated/Users/Item/Calendar/Events/Delta/Delta.cs +++ b/src/generated/Users/Item/Calendar/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.Calendar.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs index f57898c8001..2018f05cc2e 100644 --- a/src/generated/Users/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/Events/EventsRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/EventsRequestBuilder.cs index e78ab659c16..b5e488c36bd 100644 --- a/src/generated/Users/Item/Calendar/Events/EventsRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/EventsRequestBuilder.cs @@ -50,14 +50,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,22 +80,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs index 750a2bf4533..9cb970adacb 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Attachments/AttachmentsRequestBuilder.cs index b4317af95a2..1bc064d2313 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,26 +76,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 8628771317f..48b7df1bdd5 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs index 02cfa45d417..5de3674331a 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index c4d2f079c81..98e9a70c44c 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (userId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Calendar/CalendarRequestBuilder.cs index 458705b9711..14ce821e3d8 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Calendar/CalendarRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,14 +58,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,16 +96,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index fc5aa818762..fd190a13584 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs index 1a32dd1f192..3ad420a379f 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs index ae0857dff9c..6d7df0106ec 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index aa3a6f67690..55a5985766c 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/EventRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/EventRequestBuilder.cs index 6be387679b1..034f81c1b2f 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/EventRequestBuilder.cs @@ -74,12 +74,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -112,14 +115,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -152,16 +161,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Extensions/ExtensionsRequestBuilder.cs index f71c2d01e90..83286531b15 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +69,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs index 496db9a9ef3..ff5dc396f64 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs index c5e4742d026..d8d636fc983 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Instances/Delta/Delta.cs b/src/generated/Users/Item/Calendar/Events/Item/Instances/Delta/Delta.cs index 126ec0434ed..6d666e6cb49 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Instances/Delta/Delta.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.Calendar.Events.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/Calendar/Events/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Instances/Delta/DeltaRequestBuilder.cs index f8059b4d583..ee854f8aa62 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Instances/InstancesRequestBuilder.cs index bb6f439b766..c441ad18c9f 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Instances/InstancesRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index 52f1ee693b2..0d360c03392 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index 552c1bdfebf..e214446f00c 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index d7925e14cc0..c24f4032e07 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index be1bc84445a..fef949d5f17 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/EventRequestBuilder.cs index 7d1739985ad..23cfb4b93fc 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index 99059e2f136..3d1d05dfca0 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index cdb5548bd85..7d6c328817a 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 463ec09ba33..ae9f201f8d6 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 08ab267388a..7208ef1795b 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 90952457a0a..36320fc5b59 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index c2a11e4109b..ac2aab24ab6 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index ad7f88705e6..356c72e1626 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 2d814b49744..9b28e8d0e82 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 76efc4bc370..486db8a5383 100644 --- a/src/generated/Users/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Users/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 8e012a7296a..83c806c651f 100644 --- a/src/generated/Users/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index d38a2b79559..d358d2c7a3d 100644 --- a/src/generated/Users/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index c2832888c86..58d7cb77ad3 100644 --- a/src/generated/Users/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index bafa7784952..e893e61be02 100644 --- a/src/generated/Users/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 9c8bca9f4f0..4a481b3d3a0 100644 --- a/src/generated/Users/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/CalendarGroupsRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/CalendarGroupsRequestBuilder.cs index 4f1c8def1fe..8306ca868db 100644 --- a/src/generated/Users/Item/CalendarGroups/CalendarGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/CalendarGroupsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The user's calendar groups. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,22 +67,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The user's calendar groups. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/CalendarGroupRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/CalendarGroupRequestBuilder.cs index 311390ddcb8..76e2a5615a6 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/CalendarGroupRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/CalendarGroupRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's calendar groups. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,14 +56,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's calendar groups. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,16 +88,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's calendar groups. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/CalendarsRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/CalendarsRequestBuilder.cs index 3bfd3f805c6..abfcb09e0c8 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/CalendarsRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/CalendarsRequestBuilder.cs @@ -42,16 +42,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendars in the calendar group. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,24 +75,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendars in the calendar group. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 52d9c13671c..7bbd102e746 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs index 1c6a0f2072f..051672dbe17 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +72,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs index 5ff73de7cc8..24711b58a06 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, calendarPermissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,18 +54,26 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, calendarPermissionId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, calendarPermissionId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,20 +92,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, calendarPermissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarRequestBuilder.cs index 5fb8673c298..d6f4ae29956 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarRequestBuilder.cs @@ -55,14 +55,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendars in the calendar group. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -83,16 +87,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendars in the calendar group. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -124,18 +135,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendars in the calendar group. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs index 9921f950b84..e7a09b46c22 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs @@ -50,18 +50,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,26 +86,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/Delta.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/Delta.cs index 73b886d1fe2..a5faf61f366 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/Delta.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.CalendarGroups.Item.Calendars.Item.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs index 757bce30a7a..42844b514f8 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs index 2480b7bcb74..9f8b7bcf17a 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs index 8ab176aa3e9..82b93d795e9 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,20 +37,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,30 +82,52 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 6526946ded0..eeb1b9dd725 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs index 9a50c002113..9c2e13b96b3 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index d9122a01fa0..7246702c6df 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs index 6a7b7f0bec9..82e45474058 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,18 +64,26 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +108,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 29539306279..97b44e4112b 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs index 4abc65487c8..6a357199844 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs index 0b73ad8842f..592bcd1df67 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index e79226551a2..d859492013f 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs index 8f4f7105538..8a6a6a6aaf9 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs @@ -74,16 +74,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -116,18 +121,26 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -160,20 +173,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs index 1b82af2c87f..711717731ca 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +75,52 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs index f89d416c3c2..3f7fdac9f12 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs index 6c9b36d26ea..5e125b391aa 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs index 682ff484607..ad34ca2ec29 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.CalendarGroups.Item.Calendars.Item.CalendarView.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs index dfd5904974b..29f0ee006d4 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs index 82919f06024..b748e43747e 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs @@ -44,20 +44,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,28 +83,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index 913bcfd142f..e795fc771ef 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index a199c3f56ee..bf8226dbddd 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index 407065d25d6..034fed2495e 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index 1bac18849b9..9e11f3b1e98 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs index 76d45c5d932..e0f163c0c18 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs @@ -51,18 +51,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -88,20 +94,29 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,22 +135,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index d653c2274ea..a4d99e18a31 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 6715a456b37..1788c55c0ab 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index c185ae94663..75cc16ef35c 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index c61d888c848..fb4e15da1a8 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index b4de0a1dc5c..57c8463a4af 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index d3dede22d23..109acff686e 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 77b4286dd90..01ed8626bb7 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index c27a241634f..15509ea4763 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 454abdc5d8a..53f9273b84c 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Delta/Delta.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Delta/Delta.cs index 1a2addc483d..9d6e6e5ac1b 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Delta/Delta.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.CalendarGroups.Item.Calendars.Item.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs index 623a3040b93..5faea5b5ad8 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/EventsRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/EventsRequestBuilder.cs index 6b0e2c033ce..c47e02bff04 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/EventsRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/EventsRequestBuilder.cs @@ -50,18 +50,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,26 +86,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs index f2f27f6f24d..73434fc0515 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs index 52b09714db6..ad049bebaaa 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,20 +37,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,30 +82,52 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index ef4b107c59c..23c0fb172d9 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs index 82fe529c8ce..5a7444de4cf 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 253fbbbf332..a1984b44ecd 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs index e26afe7fe5f..687492addeb 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,18 +64,26 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +108,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 676b78b45c8..bc4f52562bd 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs index 5197a7194ed..61e4d76c8f8 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs index 321297f8237..16044301a05 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index baa93e944b3..fd0218cce64 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/EventRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/EventRequestBuilder.cs index 9e8d31dc39a..4a76adc2964 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/EventRequestBuilder.cs @@ -74,16 +74,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -116,18 +121,26 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -160,20 +173,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs index d1b9f88f485..676f04b0ef4 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +75,52 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs index 5dd3a3fab02..ff755a8d28a 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs index 10e13facadc..91d4094c6a9 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/Delta.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/Delta.cs index 0d1e1a1eb81..10dad0c437f 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/Delta.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.CalendarGroups.Item.Calendars.Item.Events.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs index f3939e06b73..848af4f5c99 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs index f684dbfc116..4d53f58a490 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs @@ -44,20 +44,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,28 +83,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index c5b06d8b164..b327f0d532c 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index 626b47c9dab..3b8bdee3a6a 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index 82aa0be5517..f0d8513d8ea 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index e1ff7788f6f..a4eb0fdfff6 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs index b71c56310ab..c896b482fe0 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs @@ -51,18 +51,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -88,20 +94,29 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,22 +135,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index 57e4499ac62..af7d5bca25e 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 5a5474f642c..d16ad013b57 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index d17e470e1b1..3cb65f89206 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 0825ddf0204..f2a156829f2 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 0deb03c56b6..e136d7c3156 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index fcd9e1da616..57da786a6e8 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index e59b0b93b19..b8438d84585 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 4fa2b7289d6..4e7a00011c3 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 4c35b903723..c2d17f5157f 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs index c0bae8b0344..487b90de287 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index f558a5c5c88..d5c053339fb 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 7189a867a4b..26a485d7b52 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 559aed8b3cf..f782c54c088 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index efbb113586d..95531c5aafa 100644 --- a/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarGroups/Item/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendargroup-id", description: "key: id of calendarGroup")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarGroupId)) requestInfo.PathParameters.Add("calendarGroup_id", calendarGroupId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarGroupIdOption = new Option("--calendargroup-id", description: "key: id of calendarGroup"); + calendarGroupIdOption.IsRequired = true; + command.AddOption(calendarGroupIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarGroupId, calendarId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Users/Item/CalendarView/CalendarViewRequestBuilder.cs index 333b2ca9bd7..a6b7b0496e1 100644 --- a/src/generated/Users/Item/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/CalendarViewRequestBuilder.cs @@ -50,14 +50,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,26 +80,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Delta/Delta.cs b/src/generated/Users/Item/CalendarView/Delta/Delta.cs index 13ecae28bb6..55c310b7d19 100644 --- a/src/generated/Users/Item/CalendarView/Delta/Delta.cs +++ b/src/generated/Users/Item/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Delta/DeltaRequestBuilder.cs index 54e61966c46..6766acc513b 100644 --- a/src/generated/Users/Item/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs index b801b0f75c9..1fb940a4983 100644 --- a/src/generated/Users/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs index 8b4362878dd..cabc56df2a3 100644 --- a/src/generated/Users/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,26 +76,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 502abb93ad0..2951436830e 100644 --- a/src/generated/Users/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs index e9f3ddc4d40..4cce1f432dd 100644 --- a/src/generated/Users/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 9d56b22d064..5359c17aba5 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (userId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs index ef863d3ce92..42ec96bb226 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +69,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs index 673ddf8b1e5..ecb120f678d 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, calendarPermissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,16 +51,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, calendarPermissionId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, calendarPermissionId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,18 +86,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, calendarPermissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs index 0b815e940b5..25211b6ec55 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs @@ -55,12 +55,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -81,14 +84,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,16 +129,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs index 45e0b78f4c8..d79e85c013e 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Delta/Delta.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Delta/Delta.cs index 921f59a0c73..0f84fc23bbd 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Delta/Delta.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.CalendarView.Item.Calendar.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs index 03c8411d33e..770439b2773 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs index 4bbe12ad464..9b82e0ef668 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs index df13097eb03..a039e399306 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs index 0bb3c61c737..b144e4218de 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index e091d34bb51..102a1b8576e 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs index bcefd16fb6c..636b3ab804c 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs index fdc45310d5c..1709c7dec15 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 606324215e2..43a52980ae9 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 11990035086..a35803d298e 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Delta/Delta.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Delta/Delta.cs index e14c1ea2192..c2507bfc92b 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Delta/Delta.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.CalendarView.Item.Calendar.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs index 93153668dee..eb357c17ef3 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/EventsRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/EventsRequestBuilder.cs index f090258e00b..5f703ae3513 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/EventsRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/EventsRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs index d7c25546587..bf0beaf6b00 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs index 52c212de708..5c8aa46f98a 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs index f83f0606997..050bbe7f6a7 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index d3c1dcc65b4..f5796ee30ad 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/EventRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/EventRequestBuilder.cs index 56970f946b7..e945dd7cbfe 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs index fda83e095ff..06671caa94f 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index c5b57995d9e..7804d3dca63 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 0899072d33e..335e0b288cf 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index c439bc1aac4..42e3cc2af03 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 29620677c03..c47ffd686cb 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index cb7b4331a18..7cf06d019b3 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 703a2528b6c..7f9a9e22ebb 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index e0fc68113a9..e0373130920 100644 --- a/src/generated/Users/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs index d980c90e59a..22833182b6c 100644 --- a/src/generated/Users/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs index b79b13e93b4..bda540ec495 100644 --- a/src/generated/Users/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index d17febd7029..d3c270e9e27 100644 --- a/src/generated/Users/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/EventRequestBuilder.cs index 6eb6a400cd3..d4b6ab40aa3 100644 --- a/src/generated/Users/Item/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/EventRequestBuilder.cs @@ -79,12 +79,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -117,18 +120,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, startDateTime, endDateTime, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, startDateTime, endDateTime, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -161,16 +174,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs index 37f353d74bb..97cf4794807 100644 --- a/src/generated/Users/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +69,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs index 34763c23006..0ce59301754 100644 --- a/src/generated/Users/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs index 7e00552d0e1..bef3ea4213b 100644 --- a/src/generated/Users/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Instances/Delta/Delta.cs b/src/generated/Users/Item/CalendarView/Item/Instances/Delta/Delta.cs index 7538c964125..bef18abc022 100644 --- a/src/generated/Users/Item/CalendarView/Item/Instances/Delta/Delta.cs +++ b/src/generated/Users/Item/CalendarView/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.CalendarView.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs index 3ce6924b52e..a4444015f50 100644 --- a/src/generated/Users/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs index 5356d0187c5..19f9fba7a49 100644 --- a/src/generated/Users/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index 1a5cca8fb4b..8fe9b069dc2 100644 --- a/src/generated/Users/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index 76b73180a70..cd68e4d3556 100644 --- a/src/generated/Users/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index 2678f762b3d..0c17a290933 100644 --- a/src/generated/Users/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index 265e2522875..1f09dbdd1db 100644 --- a/src/generated/Users/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs index 1a62a61cb2f..2b59e119a48 100644 --- a/src/generated/Users/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index 54ed5c38d72..99d04480955 100644 --- a/src/generated/Users/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 8d7b97fcc28..b512c8bc3bd 100644 --- a/src/generated/Users/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 24014cf9b30..817d01aed05 100644 --- a/src/generated/Users/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 1034b8807a9..f6dfd8c8cbf 100644 --- a/src/generated/Users/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 2f92271860e..30bd40401e7 100644 --- a/src/generated/Users/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index e9b3662727e..ccf39de9c65 100644 --- a/src/generated/Users/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 53d5408d155..b1796e53625 100644 --- a/src/generated/Users/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 58db737b552..591a4149e30 100644 --- a/src/generated/Users/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index d86a3d7c572..c936ff3ce71 100644 --- a/src/generated/Users/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/CalendarsRequestBuilder.cs b/src/generated/Users/Item/Calendars/CalendarsRequestBuilder.cs index 41750ae6c5e..7587d8251b9 100644 --- a/src/generated/Users/Item/Calendars/CalendarsRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/CalendarsRequestBuilder.cs @@ -42,14 +42,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The user's calendars. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,22 +72,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The user's calendars. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index f8634dc6765..80980609784 100644 --- a/src/generated/Users/Item/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (userId, calendarId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs index e6b23d83ac6..3434cbcbda7 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarPermissions/CalendarPermissionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +69,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs index 3bfbb6cb961..c071e0316b6 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, calendarPermissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,16 +51,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarId, calendarPermissionId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, calendarPermissionId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,18 +86,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, calendarPermissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarRequestBuilder.cs index c0c51ae4cf3..b853c3c0af0 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarRequestBuilder.cs @@ -55,12 +55,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's calendars. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -81,14 +84,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's calendars. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,16 +129,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's calendars. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs index b5423908353..47bf0054903 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/CalendarViewRequestBuilder.cs @@ -50,16 +50,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,28 +83,49 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarId, startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, startDateTime, endDateTime, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Delta/Delta.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Delta/Delta.cs index 0074fd9e68c..389466ae132 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Delta/Delta.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.Calendars.Item.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs index 756f7fa547d..786f18596e1 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs index 6b75aa36b7d..3e32cfe6f92 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs index c1efc5f4534..6bd7415c6e7 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,18 +37,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,28 +79,49 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index e3274a361dc..5b2fafcff5b 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs index 92782e40d29..77d748d07df 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 57fbdb73d25..8d21c148306 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs index 3e0bfc87e30..0ebbeccb018 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Calendar/CalendarRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,16 +61,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +102,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 7767c8f7558..7d1ad8cf19e 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs index 4ee13310078..ee377cfc459 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs index f3db7aad935..f3bd4bb39d1 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index 324ee108985..0beabd3b0cb 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs index 4d051df9f7b..183219502dd 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/EventRequestBuilder.cs @@ -74,14 +74,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -114,20 +118,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00")); - command.AddOption(new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, startDateTime, endDateTime, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.QueryParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.QueryParameters.Add("endDateTime", endDateTime); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, startDateTime, endDateTime, select) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(startDateTime)) q.StartDateTime = startDateTime; + if (!String.IsNullOrEmpty(endDateTime)) q.EndDateTime = endDateTime; + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -160,18 +175,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs index d2acc9f2e74..d9f7c6fa742 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +72,49 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs index e602e12b1fa..f289721412b 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs index f02223cd05d..95c7c0a6145 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs index df323b17be7..910aa317a9b 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.Calendars.Item.CalendarView.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs index 2ab20aa90f6..cc03c70c49b 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs index 081c7377459..672546935ce 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/InstancesRequestBuilder.cs @@ -44,18 +44,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,26 +80,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index 0911d7d06c0..4937f982c6e 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index f1f6d854527..620873da770 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index cdb108f7014..6b68a998fdd 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index a157504e63a..3d9c9c775a6 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs index 69d543e7dc3..8e955d29bb0 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/EventRequestBuilder.cs @@ -51,16 +51,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -86,18 +91,26 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -116,20 +129,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index 8773cb07d47..667f23828e1 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 5c46942cb73..138f9ab117f 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 078e9efcde4..6110be9e471 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 53bb973e4b4..7891410ea46 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 63b124d6807..92e16b772ab 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 882358a61be..e09e34b5585 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 846ceb4da3e..23a509b7bc4 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index ebb3587ab81..6bfd8479ec7 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 56219f8d4af..675abc9dbcc 100644 --- a/src/generated/Users/Item/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Delta/Delta.cs b/src/generated/Users/Item/Calendars/Item/Events/Delta/Delta.cs index 7f0cff854f4..9b07b5714a5 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Delta/Delta.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.Calendars.Item.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs index 960e40b9716..7d54347c682 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/EventsRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/EventsRequestBuilder.cs index 23190ac7bb6..06e110f74a1 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/EventsRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/EventsRequestBuilder.cs @@ -50,16 +50,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,24 +83,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs index 91778a90cdd..075cf8f6a35 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs index 9ba8c901657..46c83c9b1ec 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,18 +37,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,28 +79,49 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index a592f48c105..f44ecf255c4 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs index 6eb6b546344..f767ce33589 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 37cb97c04a6..098660decc6 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs index c5e034150b5..86d68f4b5a8 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Calendar/CalendarRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,16 +61,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +102,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 04f7d8e55a8..88a4bbb8084 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs index 86271a9a9bb..e7df3f1df8d 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs index 0e7ffcb89bb..ac55ee7af06 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index 76cf8ac9f6d..2ea55f47866 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/EventRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/EventRequestBuilder.cs index 32a1b310f93..1d48d3aa368 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/EventRequestBuilder.cs @@ -74,14 +74,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -114,16 +118,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -156,18 +167,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs index 2a40e2d0a1c..08e1b820570 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +72,49 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs index e2958d67291..3eb7a198760 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs index 1d0190e520e..f35de55e6e5 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Delta/Delta.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Delta/Delta.cs index c51ae83a38a..4b2b43e0f60 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Delta/Delta.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.Calendars.Item.Events.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs index 4b823111820..7c123a020cf 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs index 1b0fcff8ff3..ec3fd827b79 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/InstancesRequestBuilder.cs @@ -44,18 +44,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,26 +80,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index c4cef563ae9..86a5655c29d 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index 24fc090bd66..2b04cdbbbf6 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index 79f74600a0f..442fed6aa14 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index 3bceee88650..0e17272ac1e 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs index d4baae2b83a..2324ba025d0 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/EventRequestBuilder.cs @@ -51,16 +51,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -86,18 +91,26 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -116,20 +129,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index ba1120245a1..fec2ef369fa 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 8726ee85768..c71aa25764c 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 9df2469a72b..16699c42034 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index a93a728959a..fb727f9ad61 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 4019c3db2f8..99ebb8160ea 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 54e5e1aa276..76ddfeb94d2 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index f231453d641..d5ae4169362 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 1decad4e32d..52b99631504 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 674f8de7b6f..2f96527294a 100644 --- a/src/generated/Users/Item/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs index 680986b5abd..ffeafc3ef35 100644 --- a/src/generated/Users/Item/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 33008da6f70..ffa61ab4eb1 100644 --- a/src/generated/Users/Item/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 950bae24858..00cc98bc83c 100644 --- a/src/generated/Users/Item/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index e1b3835b78c..fb1e56c1c26 100644 --- a/src/generated/Users/Item/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, calendarId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 8130ed05f8e..c1e3ea10698 100644 --- a/src/generated/Users/Item/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Calendars/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, calendarId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--calendar-id", description: "key: id of calendar")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, calendarId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(calendarId)) requestInfo.PathParameters.Add("calendar_id", calendarId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var calendarIdOption = new Option("--calendar-id", description: "key: id of calendar"); + calendarIdOption.IsRequired = true; + command.AddOption(calendarIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, calendarId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ChangePassword/ChangePasswordRequestBuilder.cs b/src/generated/Users/Item/ChangePassword/ChangePasswordRequestBuilder.cs index 26588997f71..38a523b62e1 100644 --- a/src/generated/Users/Item/ChangePassword/ChangePasswordRequestBuilder.cs +++ b/src/generated/Users/Item/ChangePassword/ChangePasswordRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action changePassword"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Chats/ChatsRequestBuilder.cs b/src/generated/Users/Item/Chats/ChatsRequestBuilder.cs index dcbb6af388b..fad968d7a5c 100644 --- a/src/generated/Users/Item/Chats/ChatsRequestBuilder.cs +++ b/src/generated/Users/Item/Chats/ChatsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to chats for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get chats from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Chats/Item/ChatRequestBuilder.cs b/src/generated/Users/Item/Chats/Item/ChatRequestBuilder.cs index 70f58343452..0359453035c 100644 --- a/src/generated/Users/Item/Chats/Item/ChatRequestBuilder.cs +++ b/src/generated/Users/Item/Chats/Item/ChatRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property chats for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--chat-id", description: "key: id of chat")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); command.Handler = CommandHandler.Create(async (userId, chatId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get chats from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, chatId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, chatId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property chats in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--chat-id", description: "key: id of chat")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var chatIdOption = new Option("--chat-id", description: "key: id of chat"); + chatIdOption.IsRequired = true; + command.AddOption(chatIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, chatId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(chatId)) requestInfo.PathParameters.Add("chat_id", chatId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs b/src/generated/Users/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs index fc28c803cb9..c966b7c2369 100644 --- a/src/generated/Users/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/CheckMemberGroups/CheckMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs b/src/generated/Users/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs index 83183ab00a8..057f6dcdcdf 100644 --- a/src/generated/Users/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs +++ b/src/generated/Users/Item/CheckMemberObjects/CheckMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ContactFolders/ContactFoldersRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/ContactFoldersRequestBuilder.cs index 1fe953cea1e..ec7a3e2b69e 100644 --- a/src/generated/Users/Item/ContactFolders/ContactFoldersRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/ContactFoldersRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The user's contacts folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +71,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The user's contacts folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ContactFolders/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Delta/DeltaRequestBuilder.cs index a3e2b4174c8..6840ec53013 100644 --- a/src/generated/Users/Item/ContactFolders/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ContactFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs index 83fb6e8aa42..e2aaec22f3d 100644 --- a/src/generated/Users/Item/ContactFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of child folders in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,26 +70,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of child folders in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ContactFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs index a63cd56d7e1..1c98bfef8ed 100644 --- a/src/generated/Users/Item/ContactFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ContactFolders/Item/ChildFolders/Item/ContactFolderRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/ChildFolders/Item/ContactFolderRequestBuilder.cs index f1f7d0ee4ff..50abba4cd04 100644 --- a/src/generated/Users/Item/ContactFolders/Item/ChildFolders/Item/ContactFolderRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/ChildFolders/Item/ContactFolderRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of child folders in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contactfolder-id1", description: "key: id of contactFolder")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactFolderId1Option = new Option("--contactfolder-id1", description: "key: id of contactFolder"); + contactFolderId1Option.IsRequired = true; + command.AddOption(contactFolderId1Option); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactFolderId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactFolderId1)) requestInfo.PathParameters.Add("contactFolder_id1", contactFolderId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of child folders in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contactfolder-id1", description: "key: id of contactFolder")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactFolderId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactFolderId1)) requestInfo.PathParameters.Add("contactFolder_id1", contactFolderId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactFolderId1Option = new Option("--contactfolder-id1", description: "key: id of contactFolder"); + contactFolderId1Option.IsRequired = true; + command.AddOption(contactFolderId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactFolderId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of child folders in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contactfolder-id1", description: "key: id of contactFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactFolderId1Option = new Option("--contactfolder-id1", description: "key: id of contactFolder"); + contactFolderId1Option.IsRequired = true; + command.AddOption(contactFolderId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactFolderId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactFolderId1)) requestInfo.PathParameters.Add("contactFolder_id1", contactFolderId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ContactFolders/Item/ContactFolderRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/ContactFolderRequestBuilder.cs index d38f67d67e4..89e0d7dbea8 100644 --- a/src/generated/Users/Item/ContactFolders/Item/ContactFolderRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/ContactFolderRequestBuilder.cs @@ -44,12 +44,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's contacts folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,14 +66,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's contacts folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,16 +105,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's contacts folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ContactFolders/Item/Contacts/ContactsRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/Contacts/ContactsRequestBuilder.cs index 5ade81bba35..10636cc9738 100644 --- a/src/generated/Users/Item/ContactFolders/Item/Contacts/ContactsRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/Contacts/ContactsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The contacts in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,26 +74,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The contacts in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ContactFolders/Item/Contacts/Delta/Delta.cs b/src/generated/Users/Item/ContactFolders/Item/Contacts/Delta/Delta.cs index 4bd66e7d006..6a0c9b10ebc 100644 --- a/src/generated/Users/Item/ContactFolders/Item/Contacts/Delta/Delta.cs +++ b/src/generated/Users/Item/ContactFolders/Item/Contacts/Delta/Delta.cs @@ -26,7 +26,7 @@ public class Delta : OutlookItem, IParsable { public string DisplayName { get; set; } /// The contact's email addresses. public List EmailAddresses { get; set; } - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. public List Extensions { get; set; } /// The name the contact is filed under. public string FileAs { get; set; } diff --git a/src/generated/Users/Item/ContactFolders/Item/Contacts/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/Contacts/Delta/DeltaRequestBuilder.cs index 846b2aeaf8a..89bc2e8d243 100644 --- a/src/generated/Users/Item/ContactFolders/Item/Contacts/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/Contacts/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/ContactRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/ContactRequestBuilder.cs index c7550f36c9d..27552e17c3a 100644 --- a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/ContactRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/ContactRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The contacts in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,18 +62,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The contacts in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,18 +109,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The contacts in the folder. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs index 447c1f63f0e..4b66b4dd822 100644 --- a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs @@ -30,24 +30,30 @@ public List BuildCommand() { return commands; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,34 +66,55 @@ public Command BuildCreateCommand() { return command; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -113,7 +140,7 @@ public ExtensionsRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Request headers /// Request options /// Request query parameters @@ -134,7 +161,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// /// Request headers /// Request options @@ -152,7 +179,7 @@ public RequestInformation CreatePostRequestInformation(Extension body, Action - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -164,7 +191,7 @@ public async Task GetAsync(Action q = de return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -176,7 +203,7 @@ public async Task PostAsync(Extension model, Action(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs index c5193989644..9b39b0b7a98 100644 --- a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -20,22 +20,27 @@ public class ExtensionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,26 +48,37 @@ public Command BuildDeleteCommand() { return command; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,26 +91,33 @@ public Command BuildGetCommand() { return command; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -115,7 +138,7 @@ public ExtensionRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Request headers /// Request options /// @@ -130,7 +153,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Request headers /// Request options /// Request query parameters @@ -151,7 +174,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// /// Request headers /// Request options @@ -169,7 +192,7 @@ public RequestInformation CreatePatchRequestInformation(Extension body, Action - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +203,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -192,7 +215,7 @@ public async Task GetAsync(Action q = default, Ac return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -204,7 +227,7 @@ public async Task PatchAsync(Extension model, Action var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 93b8bce4a72..2d539f8ff3c 100644 --- a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index cd79be2f9a1..3c0bfa4bd2a 100644 --- a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Photo/PhotoRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Photo/PhotoRequestBuilder.cs index 546f74abc14..046ff932534 100644 --- a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Photo/PhotoRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Photo/PhotoRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Optional contact picture. You can get or set a photo for a contact."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,16 +59,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Optional contact picture. You can get or set a photo for a contact."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,18 +94,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Optional contact picture. You can get or set a photo for a contact."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Photo/Value/ContentRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Photo/Value/ContentRequestBuilder.cs index 9a823a5db50..16cb4d56cf8 100644 --- a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Photo/Value/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/Photo/Value/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 8ae9f56b58d..58c978ffc9b 100644 --- a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index c9c53db228c..780125901b5 100644 --- a/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, contactId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ContactFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 16f7ce51e9b..f2795b7da75 100644 --- a/src/generated/Users/Item/ContactFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ContactFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 9589de3a914..797df672176 100644 --- a/src/generated/Users/Item/ContactFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ContactFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 2400a6bfc2f..5e5b3ad0f70 100644 --- a/src/generated/Users/Item/ContactFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ContactFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/ContactFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 09df25dd19d..2345ef96ff4 100644 --- a/src/generated/Users/Item/ContactFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/ContactFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the contactFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contactfolder-id", description: "key: id of contactFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactFolderId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactFolderId)) requestInfo.PathParameters.Add("contactFolder_id", contactFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactFolderIdOption = new Option("--contactfolder-id", description: "key: id of contactFolder"); + contactFolderIdOption.IsRequired = true; + command.AddOption(contactFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactFolderId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Contacts/ContactsRequestBuilder.cs b/src/generated/Users/Item/Contacts/ContactsRequestBuilder.cs index 2466dff02ce..7606a0b80b0 100644 --- a/src/generated/Users/Item/Contacts/ContactsRequestBuilder.cs +++ b/src/generated/Users/Item/Contacts/ContactsRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The user's contacts. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,24 +71,42 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The user's contacts. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Contacts/Delta/Delta.cs b/src/generated/Users/Item/Contacts/Delta/Delta.cs index 69e1619060d..f22dcc1e968 100644 --- a/src/generated/Users/Item/Contacts/Delta/Delta.cs +++ b/src/generated/Users/Item/Contacts/Delta/Delta.cs @@ -26,7 +26,7 @@ public class Delta : OutlookItem, IParsable { public string DisplayName { get; set; } /// The contact's email addresses. public List EmailAddresses { get; set; } - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. public List Extensions { get; set; } /// The name the contact is filed under. public string FileAs { get; set; } diff --git a/src/generated/Users/Item/Contacts/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Contacts/Delta/DeltaRequestBuilder.cs index 8cc5c4bf9fe..d1a551a49c9 100644 --- a/src/generated/Users/Item/Contacts/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Contacts/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Contacts/Item/ContactRequestBuilder.cs b/src/generated/Users/Item/Contacts/Item/ContactRequestBuilder.cs index 8afff69aaff..3226e7b19ad 100644 --- a/src/generated/Users/Item/Contacts/Item/ContactRequestBuilder.cs +++ b/src/generated/Users/Item/Contacts/Item/ContactRequestBuilder.cs @@ -30,12 +30,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's contacts. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); command.Handler = CommandHandler.Create(async (userId, contactId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,14 +59,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's contacts. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, contactId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, contactId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -89,16 +98,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's contacts. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs index baa90dedb85..e5460d36fb4 100644 --- a/src/generated/Users/Item/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/Contacts/Item/Extensions/ExtensionsRequestBuilder.cs @@ -30,22 +30,27 @@ public List BuildCommand() { return commands; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,32 +63,52 @@ public Command BuildCreateCommand() { return command; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,7 +134,7 @@ public ExtensionsRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Request headers /// Request options /// Request query parameters @@ -130,7 +155,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// /// Request headers /// Request options @@ -148,7 +173,7 @@ public RequestInformation CreatePostRequestInformation(Extension body, Action - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -160,7 +185,7 @@ public async Task GetAsync(Action q = de return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -172,7 +197,7 @@ public async Task PostAsync(Extension model, Action(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Users/Item/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs index 62c0be92bd1..5b6e8e7f73c 100644 --- a/src/generated/Users/Item/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/Contacts/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -20,20 +20,24 @@ public class ExtensionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, contactId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,24 +45,34 @@ public Command BuildDeleteCommand() { return command; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,24 +85,30 @@ public Command BuildGetCommand() { return command; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The collection of open extensions defined for the contact. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the contact. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -109,7 +129,7 @@ public ExtensionRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Request headers /// Request options /// @@ -124,7 +144,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Request headers /// Request options /// Request query parameters @@ -145,7 +165,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// /// Request headers /// Request options @@ -163,7 +183,7 @@ public RequestInformation CreatePatchRequestInformation(Extension body, Action - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +194,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -186,7 +206,7 @@ public async Task GetAsync(Action q = default, Ac return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -198,7 +218,7 @@ public async Task PatchAsync(Extension model, Action var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for the contact. Read-only. Nullable. + /// The collection of open extensions defined for the contact. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Users/Item/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 6c0946cd0be..cc030cf1329 100644 --- a/src/generated/Users/Item/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Contacts/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, contactId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index a27dc963755..f492c45aa03 100644 --- a/src/generated/Users/Item/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Contacts/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Contacts/Item/Photo/PhotoRequestBuilder.cs b/src/generated/Users/Item/Contacts/Item/Photo/PhotoRequestBuilder.cs index 6453bb4fb75..6433db5217f 100644 --- a/src/generated/Users/Item/Contacts/Item/Photo/PhotoRequestBuilder.cs +++ b/src/generated/Users/Item/Contacts/Item/Photo/PhotoRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Optional contact picture. You can get or set a photo for a contact."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); command.Handler = CommandHandler.Create(async (userId, contactId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,14 +56,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Optional contact picture. You can get or set a photo for a contact."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, contactId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, contactId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,16 +88,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Optional contact picture. You can get or set a photo for a contact."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Contacts/Item/Photo/Value/ContentRequestBuilder.cs b/src/generated/Users/Item/Contacts/Item/Photo/Value/ContentRequestBuilder.cs index 7de924240fa..f2a6b46614d 100644 --- a/src/generated/Users/Item/Contacts/Item/Photo/Value/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/Contacts/Item/Photo/Value/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, contactId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, contactId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 54347bb6442..1e80d06e7fd 100644 --- a/src/generated/Users/Item/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Contacts/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, contactId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 2f8fcffb806..92d87117fcf 100644 --- a/src/generated/Users/Item/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Contacts/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, contactId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the contact. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--contact-id", description: "key: id of contact")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, contactId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(contactId)) requestInfo.PathParameters.Add("contact_id", contactId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var contactIdOption = new Option("--contact-id", description: "key: id of contact"); + contactIdOption.IsRequired = true; + command.AddOption(contactIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, contactId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CreatedObjects/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/CreatedObjects/@Ref/RefRequestBuilder.cs index 39fa96a21ee..6c85167d369 100644 --- a/src/generated/Users/Item/CreatedObjects/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/CreatedObjects/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects that were created by the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Directory objects that were created by the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/CreatedObjects/CreatedObjectsRequestBuilder.cs b/src/generated/Users/Item/CreatedObjects/CreatedObjectsRequestBuilder.cs index 3a8e031b845..8e9f55f35a0 100644 --- a/src/generated/Users/Item/CreatedObjects/CreatedObjectsRequestBuilder.cs +++ b/src/generated/Users/Item/CreatedObjects/CreatedObjectsRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects that were created by the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/DeviceManagementTroubleshootingEvents/DeviceManagementTroubleshootingEventsRequestBuilder.cs b/src/generated/Users/Item/DeviceManagementTroubleshootingEvents/DeviceManagementTroubleshootingEventsRequestBuilder.cs index 8ab9186a379..75cd2da551b 100644 --- a/src/generated/Users/Item/DeviceManagementTroubleshootingEvents/DeviceManagementTroubleshootingEventsRequestBuilder.cs +++ b/src/generated/Users/Item/DeviceManagementTroubleshootingEvents/DeviceManagementTroubleshootingEventsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of troubleshooting events for this user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of troubleshooting events for this user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/DeviceManagementTroubleshootingEvents/Item/DeviceManagementTroubleshootingEventRequestBuilder.cs b/src/generated/Users/Item/DeviceManagementTroubleshootingEvents/Item/DeviceManagementTroubleshootingEventRequestBuilder.cs index 4b067e8f53b..2ea6fac9cea 100644 --- a/src/generated/Users/Item/DeviceManagementTroubleshootingEvents/Item/DeviceManagementTroubleshootingEventRequestBuilder.cs +++ b/src/generated/Users/Item/DeviceManagementTroubleshootingEvents/Item/DeviceManagementTroubleshootingEventRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of troubleshooting events for this user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var deviceManagementTroubleshootingEventIdOption = new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent"); + deviceManagementTroubleshootingEventIdOption.IsRequired = true; + command.AddOption(deviceManagementTroubleshootingEventIdOption); command.Handler = CommandHandler.Create(async (userId, deviceManagementTroubleshootingEventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(deviceManagementTroubleshootingEventId)) requestInfo.PathParameters.Add("deviceManagementTroubleshootingEvent_id", deviceManagementTroubleshootingEventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of troubleshooting events for this user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, deviceManagementTroubleshootingEventId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(deviceManagementTroubleshootingEventId)) requestInfo.PathParameters.Add("deviceManagementTroubleshootingEvent_id", deviceManagementTroubleshootingEventId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var deviceManagementTroubleshootingEventIdOption = new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent"); + deviceManagementTroubleshootingEventIdOption.IsRequired = true; + command.AddOption(deviceManagementTroubleshootingEventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, deviceManagementTroubleshootingEventId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of troubleshooting events for this user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var deviceManagementTroubleshootingEventIdOption = new Option("--devicemanagementtroubleshootingevent-id", description: "key: id of deviceManagementTroubleshootingEvent"); + deviceManagementTroubleshootingEventIdOption.IsRequired = true; + command.AddOption(deviceManagementTroubleshootingEventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, deviceManagementTroubleshootingEventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(deviceManagementTroubleshootingEventId)) requestInfo.PathParameters.Add("deviceManagementTroubleshootingEvent_id", deviceManagementTroubleshootingEventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/DirectReports/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/DirectReports/@Ref/RefRequestBuilder.cs index fb165580ef3..59516252ad2 100644 --- a/src/generated/Users/Item/DirectReports/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/DirectReports/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The users and contacts that report to the user. (The users and contacts that have their manager property set to this user.) Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "The users and contacts that report to the user. (The users and contacts that have their manager property set to this user.) Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/DirectReports/DirectReportsRequestBuilder.cs b/src/generated/Users/Item/DirectReports/DirectReportsRequestBuilder.cs index 98a178dab4b..b56b97a985f 100644 --- a/src/generated/Users/Item/DirectReports/DirectReportsRequestBuilder.cs +++ b/src/generated/Users/Item/DirectReports/DirectReportsRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The users and contacts that report to the user. (The users and contacts that have their manager property set to this user.) Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Drive/DriveRequestBuilder.cs b/src/generated/Users/Item/Drive/DriveRequestBuilder.cs index e230f783792..0e111dda3fa 100644 --- a/src/generated/Users/Item/Drive/DriveRequestBuilder.cs +++ b/src/generated/Users/Item/Drive/DriveRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's OneDrive. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's OneDrive. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's OneDrive. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Drives/DrivesRequestBuilder.cs b/src/generated/Users/Item/Drives/DrivesRequestBuilder.cs index 8d9d8220e25..b819fbdf7cd 100644 --- a/src/generated/Users/Item/Drives/DrivesRequestBuilder.cs +++ b/src/generated/Users/Item/Drives/DrivesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of drives available for this user. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of drives available for this user. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Drives/Item/DriveRequestBuilder.cs b/src/generated/Users/Item/Drives/Item/DriveRequestBuilder.cs index 3eb21262459..229ef536f9f 100644 --- a/src/generated/Users/Item/Drives/Item/DriveRequestBuilder.cs +++ b/src/generated/Users/Item/Drives/Item/DriveRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of drives available for this user. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--drive-id", description: "key: id of drive")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); command.Handler = CommandHandler.Create(async (userId, driveId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of drives available for this user. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, driveId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, driveId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of drives available for this user. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--drive-id", description: "key: id of drive")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var driveIdOption = new Option("--drive-id", description: "key: id of drive"); + driveIdOption.IsRequired = true; + command.AddOption(driveIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, driveId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(driveId)) requestInfo.PathParameters.Add("drive_id", driveId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Delta/Delta.cs b/src/generated/Users/Item/Events/Delta/Delta.cs index b42eba09b07..40e157c71f6 100644 --- a/src/generated/Users/Item/Events/Delta/Delta.cs +++ b/src/generated/Users/Item/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Events/Delta/DeltaRequestBuilder.cs index 57ce90b74c4..fe48abe79df 100644 --- a/src/generated/Users/Item/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/EventsRequestBuilder.cs b/src/generated/Users/Item/Events/EventsRequestBuilder.cs index a8edccc4199..6ca8d9a64ce 100644 --- a/src/generated/Users/Item/Events/EventsRequestBuilder.cs +++ b/src/generated/Users/Item/Events/EventsRequestBuilder.cs @@ -44,20 +44,24 @@ public List BuildCommand() { return commands; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable."; + command.Description = "The user's events. Default is to show events under the Default Calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,28 +74,44 @@ public Command BuildCreateCommand() { return command; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable."; + command.Description = "The user's events. Default is to show events under the Default Calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -117,7 +137,7 @@ public EventsRequestBuilder(Dictionary pathParameters, IRequestA RequestAdapter = requestAdapter; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -138,7 +158,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// /// Request headers /// Request options @@ -162,7 +182,7 @@ public DeltaRequestBuilder Delta() { return new DeltaRequestBuilder(PathParameters, RequestAdapter); } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -174,7 +194,7 @@ public async Task GetAsync(Action q = defaul return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -186,7 +206,7 @@ public async Task<@Event> PostAsync(@Event model, Action(requestInfo, responseHandler, cancellationToken); } - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Users/Item/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Accept/AcceptRequestBuilder.cs index 22b8e0eff8a..53f794ce3a8 100644 --- a/src/generated/Users/Item/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs index b592f6d08e1..bf48cbcfebb 100644 --- a/src/generated/Users/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,26 +76,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index a142988a8e3..0c99f3a8092 100644 --- a/src/generated/Users/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs index 26a4522d5c7..02ec3e61b62 100644 --- a/src/generated/Users/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs index 23fe9390fa5..8e155727dae 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/AllowedCalendarSharingRolesWithUser/AllowedCalendarSharingRolesWithUserRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function allowedCalendarSharingRoles"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--user", description: "Usage: User={User}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var UserOption = new Option("--user", description: "Usage: User={User}"); + UserOption.IsRequired = true; + command.AddOption(UserOption); command.Handler = CommandHandler.Create(async (userId, eventId, User) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(User)) requestInfo.PathParameters.Add("User", User); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs index 85584fa3ec4..2112d9b074d 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/CalendarPermissions/CalendarPermissionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +69,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs index 3a9b7d0fed4..71f3a0d12e6 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/CalendarPermissions/Item/CalendarPermissionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, calendarPermissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,16 +51,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, calendarPermissionId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, calendarPermissionId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,18 +86,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The permissions of the users with whom the calendar is shared."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--calendarpermission-id", description: "key: id of calendarPermission")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var calendarPermissionIdOption = new Option("--calendarpermission-id", description: "key: id of calendarPermission"); + calendarPermissionIdOption.IsRequired = true; + command.AddOption(calendarPermissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, calendarPermissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(calendarPermissionId)) requestInfo.PathParameters.Add("calendarPermission_id", calendarPermissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/CalendarRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/CalendarRequestBuilder.cs index 7b7f9e1f103..7d72260018a 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/CalendarRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/CalendarRequestBuilder.cs @@ -55,12 +55,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -81,14 +84,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,16 +129,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar that contains the event. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs index 3013c401a46..6e8975ad8e8 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/CalendarViewRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Delta/Delta.cs b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Delta/Delta.cs index c0f4bfecd51..a527edfe547 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Delta/Delta.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.Events.Item.Calendar.CalendarView.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs index 5023d9edf84..9f99c79ee5a 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs index 69cf4086226..6401639d908 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs index 112ba130b20..01bf744dffd 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs index d679cbe744b..f177a277314 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs index 7011a2a9980..d5e02dc0c2d 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs index 8abb591dc51..40a7e9dc6cb 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The calendar view for the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs index c88ecacf215..bb17103096b 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 3d01f70f4ed..e3685c86808 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index f093cd7275f..bbb211e7057 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/CalendarView/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/Events/Delta/Delta.cs b/src/generated/Users/Item/Events/Item/Calendar/Events/Delta/Delta.cs index 7844a5173f5..800feb067e7 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/Events/Delta/Delta.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/Events/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.Events.Item.Calendar.Events.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/Events/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs index 69327db14d1..8559a49e256 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/Events/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/Events/EventsRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/Events/EventsRequestBuilder.cs index 95ce911eff0..ed3d34a27f7 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/Events/EventsRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/Events/EventsRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs index bccf085911c..c3a3f1c213d 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs index b71008d4595..7f0cebbc850 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs index f2c794560bd..f8b34e9b127 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index 31bcee709b2..5f19e257987 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/EventRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/EventRequestBuilder.cs index c46f711701e..8903ed9af5c 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The events in the calendar. Navigation property. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs index d4b4286e431..f922ac0662a 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 33448e9770d..02f33ccb02c 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index b253a0af17a..4250b0f744c 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs index 818e81ccef7..b840b00eeca 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/GetSchedule/GetScheduleRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getSchedule"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index ad0279ac892..ed0fe902662 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 74665b329b3..9998004e478 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 740a4a1ebcf..b7c666112a6 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index ff7df37155f..fe7fca1b8ba 100644 --- a/src/generated/Users/Item/Events/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Calendar/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Cancel/CancelRequestBuilder.cs index b69a9cdbfe3..0cd762ff84e 100644 --- a/src/generated/Users/Item/Events/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Cancel/CancelRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Decline/DeclineRequestBuilder.cs index f684fc0fc38..6e757c7b209 100644 --- a/src/generated/Users/Item/Events/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs index 854a1f83fd9..6a24b5c6959 100644 --- a/src/generated/Users/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/EventRequestBuilder.cs b/src/generated/Users/Item/Events/Item/EventRequestBuilder.cs index 5404c54132c..5e7e3b47c9b 100644 --- a/src/generated/Users/Item/Events/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/EventRequestBuilder.cs @@ -73,18 +73,21 @@ public Command BuildDeclineCommand() { return command; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable."; + command.Description = "The user's events. Default is to show events under the Default Calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -111,20 +114,26 @@ public Command BuildForwardCommand() { return command; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable."; + command.Description = "The user's events. Default is to show events under the Default Calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -151,22 +160,27 @@ public Command BuildMultiValueExtendedPropertiesCommand() { return command; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable."; + command.Description = "The user's events. Default is to show events under the Default Calendar. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -206,7 +220,7 @@ public EventRequestBuilder(Dictionary pathParameters, IRequestAd RequestAdapter = requestAdapter; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Request headers /// Request options /// @@ -221,7 +235,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -242,7 +256,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// /// Request headers /// Request options @@ -260,7 +274,7 @@ public RequestInformation CreatePatchRequestInformation(@Event body, Action - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -271,7 +285,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -283,7 +297,7 @@ public async Task<@Event> GetAsync(Action q = default, Actio return await RequestAdapter.SendAsync<@Event>(requestInfo, responseHandler, cancellationToken); } /// - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -295,7 +309,7 @@ public async Task PatchAsync(@Event model, Action> h var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// The user's events. Default is to show Events under the Default Calendar. Read-only. Nullable. + /// The user's events. Default is to show events under the Default Calendar. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Select properties to be returned public string[] Select { get; set; } diff --git a/src/generated/Users/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs index 4f9d6a2b57c..f49be694fa0 100644 --- a/src/generated/Users/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +69,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs index a2a57812ce7..632254ce60f 100644 --- a/src/generated/Users/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the event. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Forward/ForwardRequestBuilder.cs index 230e50c047b..242577b3c63 100644 --- a/src/generated/Users/Item/Events/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Instances/Delta/Delta.cs b/src/generated/Users/Item/Events/Item/Instances/Delta/Delta.cs index 13ed1524d14..76b701a844a 100644 --- a/src/generated/Users/Item/Events/Item/Instances/Delta/Delta.cs +++ b/src/generated/Users/Item/Events/Item/Instances/Delta/Delta.cs @@ -6,7 +6,7 @@ using System.Linq; namespace ApiSdk.Users.Item.Events.Item.Instances.Delta { public class Delta : OutlookItem, IParsable { - /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise, false. Optional. Default is true. + /// true if the meeting organizer allows invitees to propose a new time when responding; otherwise false. Optional. Default is true. public bool? AllowNewTimeProposals { get; set; } /// The collection of FileAttachment, ItemAttachment, and referenceAttachment attachments for the event. Navigation property. Read-only. Nullable. public List Attachments { get; set; } diff --git a/src/generated/Users/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs index 371960e1ad4..d43fe372087 100644 --- a/src/generated/Users/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Instances/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); command.Handler = CommandHandler.Create(async (userId, eventId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/Instances/InstancesRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Instances/InstancesRequestBuilder.cs index 726cfc908c2..5cdff382651 100644 --- a/src/generated/Users/Item/Events/Item/Instances/InstancesRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Instances/InstancesRequestBuilder.cs @@ -44,16 +44,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +77,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs index c785c0bb64d..88c836033dd 100644 --- a/src/generated/Users/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Instances/Item/Accept/AcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs index 5c4bc5c846d..5a2357bc661 100644 --- a/src/generated/Users/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Instances/Item/Cancel/CancelRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs index 6f559f80909..8d714add14d 100644 --- a/src/generated/Users/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Instances/Item/Decline/DeclineRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs index f32baaa116a..8ca219618a1 100644 --- a/src/generated/Users/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Instances/Item/DismissReminder/DismissReminderRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dismissReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Instances/Item/EventRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Instances/Item/EventRequestBuilder.cs index 73629d1cbc8..e2fdc802b0b 100644 --- a/src/generated/Users/Item/Events/Item/Instances/Item/EventRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Instances/Item/EventRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -84,16 +88,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync<@Event>(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue<@Event>(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs index e64308ca5ae..b85e617d16a 100644 --- a/src/generated/Users/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Instances/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index e29563dddff..7a3e017737f 100644 --- a/src/generated/Users/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Instances/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 209579d0d46..99b273a41ef 100644 --- a/src/generated/Users/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/Instances/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--event-id1", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var eventId1Option = new Option("--event-id1", description: "key: id of event"); + eventId1Option.IsRequired = true; + command.AddOption(eventId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, eventId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(eventId1)) requestInfo.PathParameters.Add("event_id1", eventId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 26df3ffb480..6e1225ee9ff 100644 --- a/src/generated/Users/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index c5c66708e5e..9f5bcc9b003 100644 --- a/src/generated/Users/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 21dfde98cac..3739e09b5f3 100644 --- a/src/generated/Users/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 61f7c0cacf9..415a8c6dafd 100644 --- a/src/generated/Users/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the event. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, eventId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs b/src/generated/Users/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs index 952ca35b20e..28a7161becb 100644 --- a/src/generated/Users/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/SnoozeReminder/SnoozeReminderRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action snoozeReminder"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs b/src/generated/Users/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs index 7d8ed31d101..7f5fef884a9 100644 --- a/src/generated/Users/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Events/Item/TentativelyAccept/TentativelyAcceptRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tentativelyAccept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--event-id", description: "key: id of event")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var eventIdOption = new Option("--event-id", description: "key: id of event"); + eventIdOption.IsRequired = true; + command.AddOption(eventIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, eventId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(eventId)) requestInfo.PathParameters.Add("event_id", eventId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ExportPersonalData/ExportPersonalDataRequestBuilder.cs b/src/generated/Users/Item/ExportPersonalData/ExportPersonalDataRequestBuilder.cs index 06179497972..c75fd6c22ee 100644 --- a/src/generated/Users/Item/ExportPersonalData/ExportPersonalDataRequestBuilder.cs +++ b/src/generated/Users/Item/ExportPersonalData/ExportPersonalDataRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action exportPersonalData"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/Extensions/ExtensionsRequestBuilder.cs index 4f8c5fa26ca..f6566e223ad 100644 --- a/src/generated/Users/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/Extensions/ExtensionsRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The collection of open extensions defined for the user. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the user. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,32 +60,53 @@ public Command BuildCreateCommand() { return command; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The collection of open extensions defined for the user. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the user. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -107,7 +132,7 @@ public ExtensionsRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Request headers /// Request options /// Request query parameters @@ -128,7 +153,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// /// Request headers /// Request options @@ -146,7 +171,7 @@ public RequestInformation CreatePostRequestInformation(Extension body, Action - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -158,7 +183,7 @@ public async Task GetAsync(Action q = de return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -170,7 +195,7 @@ public async Task PostAsync(Extension model, Action(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Users/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/Extensions/Item/ExtensionRequestBuilder.cs index 6fc8029fc6a..7215e3483f8 100644 --- a/src/generated/Users/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -20,18 +20,21 @@ public class ExtensionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The collection of open extensions defined for the user. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the user. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The collection of open extensions defined for the user. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the user. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The collection of open extensions defined for the user. Read-only. Nullable."; + command.Description = "The collection of open extensions defined for the user. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public ExtensionRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(Extension body, Action - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = default, Ac return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(Extension model, Action var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// The collection of open extensions defined for the user. Read-only. Nullable. + /// The collection of open extensions defined for the user. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Users/Item/FindMeetingTimes/FindMeetingTimesRequestBuilder.cs b/src/generated/Users/Item/FindMeetingTimes/FindMeetingTimesRequestBuilder.cs index f183334335c..d56aed6044d 100644 --- a/src/generated/Users/Item/FindMeetingTimes/FindMeetingTimesRequestBuilder.cs +++ b/src/generated/Users/Item/FindMeetingTimes/FindMeetingTimesRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action findMeetingTimes"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/FollowedSites/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/FollowedSites/@Ref/RefRequestBuilder.cs index d6c2f145192..0fc9adbe222 100644 --- a/src/generated/Users/Item/FollowedSites/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/FollowedSites/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of followedSites from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Create new navigation property ref to followedSites for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/FollowedSites/FollowedSitesRequestBuilder.cs b/src/generated/Users/Item/FollowedSites/FollowedSitesRequestBuilder.cs index 099b09825d6..47617111c66 100644 --- a/src/generated/Users/Item/FollowedSites/FollowedSitesRequestBuilder.cs +++ b/src/generated/Users/Item/FollowedSites/FollowedSitesRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get followedSites from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/GetMailTips/GetMailTipsRequestBuilder.cs b/src/generated/Users/Item/GetMailTips/GetMailTipsRequestBuilder.cs index 621ba2e7730..9f5f3300100 100644 --- a/src/generated/Users/Item/GetMailTips/GetMailTipsRequestBuilder.cs +++ b/src/generated/Users/Item/GetMailTips/GetMailTipsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMailTips"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/GetManagedAppDiagnosticStatuses/GetManagedAppDiagnosticStatusesRequestBuilder.cs b/src/generated/Users/Item/GetManagedAppDiagnosticStatuses/GetManagedAppDiagnosticStatusesRequestBuilder.cs index 16530c02d19..f4d8da1c34d 100644 --- a/src/generated/Users/Item/GetManagedAppDiagnosticStatuses/GetManagedAppDiagnosticStatusesRequestBuilder.cs +++ b/src/generated/Users/Item/GetManagedAppDiagnosticStatuses/GetManagedAppDiagnosticStatusesRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Gets diagnostics validation status for a given user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/GetManagedAppPolicies/GetManagedAppPoliciesRequestBuilder.cs b/src/generated/Users/Item/GetManagedAppPolicies/GetManagedAppPoliciesRequestBuilder.cs index 951c5f20234..aca141db91c 100644 --- a/src/generated/Users/Item/GetManagedAppPolicies/GetManagedAppPoliciesRequestBuilder.cs +++ b/src/generated/Users/Item/GetManagedAppPolicies/GetManagedAppPoliciesRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Gets app restrictions for a given user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs b/src/generated/Users/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs index 4b3fc02042a..a707e110636 100644 --- a/src/generated/Users/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/GetMemberGroups/GetMemberGroupsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberGroups"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs b/src/generated/Users/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs index ea4c37edf5b..a92514b7e79 100644 --- a/src/generated/Users/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs +++ b/src/generated/Users/Item/GetMemberObjects/GetMemberObjectsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getMemberObjects"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/InferenceClassification/InferenceClassificationRequestBuilder.cs b/src/generated/Users/Item/InferenceClassification/InferenceClassificationRequestBuilder.cs index e1c83e5e8bd..64e42393649 100644 --- a/src/generated/Users/Item/InferenceClassification/InferenceClassificationRequestBuilder.cs +++ b/src/generated/Users/Item/InferenceClassification/InferenceClassificationRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +46,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,14 +82,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/InferenceClassification/Overrides/Item/InferenceClassificationOverrideRequestBuilder.cs b/src/generated/Users/Item/InferenceClassification/Overrides/Item/InferenceClassificationOverrideRequestBuilder.cs index de2b77fc509..dde8a7f0880 100644 --- a/src/generated/Users/Item/InferenceClassification/Overrides/Item/InferenceClassificationOverrideRequestBuilder.cs +++ b/src/generated/Users/Item/InferenceClassification/Overrides/Item/InferenceClassificationOverrideRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--inferenceclassificationoverride-id", description: "key: id of inferenceClassificationOverride")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var inferenceClassificationOverrideIdOption = new Option("--inferenceclassificationoverride-id", description: "key: id of inferenceClassificationOverride"); + inferenceClassificationOverrideIdOption.IsRequired = true; + command.AddOption(inferenceClassificationOverrideIdOption); command.Handler = CommandHandler.Create(async (userId, inferenceClassificationOverrideId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(inferenceClassificationOverrideId)) requestInfo.PathParameters.Add("inferenceClassificationOverride_id", inferenceClassificationOverrideId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +48,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--inferenceclassificationoverride-id", description: "key: id of inferenceClassificationOverride")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, inferenceClassificationOverrideId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(inferenceClassificationOverrideId)) requestInfo.PathParameters.Add("inferenceClassificationOverride_id", inferenceClassificationOverrideId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var inferenceClassificationOverrideIdOption = new Option("--inferenceclassificationoverride-id", description: "key: id of inferenceClassificationOverride"); + inferenceClassificationOverrideIdOption.IsRequired = true; + command.AddOption(inferenceClassificationOverrideIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, inferenceClassificationOverrideId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,16 +80,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--inferenceclassificationoverride-id", description: "key: id of inferenceClassificationOverride")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var inferenceClassificationOverrideIdOption = new Option("--inferenceclassificationoverride-id", description: "key: id of inferenceClassificationOverride"); + inferenceClassificationOverrideIdOption.IsRequired = true; + command.AddOption(inferenceClassificationOverrideIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, inferenceClassificationOverrideId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(inferenceClassificationOverrideId)) requestInfo.PathParameters.Add("inferenceClassificationOverride_id", inferenceClassificationOverrideId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/InferenceClassification/Overrides/OverridesRequestBuilder.cs b/src/generated/Users/Item/InferenceClassification/Overrides/OverridesRequestBuilder.cs index 2d0e9b6294e..11b6ef1dad0 100644 --- a/src/generated/Users/Item/InferenceClassification/Overrides/OverridesRequestBuilder.cs +++ b/src/generated/Users/Item/InferenceClassification/Overrides/OverridesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +66,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/InsightsRequestBuilder.cs b/src/generated/Users/Item/Insights/InsightsRequestBuilder.cs index b27fbf927d7..9ed6a8d3760 100644 --- a/src/generated/Users/Item/Insights/InsightsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/InsightsRequestBuilder.cs @@ -29,10 +29,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,14 +48,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,14 +82,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/@Ref/RefRequestBuilder.cs index cc9b629fd6e..0beb06eb2bf 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete ref of navigation property lastSharedMethod for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of lastSharedMethod from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update the ref of navigation property lastSharedMethod in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs index 3be81ff1e35..9bf30b8a9e6 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/LastSharedMethodRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/LastSharedMethodRequestBuilder.cs index 79958b03a92..36b87a9add0 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/LastSharedMethodRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/LastSharedMethodRequestBuilder.cs @@ -46,16 +46,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get lastSharedMethod from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sharedInsightId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sharedInsightId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index c7f204cb0fc..ce92a7d8037 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/Commit/CommitRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/Commit/CommitRequestBuilder.cs index 0cb679bf2e5..a281b48f17e 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/Commit/CommitRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/Commit/CommitRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Commits a file of a given app."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs index 8c3fa1dac65..306a767d5a2 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Renews the SAS URI for an application file upload."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 23946101bb0..38c7544d719 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Abort/AbortRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Abort/AbortRequestBuilder.cs index 3fbb1f2d5e6..8f38d759479 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Abort/AbortRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Abort/AbortRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action abort"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Cancel/CancelRequestBuilder.cs index 8179b46be55..aecc3f92cda 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Cancel/CancelRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Redirect/RedirectRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Redirect/RedirectRequestBuilder.cs index 55b8b083803..6f608ff139f 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Redirect/RedirectRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Redirect/RedirectRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action redirect"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Start/StartRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Start/StartRequestBuilder.cs index 140ce16a673..424cdb1c541 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Start/StartRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/PrintJob/Start/StartRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action start"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs index 66cd8a731da..b76eed48705 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action approve"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs index 0c5ad4cbcc8..63aa03bd19c 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs index 65b5d128e0c..e5db255c881 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index 50bf774968b..c020200682e 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WindowsInformationProtection/Assign/AssignRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WindowsInformationProtection/Assign/AssignRequestBuilder.cs index ca60325e403..79e31cd4b2e 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WindowsInformationProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WindowsInformationProtection/Assign/AssignRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs index f352d8344b1..6adb257d626 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function boundingRect"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index 5c1af8c84ba..ae13d4f2617 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Clear/ClearRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Clear/ClearRequestBuilder.cs index 134cdd69a13..0ecbe82d15b 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Clear/ClearRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Clear/ClearRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs index 663e71466b7..cd78eb6bdd8 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function column"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs index 9c95e9c32fa..490deb832fb 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs index 4216cde7cba..e904a205d04 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs index dada9c22e4a..d8fb3bb1d98 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs index 8d617a1962c..eca6e7876f7 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Delete/DeleteRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Delete/DeleteRequestBuilder.cs index 953db209409..1bae86d69d0 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Delete/DeleteRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Delete/DeleteRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action delete"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs index 4628ec9edce..84ea013dd4b 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireColumn"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs index a98085f554b..f1006e0f2e8 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireRow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Insert/InsertRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Insert/InsertRequestBuilder.cs index 33bf039fe4c..8110f50cfb3 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Insert/InsertRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Insert/InsertRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action insert"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs index bd39a517a9f..4ea24d02598 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function intersection"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastCell/LastCellRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastCell/LastCellRequestBuilder.cs index 7d25b9a2e15..981eeac9085 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastCell/LastCellRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastCell/LastCellRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastCell"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs index 66501eac9d5..091d404aa34 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastColumn"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastRow/LastRowRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastRow/LastRowRequestBuilder.cs index 1699eb56aa0..88b92e89e33 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastRow/LastRowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/LastRow/LastRowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastRow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Merge/MergeRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Merge/MergeRequestBuilder.cs index 510f7eb9659..f12f14255ac 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Merge/MergeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Merge/MergeRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action merge"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs index 96f2b451529..7bf8c75c239 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function offsetRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}")); - command.AddOption(new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var rowOffsetOption = new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}"); + rowOffsetOption.IsRequired = true; + command.AddOption(rowOffsetOption); + var columnOffsetOption = new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}"); + columnOffsetOption.IsRequired = true; + command.AddOption(columnOffsetOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, rowOffset, columnOffset) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("rowOffset", rowOffset); - requestInfo.PathParameters.Add("columnOffset", columnOffset); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs index c14a7b667d3..4c09bfbc3b6 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function resizedRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--deltarows", description: "Usage: deltaRows={deltaRows}")); - command.AddOption(new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var deltaRowsOption = new Option("--deltarows", description: "Usage: deltaRows={deltaRows}"); + deltaRowsOption.IsRequired = true; + command.AddOption(deltaRowsOption); + var deltaColumnsOption = new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}"); + deltaColumnsOption.IsRequired = true; + command.AddOption(deltaColumnsOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, deltaRows, deltaColumns) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("deltaRows", deltaRows); - requestInfo.PathParameters.Add("deltaColumns", deltaColumns); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs index 545b5abd4f8..e61841f77dd 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function row"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, row) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("row", row); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs index a7eb4de589c..3b88d5e30bb 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs index 381848ff57c..490c638889a 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs index bc197851ed0..addcd1bcf56 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs index d50248ef61e..28e4fcdcd68 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs index aa8d7672373..6a2544b66f2 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unmerge"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs index 428a1e3ab96..04e2b14251e 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 4ce699dd4bb..de6c3a3f03f 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs index 250cf8d2f29..d1165db255f 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function visibleView"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFill/Clear/ClearRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFill/Clear/ClearRequestBuilder.cs index d4c38f66b28..eaec240b08c 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFill/Clear/ClearRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs index 8013968047b..18ca685678d 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitColumns"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs index 018466fbd17..fe508d024a7 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitRows"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs index 1bb30dc36a4..d703f25adee 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action apply"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeView/Range/RangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeView/Range/RangeRequestBuilder.cs index 804a9a2cb9a..d9803826fe4 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeView/Range/RangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/LastSharedMethod/WorkbookRangeView/Range/RangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/@Ref/RefRequestBuilder.cs index 8da42cad1df..06756cfb692 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Used for navigating to the item that was shared. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used for navigating to the item that was shared. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Used for navigating to the item that was shared. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs index 23f87c8d86b..af13ee2eb35 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index cfeb99787bc..d357ba8a6cd 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs index 733538ffc2d..055b6d20e69 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Commits a file of a given app."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs index fceff644c50..0f20e73dc1a 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Renews the SAS URI for an application file upload."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 44f292baded..785c185983b 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs index 02698056429..50f6b4b8924 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action abort"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs index 5c46b715fa4..df36522d39d 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs index 1e2bdca07fa..8635e0445d3 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action redirect"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Start/StartRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Start/StartRequestBuilder.cs index 1cd6cb86cee..37807b7f7dc 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Start/StartRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/PrintJob/Start/StartRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action start"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/ResourceRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/ResourceRequestBuilder.cs index c321e852c64..379c6754536 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/ResourceRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/ResourceRequestBuilder.cs @@ -46,16 +46,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used for navigating to the item that was shared. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sharedInsightId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sharedInsightId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs index 8284a1839f0..71d0fc0c1ea 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action approve"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs index 6df54f29957..5d0c89cc86f 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs index d667a9091e2..0243a00756a 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index 546e33912eb..ef4aaf72939 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs index 8e3504cc587..159e70a3fca 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs index 93497f709ef..1cc5a42f0dc 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function boundingRect"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index 8f66349e79d..079a61e3180 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs index bdf92c7f739..c0317f06565 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs index 7be334b28bc..17b5a2b38e4 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function column"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs index 66e2b68aff2..90c4747383f 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs index f1288fdf1b9..f5034848b86 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs index de438694196..d9158a5d3d8 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs index ef0053e8f3c..5a9dc50ae22 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs index 8a1c3025597..75c89b6a8a5 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action delete"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs index 9bef1685caf..80751330236 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireColumn"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs index c6dfd39fd48..d54f99632ff 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireRow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs index 0dc6bcd3645..64e9092129c 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action insert"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs index 6a5c2292a32..2f0f5b69b81 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function intersection"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs index ec6861f998d..aa267bc2daa 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastCell"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs index 23f63f1a308..c676915fab7 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastColumn"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs index 70d2b7eee74..eb6c4eeec7a 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastRow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs index 310d7a20e7a..18f5a715c44 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action merge"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs index e9f33c86ad7..f5e2b63a2e9 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function offsetRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}")); - command.AddOption(new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var rowOffsetOption = new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}"); + rowOffsetOption.IsRequired = true; + command.AddOption(rowOffsetOption); + var columnOffsetOption = new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}"); + columnOffsetOption.IsRequired = true; + command.AddOption(columnOffsetOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, rowOffset, columnOffset) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("rowOffset", rowOffset); - requestInfo.PathParameters.Add("columnOffset", columnOffset); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs index 7d12052ff36..cce6c3ac1a9 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function resizedRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--deltarows", description: "Usage: deltaRows={deltaRows}")); - command.AddOption(new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var deltaRowsOption = new Option("--deltarows", description: "Usage: deltaRows={deltaRows}"); + deltaRowsOption.IsRequired = true; + command.AddOption(deltaRowsOption); + var deltaColumnsOption = new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}"); + deltaColumnsOption.IsRequired = true; + command.AddOption(deltaColumnsOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, deltaRows, deltaColumns) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("deltaRows", deltaRows); - requestInfo.PathParameters.Add("deltaColumns", deltaColumns); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs index 329851fd88f..4f03cc41be9 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function row"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, row) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("row", row); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs index 6cbdbc77304..c734cf2cbb2 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs index 9aeae742c26..d43d4516bd3 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs index ccf39a93559..0c5e077f71a 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs index 875ffae7709..bbb6f9e7fe4 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs index c4b19b9b9a9..632a5dade58 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unmerge"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs index 979e62d5ef9..d94af72034a 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index a07b13dc7e1..6f5f6912162 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs index 4d0fad8f790..b74d7510214 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function visibleView"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs index 90711ff7568..4c6d398cfc7 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs index 6dcd84a84bf..624f8d853d4 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitColumns"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs index 51cf30c85c7..04b707efe8d 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitRows"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs index a5f482a643c..6da02d9f5db 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action apply"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs index 611e4735b18..ab9c7b04b95 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Shared/Item/SharedInsightRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/Item/SharedInsightRequestBuilder.cs index f4f03b98984..59ee0ac38c2 100644 --- a/src/generated/Users/Item/Insights/Shared/Item/SharedInsightRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/Item/SharedInsightRequestBuilder.cs @@ -22,18 +22,21 @@ public class SharedInsightRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,22 +44,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sharedInsightId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sharedInsightId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -89,22 +101,27 @@ public Command BuildLastSharedMethodCommand() { return command; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sharedinsight-id", description: "key: id of sharedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sharedInsightIdOption = new Option("--sharedinsight-id", description: "key: id of sharedInsight"); + sharedInsightIdOption.IsRequired = true; + command.AddOption(sharedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sharedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sharedInsightId)) requestInfo.PathParameters.Add("sharedInsight_id", sharedInsightId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -145,7 +162,7 @@ public SharedInsightRequestBuilder(Dictionary pathParameters, IR RequestAdapter = requestAdapter; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// @@ -160,7 +177,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// Request query parameters @@ -181,7 +198,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// /// Request headers /// Request options @@ -199,7 +216,7 @@ public RequestInformation CreatePatchRequestInformation(SharedInsight body, Acti return requestInfo; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -210,7 +227,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -222,7 +239,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -234,7 +251,7 @@ public async Task PatchAsync(SharedInsight model, ActionCalculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Users/Item/Insights/Shared/SharedRequestBuilder.cs b/src/generated/Users/Item/Insights/Shared/SharedRequestBuilder.cs index b41ef3d3872..64d27dcb60f 100644 --- a/src/generated/Users/Item/Insights/Shared/SharedRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Shared/SharedRequestBuilder.cs @@ -32,20 +32,24 @@ public List BuildCommand() { return commands; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -58,32 +62,53 @@ public Command BuildCreateCommand() { return command; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,7 +134,7 @@ public SharedRequestBuilder(Dictionary pathParameters, IRequestA RequestAdapter = requestAdapter; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// Request query parameters @@ -130,7 +155,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// /// Request headers /// Request options @@ -148,7 +173,7 @@ public RequestInformation CreatePostRequestInformation(SharedInsight body, Actio return requestInfo; } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -160,7 +185,7 @@ public async Task GetAsync(Action q = defaul return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -172,7 +197,7 @@ public async Task PostAsync(SharedInsight model, Action(requestInfo, responseHandler, cancellationToken); } - /// Calculated relationship identifying documents shared with or by the user. This includes URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. + /// Access this property from the derived type itemInsights. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/@Ref/RefRequestBuilder.cs index bceb1b278d7..8d74d90790c 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Used for navigating to the trending document."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used for navigating to the trending document."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Used for navigating to the trending document."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs index 0960a2103f8..1fc07f85a06 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index 20c201cfc04..61af1479b7d 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs index eec8990087c..98f290d02f3 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Commits a file of a given app."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs index d2f80732f59..31e5fc95158 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Renews the SAS URI for an application file upload."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 3e292f52ba5..5a469d2b691 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs index 303866b2566..59bdcc3af63 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action abort"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs index 32b705192f2..21d27c16d5d 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs index fe912ce8213..90b4febf2c7 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action redirect"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Start/StartRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Start/StartRequestBuilder.cs index f96d04d25b1..ec0020c9fbf 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Start/StartRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/PrintJob/Start/StartRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action start"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/ResourceRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/ResourceRequestBuilder.cs index 1561a83a5d7..a1e23b6c8ba 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/ResourceRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/ResourceRequestBuilder.cs @@ -46,16 +46,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used for navigating to the trending document."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, trendingId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, trendingId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs index df505d663fb..b0a89282d86 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action approve"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs index 081ce0ecde0..36a03808144 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs index d6c1f739929..751fa5d5d6a 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index 908daed9a1e..d05051632b4 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs index 517e93a7a2c..c8dc5476331 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs index bb64d25cde3..efad2bef07c 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function boundingRect"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (userId, trendingId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index ad3dbcf7fe0..6d7f293bf57 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (userId, trendingId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs index dac9a3f1bde..c2bd6ff3a51 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs index ae23ce43b9c..b889cdef37c 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function column"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (userId, trendingId, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs index 79a89cdeda9..7b3b3cc0c96 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs index 28d677377e8..23363464474 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, trendingId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs index 7307e3a6e15..ec512a3b7c2 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs index 97079ccdbc1..9119e643fae 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, trendingId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs index c7498fba6c7..d310bd34a44 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action delete"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs index daa9c92f2db..517c7e95e04 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireColumn"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs index 611cbef432a..0dff3cc1a72 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireRow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs index aac8b9183dc..31290f13c26 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action insert"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs index b1f9dfb9b41..6b243e47136 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function intersection"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (userId, trendingId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs index 65ceae3e1a3..931c9b13cac 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastCell"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs index c121b5c627e..33e6ed078b1 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastColumn"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs index fce1093a0ff..41f35dcda54 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastRow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs index 351295ddc25..89b40baaa45 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action merge"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs index d01a04f930a..f1d5eeb053e 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function offsetRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}")); - command.AddOption(new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var rowOffsetOption = new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}"); + rowOffsetOption.IsRequired = true; + command.AddOption(rowOffsetOption); + var columnOffsetOption = new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}"); + columnOffsetOption.IsRequired = true; + command.AddOption(columnOffsetOption); command.Handler = CommandHandler.Create(async (userId, trendingId, rowOffset, columnOffset) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("rowOffset", rowOffset); - requestInfo.PathParameters.Add("columnOffset", columnOffset); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs index e4f8cd3abf4..7c4c6457d5e 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function resizedRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--deltarows", description: "Usage: deltaRows={deltaRows}")); - command.AddOption(new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var deltaRowsOption = new Option("--deltarows", description: "Usage: deltaRows={deltaRows}"); + deltaRowsOption.IsRequired = true; + command.AddOption(deltaRowsOption); + var deltaColumnsOption = new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}"); + deltaColumnsOption.IsRequired = true; + command.AddOption(deltaColumnsOption); command.Handler = CommandHandler.Create(async (userId, trendingId, deltaRows, deltaColumns) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("deltaRows", deltaRows); - requestInfo.PathParameters.Add("deltaColumns", deltaColumns); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs index 041bf452006..539c54b8698 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function row"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); command.Handler = CommandHandler.Create(async (userId, trendingId, row) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("row", row); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs index 819d9ca1edd..b82b77ca678 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs index f6d2fe67a35..a6e66512884 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, trendingId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs index 954f7a949ae..dc9767814d5 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs index 12bd112d6ee..4e4468bb0b3 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, trendingId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs index 649c991addc..97a6146ce83 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unmerge"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs index d698eecd92c..01b5ffb6940 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 112367016f5..c626f3011d7 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs index 463a78f0ecd..5b79c677430 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function visibleView"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs index 3b993933843..f25e86a978a 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs index 068d27fb093..d9cc29c5ef3 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitColumns"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs index 80f464b129a..b44a35962d4 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitRows"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs index 4adaa7e9db2..bbd49d7de5a 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action apply"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs index 4dd7ea6497a..3f2272788d6 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Trending/Item/TrendingRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/Item/TrendingRequestBuilder.cs index 27640becc7a..bc23db74170 100644 --- a/src/generated/Users/Item/Insights/Trending/Item/TrendingRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/Item/TrendingRequestBuilder.cs @@ -21,18 +21,21 @@ public class TrendingRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); command.Handler = CommandHandler.Create(async (userId, trendingId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -40,22 +43,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, trendingId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, trendingId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,22 +80,27 @@ public Command BuildGetCommand() { return command; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--trending-id", description: "key: id of trending")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var trendingIdOption = new Option("--trending-id", description: "key: id of trending"); + trendingIdOption.IsRequired = true; + command.AddOption(trendingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, trendingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(trendingId)) requestInfo.PathParameters.Add("trending_id", trendingId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -124,7 +141,7 @@ public TrendingRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// @@ -139,7 +156,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// Request query parameters @@ -160,7 +177,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// /// Request headers /// Request options @@ -178,7 +195,7 @@ public RequestInformation CreatePatchRequestInformation(ApiSdk.Models.Microsoft. return requestInfo; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -189,7 +206,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -201,7 +218,7 @@ public async Task DeleteAsync(Action> h = default, I return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -213,7 +230,7 @@ public async Task PatchAsync(ApiSdk.Models.Microsoft.Graph.Trending model, Actio var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Users/Item/Insights/Trending/TrendingRequestBuilder.cs b/src/generated/Users/Item/Insights/Trending/TrendingRequestBuilder.cs index 4b842a70543..a9d33a5b79c 100644 --- a/src/generated/Users/Item/Insights/Trending/TrendingRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Trending/TrendingRequestBuilder.cs @@ -28,20 +28,24 @@ public List BuildCommand() { return commands; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -54,32 +58,53 @@ public Command BuildCreateCommand() { return command; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -105,7 +130,7 @@ public TrendingRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// Request query parameters @@ -126,7 +151,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// /// Request headers /// Request options @@ -144,7 +169,7 @@ public RequestInformation CreatePostRequestInformation(ApiSdk.Models.Microsoft.G return requestInfo; } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -156,7 +181,7 @@ public async Task GetAsync(Action q = defa return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -168,7 +193,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// Calculated relationship identifying documents trending around a user. Trending documents are calculated based on activity of the user's closest network of people and include files stored in OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, but has never viewed before. + /// Access this property from the derived type itemInsights. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/@Ref/RefRequestBuilder.cs index 5581128dc94..5c4d6830d5c 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Used for navigating to the item that was used. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used for navigating to the item that was used. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Used for navigating to the item that was used. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs index 32ee6ef4cb5..82c16c7a87b 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index 0396d5e0fe6..896cae73186 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/ManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs index 42d34079704..48adea75ee5 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/MobileAppContentFile/Commit/CommitRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Commits a file of a given app."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs index 5762a91d4f3..fc2e2f1b489 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/MobileAppContentFile/RenewUpload/RenewUploadRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Renews the SAS URI for an application file upload."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 3429d68d1d4..c46b35695fe 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/PrintDocument/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs index 9b9de5907cf..6de9d71f5a5 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Abort/AbortRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action abort"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs index 92133a777c3..5de7898205a 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Cancel/CancelRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cancel"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs index 18f32987ee3..d0900e1450e 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Redirect/RedirectRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action redirect"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Start/StartRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Start/StartRequestBuilder.cs index 4001de0824e..2a339e29787 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Start/StartRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/PrintJob/Start/StartRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action start"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/ResourceRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/ResourceRequestBuilder.cs index 044d617fc0f..c3a5c08f9da 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/ResourceRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/ResourceRequestBuilder.cs @@ -46,16 +46,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Used for navigating to the item that was used. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, usedInsightId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, usedInsightId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs index c9ff3311c28..4f056e47927 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/ScheduleChangeRequest/Approve/ApproveRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action approve"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs index 7cf0df14661..dc2176efe3d 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/ScheduleChangeRequest/Decline/DeclineRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decline"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs index fb6b70ff693..8bb0a66fec2 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/TargetedManagedAppProtection/Assign/AssignRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs index ac60b5cd0ce..aca5b6fecfc 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/TargetedManagedAppProtection/TargetApps/TargetAppsRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action targetApps"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs index 997036d377f..4e4b65eb7c8 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WindowsInformationProtection/Assign/AssignRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action assign"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs index f4a783dcabc..662d362acc7 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/BoundingRectWithAnotherRange/BoundingRectWithAnotherRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function boundingRect"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index 44e11957a6e..ca7863dc00c 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs index 6762ed41265..b8633042312 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Clear/ClearRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs index d216d776fee..ffcb5ce941b 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnWithColumn/ColumnWithColumnRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function column"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs index c9904d0a8de..6e7bdfafef1 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfter/ColumnsAfterRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs index 3ce4aed0357..ad6080aa423 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsAfterWithCount/ColumnsAfterWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsAfter"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs index 8a741c5dae5..932f60760b0 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsBefore/ColumnsBeforeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs index 4c4b29fb1b1..8b8aac44962 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ColumnsBeforeWithCount/ColumnsBeforeWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function columnsBefore"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs index add07635d65..783f0da65a3 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Delete/DeleteRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action delete"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs index 9d12ecd78b7..cdefb23a69f 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/EntireColumn/EntireColumnRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireColumn"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs index 8fe50b4371e..8589423d78c 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/EntireRow/EntireRowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function entireRow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs index 92f6a344449..30a0aaa4b20 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Insert/InsertRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action insert"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs index 8e92a8a2485..457db4e524a 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/IntersectionWithAnotherRange/IntersectionWithAnotherRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function intersection"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var anotherRangeOption = new Option("--anotherrange", description: "Usage: anotherRange={anotherRange}"); + anotherRangeOption.IsRequired = true; + command.AddOption(anotherRangeOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, anotherRange) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - if (!String.IsNullOrEmpty(anotherRange)) requestInfo.PathParameters.Add("anotherRange", anotherRange); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs index 552d3b1dae3..7da0d3c8a7f 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/LastCell/LastCellRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastCell"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs index 2058452b8c9..386476005ef 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/LastColumn/LastColumnRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastColumn"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs index 82ddeb8e3d6..16cfd48eb53 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/LastRow/LastRowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function lastRow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs index dc67c88ccda..d5ed753ca3f 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Merge/MergeRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action merge"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs index d76311016f2..36ff0642a6e 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/OffsetRangeWithRowOffsetWithColumnOffset/OffsetRangeWithRowOffsetWithColumnOffsetRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function offsetRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}")); - command.AddOption(new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var rowOffsetOption = new Option("--rowoffset", description: "Usage: rowOffset={rowOffset}"); + rowOffsetOption.IsRequired = true; + command.AddOption(rowOffsetOption); + var columnOffsetOption = new Option("--columnoffset", description: "Usage: columnOffset={columnOffset}"); + columnOffsetOption.IsRequired = true; + command.AddOption(columnOffsetOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, rowOffset, columnOffset) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("rowOffset", rowOffset); - requestInfo.PathParameters.Add("columnOffset", columnOffset); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs index 9230f6f7f56..474022c8a5c 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/ResizedRangeWithDeltaRowsWithDeltaColumns/ResizedRangeWithDeltaRowsWithDeltaColumnsRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function resizedRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--deltarows", description: "Usage: deltaRows={deltaRows}")); - command.AddOption(new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var deltaRowsOption = new Option("--deltarows", description: "Usage: deltaRows={deltaRows}"); + deltaRowsOption.IsRequired = true; + command.AddOption(deltaRowsOption); + var deltaColumnsOption = new Option("--deltacolumns", description: "Usage: deltaColumns={deltaColumns}"); + deltaColumnsOption.IsRequired = true; + command.AddOption(deltaColumnsOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, deltaRows, deltaColumns) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("deltaRows", deltaRows); - requestInfo.PathParameters.Add("deltaColumns", deltaColumns); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs index 227b71074a9..e420cab931e 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowWithRow/RowWithRowRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function row"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, row) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("row", row); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs index 5ca9538c24e..1b454235b77 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsAbove/RowsAboveRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs index 63344bfa23a..0cd20bed760 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsAboveWithCount/RowsAboveWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsAbove"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs index 9037eb46bb9..818d31b51b3 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsBelow/RowsBelowRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs index 541301b6b51..a6e5b823155 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/RowsBelowWithCount/RowsBelowWithCountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function rowsBelow"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--count", description: "Usage: count={count}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var countOption = new Option("--count", description: "Usage: count={count}"); + countOption.IsRequired = true; + command.AddOption(countOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, count) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("count", count); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs index 1d2ce7856ad..84849186ef3 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/Unmerge/UnmergeRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unmerge"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs index 5b358ccd215..30dbe606680 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/UsedRange/UsedRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 836e508a113..b70e5894dec 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs index 033d5d19f10..2634355a3a5 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRange/VisibleView/VisibleViewRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function visibleView"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs index 6ac115ad1a2..d778742fead 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeFill/Clear/ClearRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs index e4fde6e5e6f..7c513d5caf1 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitColumns/AutofitColumnsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitColumns"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs index 6646c6a1602..c63a90d40f9 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeFormat/AutofitRows/AutofitRowsRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action autofitRows"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs index 300041d72c4..a9946088c1a 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeSort/Apply/ApplyRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action apply"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs index fdb0797bc55..ff38563e443 100644 --- a/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/Resource/WorkbookRangeView/Range/RangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Insights/Used/Item/UsedInsightRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/Item/UsedInsightRequestBuilder.cs index be6873d5212..fcffbc7532b 100644 --- a/src/generated/Users/Item/Insights/Used/Item/UsedInsightRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/Item/UsedInsightRequestBuilder.cs @@ -21,18 +21,21 @@ public class UsedInsightRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -40,22 +43,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, usedInsightId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, usedInsightId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,22 +80,27 @@ public Command BuildGetCommand() { return command; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--usedinsight-id", description: "key: id of usedInsight")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var usedInsightIdOption = new Option("--usedinsight-id", description: "key: id of usedInsight"); + usedInsightIdOption.IsRequired = true; + command.AddOption(usedInsightIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, usedInsightId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(usedInsightId)) requestInfo.PathParameters.Add("usedInsight_id", usedInsightId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -124,7 +141,7 @@ public UsedInsightRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// @@ -139,7 +156,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// Request query parameters @@ -160,7 +177,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// /// Request headers /// Request options @@ -178,7 +195,7 @@ public RequestInformation CreatePatchRequestInformation(UsedInsight body, Action return requestInfo; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -189,7 +206,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -201,7 +218,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -213,7 +230,7 @@ public async Task PatchAsync(UsedInsight model, ActionCalculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Users/Item/Insights/Used/UsedRequestBuilder.cs b/src/generated/Users/Item/Insights/Used/UsedRequestBuilder.cs index 905438f99da..b4d92c419ad 100644 --- a/src/generated/Users/Item/Insights/Used/UsedRequestBuilder.cs +++ b/src/generated/Users/Item/Insights/Used/UsedRequestBuilder.cs @@ -31,20 +31,24 @@ public List BuildCommand() { return commands; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -57,32 +61,53 @@ public Command BuildCreateCommand() { return command; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use."; + command.Description = "Access this property from the derived type itemInsights."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,7 +133,7 @@ public UsedRequestBuilder(Dictionary pathParameters, IRequestAda RequestAdapter = requestAdapter; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Request headers /// Request options /// Request query parameters @@ -129,7 +154,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// /// Request headers /// Request options @@ -147,7 +172,7 @@ public RequestInformation CreatePostRequestInformation(UsedInsight body, Action< return requestInfo; } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -159,7 +184,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -171,7 +196,7 @@ public async Task PostAsync(UsedInsight model, Action(requestInfo, responseHandler, cancellationToken); } - /// Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for Business and SharePoint documents, ranked by recency of use. + /// Access this property from the derived type itemInsights. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Users/Item/JoinedTeams/Item/TeamRequestBuilder.cs b/src/generated/Users/Item/JoinedTeams/Item/TeamRequestBuilder.cs index c861eb35f10..93bb49c1e1e 100644 --- a/src/generated/Users/Item/JoinedTeams/Item/TeamRequestBuilder.cs +++ b/src/generated/Users/Item/JoinedTeams/Item/TeamRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The Microsoft Teams teams that the user is a member of. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--team-id", description: "key: id of team")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); command.Handler = CommandHandler.Create(async (userId, teamId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The Microsoft Teams teams that the user is a member of. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, teamId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, teamId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The Microsoft Teams teams that the user is a member of. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--team-id", description: "key: id of team")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var teamIdOption = new Option("--team-id", description: "key: id of team"); + teamIdOption.IsRequired = true; + command.AddOption(teamIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, teamId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(teamId)) requestInfo.PathParameters.Add("team_id", teamId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/JoinedTeams/JoinedTeamsRequestBuilder.cs b/src/generated/Users/Item/JoinedTeams/JoinedTeamsRequestBuilder.cs index c34b3d53a08..1bf045de6a4 100644 --- a/src/generated/Users/Item/JoinedTeams/JoinedTeamsRequestBuilder.cs +++ b/src/generated/Users/Item/JoinedTeams/JoinedTeamsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The Microsoft Teams teams that the user is a member of. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The Microsoft Teams teams that the user is a member of. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/LicenseDetails/Item/LicenseDetailsRequestBuilder.cs b/src/generated/Users/Item/LicenseDetails/Item/LicenseDetailsRequestBuilder.cs index 4e291555994..dcafd8d0f3c 100644 --- a/src/generated/Users/Item/LicenseDetails/Item/LicenseDetailsRequestBuilder.cs +++ b/src/generated/Users/Item/LicenseDetails/Item/LicenseDetailsRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of this user's license details. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--licensedetails-id", description: "key: id of licenseDetails")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var licenseDetailsIdOption = new Option("--licensedetails-id", description: "key: id of licenseDetails"); + licenseDetailsIdOption.IsRequired = true; + command.AddOption(licenseDetailsIdOption); command.Handler = CommandHandler.Create(async (userId, licenseDetailsId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(licenseDetailsId)) requestInfo.PathParameters.Add("licenseDetails_id", licenseDetailsId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of this user's license details. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--licensedetails-id", description: "key: id of licenseDetails")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, licenseDetailsId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(licenseDetailsId)) requestInfo.PathParameters.Add("licenseDetails_id", licenseDetailsId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var licenseDetailsIdOption = new Option("--licensedetails-id", description: "key: id of licenseDetails"); + licenseDetailsIdOption.IsRequired = true; + command.AddOption(licenseDetailsIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, licenseDetailsId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of this user's license details. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--licensedetails-id", description: "key: id of licenseDetails")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var licenseDetailsIdOption = new Option("--licensedetails-id", description: "key: id of licenseDetails"); + licenseDetailsIdOption.IsRequired = true; + command.AddOption(licenseDetailsIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, licenseDetailsId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(licenseDetailsId)) requestInfo.PathParameters.Add("licenseDetails_id", licenseDetailsId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/LicenseDetails/LicenseDetailsRequestBuilder.cs b/src/generated/Users/Item/LicenseDetails/LicenseDetailsRequestBuilder.cs index 99c8bff613b..1b673141d60 100644 --- a/src/generated/Users/Item/LicenseDetails/LicenseDetailsRequestBuilder.cs +++ b/src/generated/Users/Item/LicenseDetails/LicenseDetailsRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of this user's license details. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,26 +64,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of this user's license details. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Delta/DeltaRequestBuilder.cs index 49708f0dfe2..9f1de3447b0 100644 --- a/src/generated/Users/Item/MailFolders/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs index 8169a473359..cf8e1e360e5 100644 --- a/src/generated/Users/Item/MailFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs @@ -39,16 +39,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of child folders in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,26 +72,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of child folders in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs index 98b9bfc75c7..32fa3c87d16 100644 --- a/src/generated/Users/Item/MailFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/ChildFolders/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/ChildFolders/Item/Copy/CopyRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/ChildFolders/Item/Copy/CopyRequestBuilder.cs index c2e2450a24e..612ab5b0e59 100644 --- a/src/generated/Users/Item/MailFolders/Item/ChildFolders/Item/Copy/CopyRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/ChildFolders/Item/Copy/CopyRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copy"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--mailfolder-id1", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var mailFolderId1Option = new Option("--mailfolder-id1", description: "key: id of mailFolder"); + mailFolderId1Option.IsRequired = true; + command.AddOption(mailFolderId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, mailFolderId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(mailFolderId1)) requestInfo.PathParameters.Add("mailFolder_id1", mailFolderId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/ChildFolders/Item/MailFolderRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/ChildFolders/Item/MailFolderRequestBuilder.cs index 586d82f6b19..0130ee6d3d4 100644 --- a/src/generated/Users/Item/MailFolders/Item/ChildFolders/Item/MailFolderRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/ChildFolders/Item/MailFolderRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of child folders in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--mailfolder-id1", description: "key: id of mailFolder")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var mailFolderId1Option = new Option("--mailfolder-id1", description: "key: id of mailFolder"); + mailFolderId1Option.IsRequired = true; + command.AddOption(mailFolderId1Option); command.Handler = CommandHandler.Create(async (userId, mailFolderId, mailFolderId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(mailFolderId1)) requestInfo.PathParameters.Add("mailFolder_id1", mailFolderId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of child folders in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--mailfolder-id1", description: "key: id of mailFolder")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, mailFolderId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(mailFolderId1)) requestInfo.PathParameters.Add("mailFolder_id1", mailFolderId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var mailFolderId1Option = new Option("--mailfolder-id1", description: "key: id of mailFolder"); + mailFolderId1Option.IsRequired = true; + command.AddOption(mailFolderId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, mailFolderId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of child folders in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--mailfolder-id1", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var mailFolderId1Option = new Option("--mailfolder-id1", description: "key: id of mailFolder"); + mailFolderId1Option.IsRequired = true; + command.AddOption(mailFolderId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, mailFolderId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(mailFolderId1)) requestInfo.PathParameters.Add("mailFolder_id1", mailFolderId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/ChildFolders/Item/Move/MoveRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/ChildFolders/Item/Move/MoveRequestBuilder.cs index 2f040811230..407a92983d1 100644 --- a/src/generated/Users/Item/MailFolders/Item/ChildFolders/Item/Move/MoveRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/ChildFolders/Item/Move/MoveRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action move"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--mailfolder-id1", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var mailFolderId1Option = new Option("--mailfolder-id1", description: "key: id of mailFolder"); + mailFolderId1Option.IsRequired = true; + command.AddOption(mailFolderId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, mailFolderId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(mailFolderId1)) requestInfo.PathParameters.Add("mailFolder_id1", mailFolderId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Copy/CopyRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Copy/CopyRequestBuilder.cs index 0dce94a22f6..e4b5ac41b1f 100644 --- a/src/generated/Users/Item/MailFolders/Item/Copy/CopyRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Copy/CopyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copy"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/MailFolderRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/MailFolderRequestBuilder.cs index 54ab80ce714..2c3ded95959 100644 --- a/src/generated/Users/Item/MailFolders/Item/MailFolderRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/MailFolderRequestBuilder.cs @@ -46,12 +46,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's mail folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -65,14 +68,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's mail folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -118,16 +127,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's mail folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/MessageRules/Item/MessageRuleRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/MessageRules/Item/MessageRuleRequestBuilder.cs index ffec8d17025..60bbaaa568e 100644 --- a/src/generated/Users/Item/MailFolders/Item/MessageRules/Item/MessageRuleRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/MessageRules/Item/MessageRuleRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of rules that apply to the user's Inbox folder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--messagerule-id", description: "key: id of messageRule")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageRuleIdOption = new Option("--messagerule-id", description: "key: id of messageRule"); + messageRuleIdOption.IsRequired = true; + command.AddOption(messageRuleIdOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageRuleId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageRuleId)) requestInfo.PathParameters.Add("messageRule_id", messageRuleId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,16 +51,23 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of rules that apply to the user's Inbox folder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--messagerule-id", description: "key: id of messageRule")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageRuleId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageRuleId)) requestInfo.PathParameters.Add("messageRule_id", messageRuleId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageRuleIdOption = new Option("--messagerule-id", description: "key: id of messageRule"); + messageRuleIdOption.IsRequired = true; + command.AddOption(messageRuleIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageRuleId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,18 +86,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of rules that apply to the user's Inbox folder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--messagerule-id", description: "key: id of messageRule")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageRuleIdOption = new Option("--messagerule-id", description: "key: id of messageRule"); + messageRuleIdOption.IsRequired = true; + command.AddOption(messageRuleIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageRuleId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageRuleId)) requestInfo.PathParameters.Add("messageRule_id", messageRuleId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/MessageRules/MessageRulesRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/MessageRules/MessageRulesRequestBuilder.cs index 07b5162d71b..a8c5a68bd01 100644 --- a/src/generated/Users/Item/MailFolders/Item/MessageRules/MessageRulesRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/MessageRules/MessageRulesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of rules that apply to the user's Inbox folder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,24 +69,41 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of rules that apply to the user's Inbox folder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Delta/Delta.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Delta/Delta.cs index 55572236f4c..5631bea6868 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Delta/Delta.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Delta/Delta.cs @@ -12,7 +12,7 @@ public class Delta : OutlookItem, IParsable { public List BccRecipients { get; set; } /// The body of the message. It can be in HTML or text format. Find out about safe HTML in a message body. public ItemBody Body { get; set; } - /// The first 255 characters of the message body. It is in text format. + /// The first 255 characters of the message body. It is in text format. If the message contains instances of mention, this property would contain a concatenation of these mentions as well. public string BodyPreview { get; set; } /// The Cc: recipients for the message. public List CcRecipients { get; set; } diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Delta/DeltaRequestBuilder.cs index ed5af3deb09..a650079f4b0 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs index 05638c557e0..809826e8c6a 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,18 +37,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,28 +79,49 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 80cdd198d74..04ef3d44413 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs index 8a277056a8c..a31780b009d 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs index 21f51faa68d..c17cb10c4b0 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Copy/CopyRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Copy/CopyRequestBuilder.cs index 0441590af20..b5e86fdd593 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Copy/CopyRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Copy/CopyRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copy"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs index 9d42e60b94c..61074115046 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createForward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs index 41665cd0237..63807ab0445 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createReply"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs index 11849aedb02..beea1cb6c9f 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createReplyAll"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs index 8215bc3e047..197202ebdc2 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +72,49 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs index ed67933fc1a..ebc478f4297 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Forward/ForwardRequestBuilder.cs index a4694b3dd0c..f66bc623d73 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Forward/ForwardRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/MessageRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/MessageRequestBuilder.cs index 1c7bb80cd33..84add8f37ed 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/MessageRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/MessageRequestBuilder.cs @@ -86,14 +86,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of messages in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -120,18 +124,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of messages in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -163,18 +177,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of messages in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Move/MoveRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Move/MoveRequestBuilder.cs index ef04ed86de8..d118b0f6dc2 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Move/MoveRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Move/MoveRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action move"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 69915a35af9..ca0f308f0e9 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 332af2ae179..d9b456883f3 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Reply/ReplyRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Reply/ReplyRequestBuilder.cs index e7f8403feb6..6b8de1f5e2f 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Reply/ReplyRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Reply/ReplyRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reply"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs index 12bb07375e9..1b9368ebfab 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action replyAll"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Send/SendRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Send/SendRequestBuilder.cs index aec6117ad51..7d22d02e3c4 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Send/SendRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Send/SendRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action send"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index d1c0b5bb41d..a33b03c43f2 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index a124df02391..8f01f6b280c 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Value/ContentRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Value/ContentRequestBuilder.cs index 9f5ef1ec31b..6c82e9b2277 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/Item/Value/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/Item/Value/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property messages from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property messages in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, messageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/Messages/MessagesRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Messages/MessagesRequestBuilder.cs index 49f3ed30d79..e2d51e68c15 100644 --- a/src/generated/Users/Item/MailFolders/Item/Messages/MessagesRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Messages/MessagesRequestBuilder.cs @@ -52,16 +52,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of messages in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,28 +85,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of messages in the mailFolder."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/Move/MoveRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/Move/MoveRequestBuilder.cs index bc09d0f4487..6f6100e7d88 100644 --- a/src/generated/Users/Item/MailFolders/Item/Move/MoveRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/Move/MoveRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action move"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index 2f5696fc90b..14648d96bdd 100644 --- a/src/generated/Users/Item/MailFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 04ff6df054f..b5266b94aba 100644 --- a/src/generated/Users/Item/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 98c46a06438..2e1411d38bc 100644 --- a/src/generated/Users/Item/MailFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index dac661c9b2d..126287f72ef 100644 --- a/src/generated/Users/Item/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, mailFolderId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--mailfolder-id", description: "key: id of mailFolder")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, mailFolderId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(mailFolderId)) requestInfo.PathParameters.Add("mailFolder_id", mailFolderId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var mailFolderIdOption = new Option("--mailfolder-id", description: "key: id of mailFolder"); + mailFolderIdOption.IsRequired = true; + command.AddOption(mailFolderIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, mailFolderId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MailFolders/MailFoldersRequestBuilder.cs b/src/generated/Users/Item/MailFolders/MailFoldersRequestBuilder.cs index ef71752d6f4..f599cc28746 100644 --- a/src/generated/Users/Item/MailFolders/MailFoldersRequestBuilder.cs +++ b/src/generated/Users/Item/MailFolders/MailFoldersRequestBuilder.cs @@ -44,14 +44,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The user's mail folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,22 +74,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The user's mail folders. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ManagedAppRegistrations/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/ManagedAppRegistrations/@Ref/RefRequestBuilder.cs index 709295390b4..dc05a375508 100644 --- a/src/generated/Users/Item/ManagedAppRegistrations/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedAppRegistrations/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Zero or more managed app registrations that belong to the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Zero or more managed app registrations that belong to the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ManagedAppRegistrations/GetUserIdsWithFlaggedAppRegistration/GetUserIdsWithFlaggedAppRegistrationRequestBuilder.cs b/src/generated/Users/Item/ManagedAppRegistrations/GetUserIdsWithFlaggedAppRegistration/GetUserIdsWithFlaggedAppRegistrationRequestBuilder.cs index c59ff1ef03b..ae15916f336 100644 --- a/src/generated/Users/Item/ManagedAppRegistrations/GetUserIdsWithFlaggedAppRegistration/GetUserIdsWithFlaggedAppRegistrationRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedAppRegistrations/GetUserIdsWithFlaggedAppRegistration/GetUserIdsWithFlaggedAppRegistrationRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getUserIdsWithFlaggedAppRegistration"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ManagedAppRegistrations/ManagedAppRegistrationsRequestBuilder.cs b/src/generated/Users/Item/ManagedAppRegistrations/ManagedAppRegistrationsRequestBuilder.cs index 78cdfbe474a..a26fc72746d 100644 --- a/src/generated/Users/Item/ManagedAppRegistrations/ManagedAppRegistrationsRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedAppRegistrations/ManagedAppRegistrationsRequestBuilder.cs @@ -27,26 +27,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Zero or more managed app registrations that belong to the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/BypassActivationLock/BypassActivationLockRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/BypassActivationLock/BypassActivationLockRequestBuilder.cs index d816a29ef2f..5a0f98fa1ab 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/BypassActivationLock/BypassActivationLockRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/BypassActivationLock/BypassActivationLockRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Bypass activation lock"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/CleanWindowsDevice/CleanWindowsDeviceRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/CleanWindowsDevice/CleanWindowsDeviceRequestBuilder.cs index e028ef2a19b..cca978df64c 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/CleanWindowsDevice/CleanWindowsDeviceRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/CleanWindowsDevice/CleanWindowsDeviceRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Clean Windows device"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/DeleteUserFromSharedAppleDevice/DeleteUserFromSharedAppleDeviceRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/DeleteUserFromSharedAppleDevice/DeleteUserFromSharedAppleDeviceRequestBuilder.cs index ede4fcc5ebf..4779a9e6d22 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/DeleteUserFromSharedAppleDevice/DeleteUserFromSharedAppleDeviceRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/DeleteUserFromSharedAppleDevice/DeleteUserFromSharedAppleDeviceRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Delete user from shared Apple device"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/DeviceCategory/DeviceCategoryRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/DeviceCategory/DeviceCategoryRequestBuilder.cs index 3ece52fa883..9c8753c97dd 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/DeviceCategory/DeviceCategoryRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/DeviceCategory/DeviceCategoryRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device category"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device category"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, managedDeviceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, managedDeviceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device category"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/DeviceCompliancePolicyStates/DeviceCompliancePolicyStatesRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/DeviceCompliancePolicyStates/DeviceCompliancePolicyStatesRequestBuilder.cs index f645f75b11c..f0f2add9ecb 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/DeviceCompliancePolicyStates/DeviceCompliancePolicyStatesRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/DeviceCompliancePolicyStates/DeviceCompliancePolicyStatesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, managedDeviceId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, managedDeviceId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/DeviceCompliancePolicyStates/Item/DeviceCompliancePolicyStateRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/DeviceCompliancePolicyStates/Item/DeviceCompliancePolicyStateRequestBuilder.cs index f35c71d70ef..8c14d8bc2ef 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/DeviceCompliancePolicyStates/Item/DeviceCompliancePolicyStateRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/DeviceCompliancePolicyStates/Item/DeviceCompliancePolicyStateRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceCompliancePolicyStateIdOption = new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState"); + deviceCompliancePolicyStateIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyStateIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId, deviceCompliancePolicyStateId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceCompliancePolicyStateId)) requestInfo.PathParameters.Add("deviceCompliancePolicyState_id", deviceCompliancePolicyStateId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, managedDeviceId, deviceCompliancePolicyStateId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceCompliancePolicyStateId)) requestInfo.PathParameters.Add("deviceCompliancePolicyState_id", deviceCompliancePolicyStateId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceCompliancePolicyStateIdOption = new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState"); + deviceCompliancePolicyStateIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyStateIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, managedDeviceId, deviceCompliancePolicyStateId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device compliance policy states for this device."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceCompliancePolicyStateIdOption = new Option("--devicecompliancepolicystate-id", description: "key: id of deviceCompliancePolicyState"); + deviceCompliancePolicyStateIdOption.IsRequired = true; + command.AddOption(deviceCompliancePolicyStateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId, deviceCompliancePolicyStateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceCompliancePolicyStateId)) requestInfo.PathParameters.Add("deviceCompliancePolicyState_id", deviceCompliancePolicyStateId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/DeviceConfigurationStates/DeviceConfigurationStatesRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/DeviceConfigurationStates/DeviceConfigurationStatesRequestBuilder.cs index b1478ee5972..9cebaa81d7b 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/DeviceConfigurationStates/DeviceConfigurationStatesRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/DeviceConfigurationStates/DeviceConfigurationStatesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, managedDeviceId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, managedDeviceId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/DeviceConfigurationStates/Item/DeviceConfigurationStateRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/DeviceConfigurationStates/Item/DeviceConfigurationStateRequestBuilder.cs index 1dd335e0380..893820931b6 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/DeviceConfigurationStates/Item/DeviceConfigurationStateRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/DeviceConfigurationStates/Item/DeviceConfigurationStateRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceConfigurationStateIdOption = new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState"); + deviceConfigurationStateIdOption.IsRequired = true; + command.AddOption(deviceConfigurationStateIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId, deviceConfigurationStateId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceConfigurationStateId)) requestInfo.PathParameters.Add("deviceConfigurationState_id", deviceConfigurationStateId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, managedDeviceId, deviceConfigurationStateId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceConfigurationStateId)) requestInfo.PathParameters.Add("deviceConfigurationState_id", deviceConfigurationStateId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceConfigurationStateIdOption = new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState"); + deviceConfigurationStateIdOption.IsRequired = true; + command.AddOption(deviceConfigurationStateIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, managedDeviceId, deviceConfigurationStateId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Device configuration states for this device."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var deviceConfigurationStateIdOption = new Option("--deviceconfigurationstate-id", description: "key: id of deviceConfigurationState"); + deviceConfigurationStateIdOption.IsRequired = true; + command.AddOption(deviceConfigurationStateIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId, deviceConfigurationStateId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - if (!String.IsNullOrEmpty(deviceConfigurationStateId)) requestInfo.PathParameters.Add("deviceConfigurationState_id", deviceConfigurationStateId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/DisableLostMode/DisableLostModeRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/DisableLostMode/DisableLostModeRequestBuilder.cs index 253f7a81b10..7a93f128580 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/DisableLostMode/DisableLostModeRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/DisableLostMode/DisableLostModeRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Disable lost mode"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/LocateDevice/LocateDeviceRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/LocateDevice/LocateDeviceRequestBuilder.cs index 90ccbcc4ab5..a04fd2f2164 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/LocateDevice/LocateDeviceRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/LocateDevice/LocateDeviceRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Locate a device"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/LogoutSharedAppleDeviceActiveUser/LogoutSharedAppleDeviceActiveUserRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/LogoutSharedAppleDeviceActiveUser/LogoutSharedAppleDeviceActiveUserRequestBuilder.cs index cdf0cf3e20c..0234bdd82b7 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/LogoutSharedAppleDeviceActiveUser/LogoutSharedAppleDeviceActiveUserRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/LogoutSharedAppleDeviceActiveUser/LogoutSharedAppleDeviceActiveUserRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Logout shared Apple device active user"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/ManagedDeviceRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/ManagedDeviceRequestBuilder.cs index 5748bccced2..2d5c506fe18 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/ManagedDeviceRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/ManagedDeviceRequestBuilder.cs @@ -59,12 +59,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The managed devices associated with the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -112,16 +115,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The managed devices associated with the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, managedDeviceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, managedDeviceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -152,16 +164,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The managed devices associated with the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/RebootNow/RebootNowRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/RebootNow/RebootNowRequestBuilder.cs index 642c447267e..c22953143ea 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/RebootNow/RebootNowRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/RebootNow/RebootNowRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Reboot device"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/RecoverPasscode/RecoverPasscodeRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/RecoverPasscode/RecoverPasscodeRequestBuilder.cs index 348055328b4..53950def296 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/RecoverPasscode/RecoverPasscodeRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/RecoverPasscode/RecoverPasscodeRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Recover passcode"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/RemoteLock/RemoteLockRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/RemoteLock/RemoteLockRequestBuilder.cs index 757bc7cc557..ca0d046a13b 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/RemoteLock/RemoteLockRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/RemoteLock/RemoteLockRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Remote lock"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/RequestRemoteAssistance/RequestRemoteAssistanceRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/RequestRemoteAssistance/RequestRemoteAssistanceRequestBuilder.cs index e53185b3868..d13979b5cce 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/RequestRemoteAssistance/RequestRemoteAssistanceRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/RequestRemoteAssistance/RequestRemoteAssistanceRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Request remote assistance"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/ResetPasscode/ResetPasscodeRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/ResetPasscode/ResetPasscodeRequestBuilder.cs index e8c2db5dc62..57c0ad1460a 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/ResetPasscode/ResetPasscodeRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/ResetPasscode/ResetPasscodeRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Reset passcode"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/Retire/RetireRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/Retire/RetireRequestBuilder.cs index ee8038fb08f..81a5830c433 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/Retire/RetireRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/Retire/RetireRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Retire a device"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/ShutDown/ShutDownRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/ShutDown/ShutDownRequestBuilder.cs index cc105e3c474..90e7a4e8125 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/ShutDown/ShutDownRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/ShutDown/ShutDownRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Shut down device"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/SyncDevice/SyncDeviceRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/SyncDevice/SyncDeviceRequestBuilder.cs index 334e979006c..3fedde6cd8f 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/SyncDevice/SyncDeviceRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/SyncDevice/SyncDeviceRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action syncDevice"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/UpdateWindowsDeviceAccount/UpdateWindowsDeviceAccountRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/UpdateWindowsDeviceAccount/UpdateWindowsDeviceAccountRequestBuilder.cs index 25d68751d86..ffe09b4cf72 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/UpdateWindowsDeviceAccount/UpdateWindowsDeviceAccountRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/UpdateWindowsDeviceAccount/UpdateWindowsDeviceAccountRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action updateWindowsDeviceAccount"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/WindowsDefenderScan/WindowsDefenderScanRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/WindowsDefenderScan/WindowsDefenderScanRequestBuilder.cs index 32b79f85b88..9dc8e8697b6 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/WindowsDefenderScan/WindowsDefenderScanRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/WindowsDefenderScan/WindowsDefenderScanRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action windowsDefenderScan"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/WindowsDefenderUpdateSignatures/WindowsDefenderUpdateSignaturesRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/WindowsDefenderUpdateSignatures/WindowsDefenderUpdateSignaturesRequestBuilder.cs index 776d4a83913..691ff3061d2 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/WindowsDefenderUpdateSignatures/WindowsDefenderUpdateSignaturesRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/WindowsDefenderUpdateSignatures/WindowsDefenderUpdateSignaturesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action windowsDefenderUpdateSignatures"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/Item/Wipe/WipeRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/Item/Wipe/WipeRequestBuilder.cs index 2039c031ab3..860dc6ecfba 100644 --- a/src/generated/Users/Item/ManagedDevices/Item/Wipe/WipeRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/Item/Wipe/WipeRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Wipe a device"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--manageddevice-id", description: "key: id of managedDevice")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var managedDeviceIdOption = new Option("--manageddevice-id", description: "key: id of managedDevice"); + managedDeviceIdOption.IsRequired = true; + command.AddOption(managedDeviceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, managedDeviceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(managedDeviceId)) requestInfo.PathParameters.Add("managedDevice_id", managedDeviceId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ManagedDevices/ManagedDevicesRequestBuilder.cs b/src/generated/Users/Item/ManagedDevices/ManagedDevicesRequestBuilder.cs index fb7f8b2a8c3..0df7a83f84c 100644 --- a/src/generated/Users/Item/ManagedDevices/ManagedDevicesRequestBuilder.cs +++ b/src/generated/Users/Item/ManagedDevices/ManagedDevicesRequestBuilder.cs @@ -57,14 +57,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The managed devices associated with the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,26 +87,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The managed devices associated with the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Manager/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/Manager/@Ref/RefRequestBuilder.cs index c82f78256e2..3f8f8bb0fe6 100644 --- a/src/generated/Users/Item/Manager/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/Manager/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user or contact that is this user's manager. Read-only. (HTTP Methods: GET, PUT, DELETE.). Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user or contact that is this user's manager. Read-only. (HTTP Methods: GET, PUT, DELETE.). Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The user or contact that is this user's manager. Read-only. (HTTP Methods: GET, PUT, DELETE.). Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Manager/ManagerRequestBuilder.cs b/src/generated/Users/Item/Manager/ManagerRequestBuilder.cs index 5b6346e3500..01495d649d2 100644 --- a/src/generated/Users/Item/Manager/ManagerRequestBuilder.cs +++ b/src/generated/Users/Item/Manager/ManagerRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user or contact that is this user's manager. Read-only. (HTTP Methods: GET, PUT, DELETE.). Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/MemberOf/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/MemberOf/@Ref/RefRequestBuilder.cs index afe99e0c543..b461ef4288a 100644 --- a/src/generated/Users/Item/MemberOf/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/MemberOf/@Ref/RefRequestBuilder.cs @@ -19,28 +19,43 @@ public class RefRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand."; + command.Description = "The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -53,20 +68,24 @@ public Command BuildGetCommand() { return command; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// public Command BuildPostCommand() { var command = new Command("post"); - command.Description = "The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand."; + command.Description = "The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,7 +111,7 @@ public RefRequestBuilder(Dictionary pathParameters, IRequestAdap RequestAdapter = requestAdapter; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -113,7 +132,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// /// Request headers /// Request options @@ -131,7 +150,7 @@ public RequestInformation CreatePostRequestInformation(ApiSdk.Users.Item.MemberO return requestInfo; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -143,7 +162,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -155,7 +174,7 @@ public async Task GetAsync(Action q = default, var requestInfo = CreatePostRequestInformation(model, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Users/Item/MemberOf/MemberOfRequestBuilder.cs b/src/generated/Users/Item/MemberOf/MemberOfRequestBuilder.cs index 734613b26eb..fff875b1366 100644 --- a/src/generated/Users/Item/MemberOf/MemberOfRequestBuilder.cs +++ b/src/generated/Users/Item/MemberOf/MemberOfRequestBuilder.cs @@ -20,32 +20,53 @@ public class MemberOfRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand."; + command.Description = "The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,7 +99,7 @@ public MemberOfRequestBuilder(Dictionary pathParameters, IReques RequestAdapter = requestAdapter; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// Request headers /// Request options /// Request query parameters @@ -99,7 +120,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -110,7 +131,7 @@ public async Task GetAsync(Action q = defa var requestInfo = CreateGetRequestInformation(q, h, o); return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } - /// The groups and directory roles that the user is a member of. Read-only. Nullable. Supports $expand. + /// The groups, directory roles and administrative units that the user is a member of. Read-only. Nullable. Supports $expand. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Users/Item/Messages/Delta/Delta.cs b/src/generated/Users/Item/Messages/Delta/Delta.cs index bf49f03390f..7c614096b9e 100644 --- a/src/generated/Users/Item/Messages/Delta/Delta.cs +++ b/src/generated/Users/Item/Messages/Delta/Delta.cs @@ -12,7 +12,7 @@ public class Delta : OutlookItem, IParsable { public List BccRecipients { get; set; } /// The body of the message. It can be in HTML or text format. Find out about safe HTML in a message body. public ItemBody Body { get; set; } - /// The first 255 characters of the message body. It is in text format. + /// The first 255 characters of the message body. It is in text format. If the message contains instances of mention, this property would contain a concatenation of these mentions as well. public string BodyPreview { get; set; } /// The Cc: recipients for the message. public List CcRecipients { get; set; } diff --git a/src/generated/Users/Item/Messages/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Messages/Delta/DeltaRequestBuilder.cs index 4e1089373e3..85f52e3e6d2 100644 --- a/src/generated/Users/Item/Messages/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs index c0d4aa657b9..80a9b583e5e 100644 --- a/src/generated/Users/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs @@ -37,16 +37,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,26 +76,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, messageId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, messageId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index c2e7f0e2b1f..2179f4a39ac 100644 --- a/src/generated/Users/Item/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/Attachments/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs index 4c89760b913..ff22021c642 100644 --- a/src/generated/Users/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); command.Handler = CommandHandler.Create(async (userId, messageId, attachmentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, messageId, attachmentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, messageId, attachmentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The fileAttachment and itemAttachment attachments for the message."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--attachment-id", description: "key: id of attachment")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var attachmentIdOption = new Option("--attachment-id", description: "key: id of attachment"); + attachmentIdOption.IsRequired = true; + command.AddOption(attachmentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, attachmentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(attachmentId)) requestInfo.PathParameters.Add("attachment_id", attachmentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs index f65f721ba6d..999fb3fb82c 100644 --- a/src/generated/Users/Item/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/CalendarSharingMessage/Accept/AcceptRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accept"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.Handler = CommandHandler.Create(async (userId, messageId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Messages/Item/Copy/CopyRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/Copy/CopyRequestBuilder.cs index 0eeb9bf89cd..b2ff81d9724 100644 --- a/src/generated/Users/Item/Messages/Item/Copy/CopyRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/Copy/CopyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copy"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs index 24ba9b7bf48..07cece5f7de 100644 --- a/src/generated/Users/Item/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/CreateForward/CreateForwardRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createForward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs index 7e7ec6ed9a0..e797fbf5fdc 100644 --- a/src/generated/Users/Item/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/CreateReply/CreateReplyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createReply"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs index 835eee065cd..27b5e3286af 100644 --- a/src/generated/Users/Item/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/CreateReplyAll/CreateReplyAllRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createReplyAll"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs index ac3cfd5d482..33589257f98 100644 --- a/src/generated/Users/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +69,46 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, messageId, top, skip, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, messageId, top, skip, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs index 3464a0f9115..822366dfa54 100644 --- a/src/generated/Users/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, messageId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, messageId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, messageId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Messages/Item/Forward/ForwardRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/Forward/ForwardRequestBuilder.cs index 75374cf48ca..5d49882f181 100644 --- a/src/generated/Users/Item/Messages/Item/Forward/ForwardRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/Forward/ForwardRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action forward"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Messages/Item/MessageRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/MessageRequestBuilder.cs index b3f5254f84a..1db6462ca54 100644 --- a/src/generated/Users/Item/Messages/Item/MessageRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/MessageRequestBuilder.cs @@ -86,12 +86,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The messages in a mailbox or folder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.Handler = CommandHandler.Create(async (userId, messageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -118,14 +121,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The messages in a mailbox or folder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, messageId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, messageId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -157,16 +166,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The messages in a mailbox or folder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Messages/Item/Move/MoveRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/Move/MoveRequestBuilder.cs index 1f92d96de02..4934439c8d0 100644 --- a/src/generated/Users/Item/Messages/Item/Move/MoveRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/Move/MoveRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action move"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs index cee83eda4c1..3a4453c34b7 100644 --- a/src/generated/Users/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, messageId, multiValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, messageId, multiValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, messageId, multiValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var multiValueLegacyExtendedPropertyIdOption = new Option("--multivaluelegacyextendedproperty-id", description: "key: id of multiValueLegacyExtendedProperty"); + multiValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(multiValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, multiValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(multiValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty_id", multiValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index a528b8b6099..0f305777c16 100644 --- a/src/generated/Users/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of multi-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, messageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, messageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Messages/Item/Reply/ReplyRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/Reply/ReplyRequestBuilder.cs index e43e956954b..ae2dbf7634a 100644 --- a/src/generated/Users/Item/Messages/Item/Reply/ReplyRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/Reply/ReplyRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reply"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs index 463eff81205..ebe07c78e43 100644 --- a/src/generated/Users/Item/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/ReplyAll/ReplyAllRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action replyAll"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Messages/Item/Send/SendRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/Send/SendRequestBuilder.cs index fb6478aa42b..559f92fdce3 100644 --- a/src/generated/Users/Item/Messages/Item/Send/SendRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/Send/SendRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action send"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.Handler = CommandHandler.Create(async (userId, messageId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs index 158623b2857..d610370bbdd 100644 --- a/src/generated/Users/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); command.Handler = CommandHandler.Create(async (userId, messageId, singleValueLegacyExtendedPropertyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, messageId, singleValueLegacyExtendedPropertyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, messageId, singleValueLegacyExtendedPropertyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var singleValueLegacyExtendedPropertyIdOption = new Option("--singlevaluelegacyextendedproperty-id", description: "key: id of singleValueLegacyExtendedProperty"); + singleValueLegacyExtendedPropertyIdOption.IsRequired = true; + command.AddOption(singleValueLegacyExtendedPropertyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, singleValueLegacyExtendedPropertyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - if (!String.IsNullOrEmpty(singleValueLegacyExtendedPropertyId)) requestInfo.PathParameters.Add("singleValueLegacyExtendedProperty_id", singleValueLegacyExtendedPropertyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index 52ebe3c3865..da3e00f0d88 100644 --- a/src/generated/Users/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, messageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of single-value extended properties defined for the message. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, messageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, messageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Messages/Item/Value/ContentRequestBuilder.cs b/src/generated/Users/Item/Messages/Item/Value/ContentRequestBuilder.cs index 09e0b49fb25..5cc4cd63fb5 100644 --- a/src/generated/Users/Item/Messages/Item/Value/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/Item/Value/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property messages from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, messageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property messages in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--message-id", description: "key: id of message")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var messageIdOption = new Option("--message-id", description: "key: id of message"); + messageIdOption.IsRequired = true; + command.AddOption(messageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, messageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(messageId)) requestInfo.PathParameters.Add("message_id", messageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Messages/MessagesRequestBuilder.cs b/src/generated/Users/Item/Messages/MessagesRequestBuilder.cs index b5a7973e470..9de23bc7268 100644 --- a/src/generated/Users/Item/Messages/MessagesRequestBuilder.cs +++ b/src/generated/Users/Item/Messages/MessagesRequestBuilder.cs @@ -52,14 +52,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The messages in a mailbox or folder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,24 +82,42 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The messages in a mailbox or folder. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Oauth2PermissionGrants/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/Oauth2PermissionGrants/@Ref/RefRequestBuilder.cs index 07133694c6f..a46f5acfad3 100644 --- a/src/generated/Users/Item/Oauth2PermissionGrants/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/Oauth2PermissionGrants/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of oauth2PermissionGrants from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Create new navigation property ref to oauth2PermissionGrants for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs b/src/generated/Users/Item/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs index 1ceab4df32b..7f3213b3049 100644 --- a/src/generated/Users/Item/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs +++ b/src/generated/Users/Item/Oauth2PermissionGrants/Oauth2PermissionGrantsRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get oauth2PermissionGrants from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs index 0d8d641c2db..1c720df7fba 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/GetNotebookFromWebUrl/GetNotebookFromWebUrlRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action getNotebookFromWebUrl"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs index d70e8256853..c5d826eb7e8 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/GetRecentNotebooksWithIncludePersonalNotebooks/GetRecentNotebooksWithIncludePersonalNotebooksRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getRecentNotebooks"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--includepersonalnotebooks", description: "Usage: includePersonalNotebooks={includePersonalNotebooks}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var includePersonalNotebooksOption = new Option("--includepersonalnotebooks", description: "Usage: includePersonalNotebooks={includePersonalNotebooks}"); + includePersonalNotebooksOption.IsRequired = true; + command.AddOption(includePersonalNotebooksOption); command.Handler = CommandHandler.Create(async (userId, includePersonalNotebooks) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.PathParameters.Add("includePersonalNotebooks", includePersonalNotebooks); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs index 46a7c39e6b0..25fae92d2c2 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/NotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/NotebookRequestBuilder.cs index 905f64958f0..f80841f8013 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/NotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/NotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index e30cad3b595..fc861a431dd 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 3b9dff84c4f..864f3f9565f 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index dcb3933bfcc..b9afc7e96e1 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 04a2633ef83..2cec01567e1 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,18 +55,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,18 +112,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 4bc2d6c82ea..a0d897f949a 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index b907044bd05..ac8858e456f 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index d9739814e66..4ab481f9925 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index b6d10d7a9d6..c5568f60ec0 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index c3e18fdce48..3369fdeab41 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,16 +43,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,20 +71,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,20 +138,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index e29a3ca1755..20a7f7b8cca 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,19 +25,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -60,20 +66,28 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 16394b9d232..a1bf6cbb11d 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index edb0baf164c..90d261ad3de 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,18 +45,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -70,22 +76,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -129,22 +147,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 8311b373c72..a2e716247a6 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index a2dca13f137..887c266b3cd 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index d3d65f8cb50..75c39bb09f6 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,18 +33,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,22 +64,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,22 +110,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 04fa77d0f7b..f499e755fc6 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 2c0ec19aa47..bbd840148ad 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index 4f947bf0516..56ef13064e3 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -65,22 +71,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,22 +117,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 2ad5cd47dbd..6484a053026 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs index 82a79b8f2b7..3686da7a9b4 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,20 +41,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,32 +80,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index cc94dab6dfe..b06ea78fcf5 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 4c2fdb80957..8732372971e 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 8a344676316..a5f3df1af16 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index 45e1e64f81b..6c32570a872 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 4d503ce1b11..7f2496ff901 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index a45c815eac3..df27c9c0ba6 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 0f62fa6d1ac..50e181f4a5f 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 058ea5fc45e..3dc16fee13e 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,18 +136,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 1bf84968323..3acaaea7c7a 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,17 +25,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -58,18 +63,25 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 51aaff48cb5..505627b1649 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 2fe46523a07..9153d949bb9 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,16 +45,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -68,20 +73,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -125,20 +141,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index cdf2058e858..862246911c8 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 880a039a8b5..03e461cee34 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index cbea9cb9ed7..3b6508871b2 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 8b0a9577cb9..c73c6b31196 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 6ea130852f6..a4101fbd4aa 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index 458ee3a647d..67b26710aa4 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index e3d48a1ceff..cd09aca6245 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs index 9bd0b9b4213..f98048661b6 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 6ad1a821166..3a53bec2a18 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 3366074ca64..079f70c0790 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index a8922e60ed6..2696c818412 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index 3f1dc544657..6f414064363 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index aed0ea197d9..a10b272ad62 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index c8399bd29be..8ea618a54c4 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,14 +29,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +54,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -101,18 +115,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index ea53efa8761..9458a799200 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index 30ef308b178..cad2914ab67 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index f164a5dea50..eddca05ce7c 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 7395fcede7b..b04862982d5 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index 4b41cbb0c73..d91ac717771 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index 0f173067263..c6fce9a2c3f 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs index 22aa15f01db..6516fb7feb8 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/Item/Sections/SectionsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, notebookId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--notebook-id", description: "key: id of notebook")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, notebookId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(notebookId)) requestInfo.PathParameters.Add("notebook_id", notebookId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var notebookIdOption = new Option("--notebook-id", description: "key: id of notebook"); + notebookIdOption.IsRequired = true; + command.AddOption(notebookIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, notebookId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Notebooks/NotebooksRequestBuilder.cs b/src/generated/Users/Item/Onenote/Notebooks/NotebooksRequestBuilder.cs index b1ec98c2b36..af0b6cf578b 100644 --- a/src/generated/Users/Item/Onenote/Notebooks/NotebooksRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Notebooks/NotebooksRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,26 +77,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/OnenoteRequestBuilder.cs b/src/generated/Users/Item/Onenote/OnenoteRequestBuilder.cs index ecedb95388b..b8efce92836 100644 --- a/src/generated/Users/Item/Onenote/OnenoteRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/OnenoteRequestBuilder.cs @@ -32,10 +32,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,14 +51,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,14 +107,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs b/src/generated/Users/Item/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs index c6d542ada9e..b11294ebaa0 100644 --- a/src/generated/Users/Item/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Operations/Item/OnenoteOperationRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenoteoperation-id", description: "key: id of onenoteOperation")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteOperationIdOption = new Option("--onenoteoperation-id", description: "key: id of onenoteOperation"); + onenoteOperationIdOption.IsRequired = true; + command.AddOption(onenoteOperationIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteOperationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteOperationId)) requestInfo.PathParameters.Add("onenoteOperation_id", onenoteOperationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenoteoperation-id", description: "key: id of onenoteOperation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteOperationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteOperationId)) requestInfo.PathParameters.Add("onenoteOperation_id", onenoteOperationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteOperationIdOption = new Option("--onenoteoperation-id", description: "key: id of onenoteOperation"); + onenoteOperationIdOption.IsRequired = true; + command.AddOption(onenoteOperationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteOperationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenoteoperation-id", description: "key: id of onenoteOperation")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteOperationIdOption = new Option("--onenoteoperation-id", description: "key: id of onenoteOperation"); + onenoteOperationIdOption.IsRequired = true; + command.AddOption(onenoteOperationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteOperationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteOperationId)) requestInfo.PathParameters.Add("onenoteOperation_id", onenoteOperationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Operations/OperationsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Operations/OperationsRequestBuilder.cs index 3d9451bd1b8..6712d5f3e3f 100644 --- a/src/generated/Users/Item/Onenote/Operations/OperationsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Operations/OperationsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The status of OneNote operations. Getting an operations collection is not supported, but you can get the status of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/Content/ContentRequestBuilder.cs index 99cf345c318..c0e92c8121d 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index c0c45da7648..1a7b8fffe51 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/OnenotePageRequestBuilder.cs index 8dd395b85eb..b69d38461df 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,12 +45,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,16 +67,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,16 +134,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 6090664e946..75585d88c52 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 3d2d0ea9c3d..d498922dff3 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 27a8f47b1f1..0b4fc96a064 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 3fe8cbaa51d..f8f7e0fc078 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 8b6be586bd8..abf1a01e98a 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 25eade3b9ce..bc343616f97 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 7c54de3870a..ec9d03e693e 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,18 +55,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,18 +112,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 694f6563223..e6cffc487cf 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 53c94fa8d6c..7585c1be5c6 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 66b96b984e8..3be037f0f85 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 305dfcb2319..815637742de 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 009eecbac8a..024597d3657 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,16 +43,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,20 +71,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,20 +138,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 6caae642750..6887eacdfac 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,19 +25,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -60,20 +66,28 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 0d6aa832230..f5a88ef33ea 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index b3640585ed6..fa1d362e444 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -43,18 +43,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -68,22 +74,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,22 +126,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index fe183064c29..79f49413cc0 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index be1c48dd3fe..47681ac2dae 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs index 58d079e41ec..636f9d5d4e1 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -39,20 +39,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,32 +78,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index e9749a2104c..7c816cff9cc 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 649a907b785..3e953881a95 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 2765b760707..1329d145a95 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index d845236bf67..f9a8965367a 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 8663d0f0ee8..4e4489db253 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 98aa5de3c99..73060555278 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 5ff9e584db0..5c5aac02779 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 281fb663922..51e7e6c6ed5 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -122,18 +136,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index d365fb05c6e..3018a99b8d6 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,17 +25,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenotePageId1, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -58,18 +63,25 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenotePageId1, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 0db87f5ef3b..590089c74ed 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 68599ef764b..5f878753218 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -43,16 +43,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,20 +71,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenotePageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenotePageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -104,20 +120,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 268da704d1d..88f9805571d 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 0330049677c..8acef4de63c 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenotePageId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs index 576ae4386f2..6885251dc9e 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs @@ -39,18 +39,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,30 +75,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 3b0a663ddce..163af4b8656 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 7017af381a5..703739b0847 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index c151bedc477..c7446e0c7f2 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index 17f002bcdee..7552e806ac7 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 382601ab35c..a85f13675a2 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 3c27dce8a24..57866dedd42 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,14 +29,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,18 +54,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -101,18 +115,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index e02ed048ae2..33cbfd6b248 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index 199fdf97798..9ee0fc642d4 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 536e4573236..9c2f6d74d62 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index aea084a1500..3d5705afeef 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index e36b82538fe..4b7bf52c55c 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index 4568c9a059e..026240b5206 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index b830cbf730d..20876f41853 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 1131f2406d7..dc22397d83d 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 1668faa19a0..6d107e80b70 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs index 6a8f641e323..3da391e4049 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenotePageId1, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenotePageId1, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index c47d6cf8a35..3ff607bf70d 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs index 5383e341670..e5e0be31c64 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePageRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenotePageId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenotePageId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenotePageId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -100,18 +114,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 280c4af91f6..69b855984a7 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenotePageId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs index 22f892b60cb..1d2f8311d00 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotepage-id1", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenotePageId1Option = new Option("--onenotepage-id1", description: "key: id of onenotePage"); + onenotePageId1Option.IsRequired = true; + command.AddOption(onenotePageId1Option); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenotePageId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenotePageId1)) requestInfo.PathParameters.Add("onenotePage_id1", onenotePageId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs index 9fb6810f9ab..873ad5b21e8 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/Pages/PagesRequestBuilder.cs @@ -39,16 +39,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,28 +72,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 8cf6ce63368..ced0b19b10f 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs index 61c9b47b70e..da7a140a6c3 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 2000a0c1b25..e2ad0a159ba 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index dac31e0fd70..4349dbced75 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index e00cdd3eb07..49db96ff374 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 1ae51a51b45..0e239b37e54 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,18 +55,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,18 +112,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index e7de0e32b95..c58d24e483b 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index c95cd4f04c9..1caa27f696e 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 1f0fae8c3a5..578280def97 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index ef462f06101..1238b7ce0c3 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 4b4418b15d7..eb3dabd10f3 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index 2c2d616109d..531bdc3140e 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 22cfc68bf01..074b27e8623 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index b8a8974cc7e..76237bf88b6 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index f723262511b..b9c1e749b93 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 1006b71ac43..32cd47f9df8 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs index 87a4bdfc087..26207c6d268 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 326d7a55efb..5027c7afca0 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index fdd5de8833b..e9a96576949 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 648c55c499f..d9cc30b9a57 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 1a724d45e90..63ba7ca9c9b 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 3780a5aad24..a230ff1bab6 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 1cc5d51f307..89d8f63249c 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index e5efd1523de..d2881c2b91f 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs index 6bd11bed050..620d79b89eb 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 3b690481b46..ccf24bdf2fd 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index c0d73750be8..69b00343ee3 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,12 +29,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +51,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,16 +111,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index ca58884f33b..6d1d103787e 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index 8bdea3c64e0..f5e70852ca9 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 151a228d021..7489cc6e94b 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 8f7c00ef715..38c3cdc1eca 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index 6052511b688..5c49c698966 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index 2d1863d705a..6108f0c82d2 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index f98b981283f..b26b5a83569 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,16 +65,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,16 +132,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs index d86265b8281..201002d749f 100644 --- a/src/generated/Users/Item/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Pages/PagesRequestBuilder.cs b/src/generated/Users/Item/Onenote/Pages/PagesRequestBuilder.cs index 7c0a9b964da..663360fd2f6 100644 --- a/src/generated/Users/Item/Onenote/Pages/PagesRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Pages/PagesRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,26 +71,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Resources/Item/Content/ContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Resources/Item/Content/ContentRequestBuilder.cs index d7d20f27741..d4cb5820485 100644 --- a/src/generated/Users/Item/Onenote/Resources/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Resources/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property resources from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, onenoteResourceId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property resources in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, onenoteResourceId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs b/src/generated/Users/Item/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs index fc0a4e3575e..3640ce5e619 100644 --- a/src/generated/Users/Item/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Resources/Item/OnenoteResourceRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteResourceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteResourceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenoteresource-id", description: "key: id of onenoteResource")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteResourceIdOption = new Option("--onenoteresource-id", description: "key: id of onenoteResource"); + onenoteResourceIdOption.IsRequired = true; + command.AddOption(onenoteResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteResourceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteResourceId)) requestInfo.PathParameters.Add("onenoteResource_id", onenoteResourceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Resources/ResourcesRequestBuilder.cs b/src/generated/Users/Item/Onenote/Resources/ResourcesRequestBuilder.cs index c7147d07b43..32a4a915026 100644 --- a/src/generated/Users/Item/Onenote/Resources/ResourcesRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Resources/ResourcesRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can get the binary content of a specific resource. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 1d960d4b0a2..8f3cbdf15d7 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 403aa25c6fb..99ef3c3c4c6 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 08c627b19e0..9398fa56209 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index dd477c66fa6..bfd9e488160 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index cf2426090d4..0989bc011c1 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 33eabc31af6..b53f1e1ee05 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index d2ec0aee198..4379bc01ff6 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -118,18 +132,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 521405d829e..d3d1a7136e9 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,17 +25,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -58,18 +63,25 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index e8cbd99b3aa..4d9112ef48e 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 02bc9565f53..4b08738e121 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,16 +45,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -68,20 +73,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -125,20 +141,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 8e2f281d617..d3a7fe4a30a 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index c9e59bd6160..5a4872a02ee 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 1335974d523..273fa53f4e2 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 452f5b09203..0bc91af9160 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 195509c2d2b..1a92b3927ee 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index b61545c6a04..a7ff84915f3 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 829e61c42f0..d1ea2999ae3 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs index de128ad5084..c1427e53706 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 5d05b58a9bb..c4c8046f4d2 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 1583ea8a5bb..fb60d67ec16 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index cae7f7604a6..a18efccb154 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index c2c77da9fd7..96190d0712b 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index a5d7d76702b..0e83dcc724f 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs index 06cc8c993d5..a2a85b7fb3a 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,12 +30,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,16 +52,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,16 +108,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index cb5d22616d6..4e7eb709b99 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 9417a08070d..dba8385dc96 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 7ed6e2bf917..dcccea87fef 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 6d6b8a189df..288532d8474 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 2f3094933b6..9924bcbe0ee 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,14 +43,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -64,18 +68,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,18 +134,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 93468424067..40dfcf22015 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,17 +25,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -58,18 +63,25 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index 261b0d0f96f..e0cd9ac2bb0 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index d4d242236bb..a68aaa38d7d 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,16 +45,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -68,20 +73,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -127,20 +143,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index ea378e9fa11..7528f071e65 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 48c5eb8d0a9..9342db53578 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index b59b304132b..ed9f3c0e68d 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,16 +35,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,20 +63,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -90,20 +106,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index b7b7badb134..e7451dc68ce 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 03e8d402db7..fc3d5d797b4 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index cb068ff2001..767acd8a6f9 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 26eaae637f4..41d7c1b206b 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index f78a3a910db..f7b840e6745 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -65,22 +71,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,22 +117,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index cf5ab08a2e2..7bfa81c8e6c 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,20 +38,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,32 +77,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 413881a354e..84f38dcdaa4 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 154421029e3..3bd615503d1 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index 1894385e065..c19c0f2faf0 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index 1a2f07d4d55..91dc7dc0e6c 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs index 8fc4457b0fa..ef03fc981bd 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,18 +41,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,30 +77,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 2b91370dca9..263b90d4729 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index f78cc2499dc..1bda17b7ed4 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,14 +35,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 429845e0b85..f0398be40d5 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index e0889304a5c..89b46c4eba3 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 6d16d48bcf5..2ea9e3a9ec8 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index dff3916a434..4158935bf07 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 506cfab41ca..c28c8b38fe9 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 42293a8b0e0..a5263dc68cd 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 3064823e421..f3dce9bd750 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index c1c0a6a3636..068d3afeb10 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs index e70529feebf..3e98f0e1195 100644 --- a/src/generated/Users/Item/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,26 +70,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 8aa73999495..4b6765df897 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 332b1caeeae..d99e320ee3f 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs index ffcf6e6cc73..f9fc8533194 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -43,12 +43,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,16 +65,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -120,16 +132,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs index 082701144c3..b5183415ca3 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/Content/ContentRequestBuilder.cs @@ -25,15 +25,19 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property pages from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -56,16 +60,22 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property pages in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs index db9998ff0e7..50b94dab9f8 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/CopyToSection/CopyToSectionRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSection"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs index 3bc6ddc26aa..8c08c3bfa05 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/OnenotePageRequestBuilder.cs @@ -45,14 +45,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,18 +70,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -123,18 +137,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs index 740d560d192..903387c6ee0 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/OnenotePatchContent/OnenotePatchContentRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action onenotePatchContent"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 29a9b8204b3..c23b1eb122b 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 6dec143ed90..220062b66f5 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,14 +35,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 7010bbdcacb..cb6c83c5a3c 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 3804be4e161..efe033f3942 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index ca66cbd8bd6..67989d3a831 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 0e2938a9f92..c03d63654ff 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,16 +30,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,20 +58,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -102,20 +118,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 98e5f8570b0..6f0040a54e7 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,22 +57,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,22 +103,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index 2f1846ba2c0..c3e54187fce 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,20 +36,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,32 +75,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index cf57beeb424..c5633d02a9b 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 77d0e936502..1cca15fa7c1 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,22 +26,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index d011b07a869..2d82cb05e0f 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -65,22 +71,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,22 +117,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index e5742ec7a4a..05b74946df9 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -38,20 +38,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,32 +77,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 3f09e1976cc..77199591341 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,30 +76,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index e3e582d96b6..f28282c37c0 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 22b748efbb9..35f5c0084ab 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 58558e82045..980c5f1ed55 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 88504e5f22f..af4a88d9a64 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 7d57234f031..2e34ac26dc4 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index ed85907f229..c6294f749f0 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentSection/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs index 663f3ffddd7..6fbbcbad69b 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/ParentSection/ParentSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section that contains the page. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs index a912a9337fc..ef3a6f5fc0b 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/Item/Preview/PreviewRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function preview"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotepage-id", description: "key: id of onenotePage")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenotePageIdOption = new Option("--onenotepage-id", description: "key: id of onenotePage"); + onenotePageIdOption.IsRequired = true; + command.AddOption(onenotePageIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenotePageId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenotePageId)) requestInfo.PathParameters.Add("onenotePage_id", onenotePageId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs index fb7ca6d3ad3..dc429a6c598 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/Pages/PagesRequestBuilder.cs @@ -41,16 +41,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,28 +74,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of pages in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index acc63b53ce2..cf25ec952a9 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 092183a7670..6cff92d2c62 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index 0cc388ddde3..da51500c138 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs index 93ec515c144..3c711204cb9 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index 1eafd2de1d9..4c9c08f009e 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index 6c3e1733020..fc08870e276 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,18 +55,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -98,18 +112,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs index 1c4805544d4..1416933a2ca 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, sectionGroupId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, sectionGroupId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, sectionGroupId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--sectiongroup-id1", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var sectionGroupId1Option = new Option("--sectiongroup-id1", description: "key: id of sectionGroup"); + sectionGroupId1Option.IsRequired = true; + command.AddOption(sectionGroupId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, sectionGroupId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(sectionGroupId1)) requestInfo.PathParameters.Add("sectionGroup_id1", sectionGroupId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs index ab5eb6a4053..a5695049c17 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index e3dad43430a..99fa5dad226 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 896a9f8b024..d78666dfc2d 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,20 +26,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs index 9e79c0ea44b..64c60d95268 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,20 +68,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,20 +111,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs index 0a7822bb0b3..474057e0b5c 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/Item/Sections/SectionsRequestBuilder.cs @@ -38,18 +38,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,30 +74,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index f4f3eb30f37..0e6fe76929a 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -40,16 +40,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,28 +73,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 7ae75b5f530..e89a7e6a96c 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 64131a1c9bf..44536dcf042 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index d6af704e8d0..f3fc5529ca3 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs index 83cd7b322a3..e216fc949be 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs index f009f552ced..a09e62d78da 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/CopyNotebook/CopyNotebookRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs index 5f02c3c3d9d..42cee78320b 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/ParentNotebookRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The notebook that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs index b091731212f..7bebcfd634f 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs index 6c397e755a8..2074ec10232 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index e23d2bcc86b..e8b8e90d63d 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index c61a134ceb4..00124546cd4 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs index 976a73aada5..7e84752d648 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs index 33ef49eece3..3876b20f19c 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentNotebook/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the notebook. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index b59585dc0d9..93fb069f113 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section group. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs index f7372eca5fa..128ae5680ed 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/ParentSectionGroupRequestBuilder.cs @@ -29,12 +29,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,16 +51,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,16 +111,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section group that contains the section. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs index 02c6094eb24..516f5bf727b 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/Item/SectionGroupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--sectiongroup-id", description: "key: id of sectionGroup")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var sectionGroupIdOption = new Option("--sectiongroup-id", description: "key: id of sectionGroup"); + sectionGroupIdOption.IsRequired = true; + command.AddOption(sectionGroupIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, sectionGroupId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(sectionGroupId)) requestInfo.PathParameters.Add("sectionGroup_id", sectionGroupId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs index 22f1fc4d2da..fa7913318b6 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/SectionGroups/SectionGroupsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The section groups in the section. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs index 6679676c4dd..7bde8744d89 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToNotebook/CopyToNotebookRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToNotebook"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs index 48b8ea0cfad..1ad23dfe54a 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/CopyToSectionGroup/CopyToSectionGroupRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copyToSectionGroup"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs index 0366e002bb2..2f531b87177 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/Item/OnenoteSectionRequestBuilder.cs @@ -40,14 +40,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,18 +105,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--onenotesection-id1", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var onenoteSectionId1Option = new Option("--onenotesection-id1", description: "key: id of onenoteSection"); + onenoteSectionId1Option.IsRequired = true; + command.AddOption(onenoteSectionId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, onenoteSectionId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - if (!String.IsNullOrEmpty(onenoteSectionId1)) requestInfo.PathParameters.Add("onenoteSection_id1", onenoteSectionId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs index 648565013a0..4d2ea551922 100644 --- a/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/Item/ParentSectionGroup/Sections/SectionsRequestBuilder.cs @@ -38,16 +38,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,28 +71,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in the section group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onenotesection-id", description: "key: id of onenoteSection")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onenoteSectionId)) requestInfo.PathParameters.Add("onenoteSection_id", onenoteSectionId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onenoteSectionIdOption = new Option("--onenotesection-id", description: "key: id of onenoteSection"); + onenoteSectionIdOption.IsRequired = true; + command.AddOption(onenoteSectionIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onenoteSectionId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Onenote/Sections/SectionsRequestBuilder.cs b/src/generated/Users/Item/Onenote/Sections/SectionsRequestBuilder.cs index dca94a68a4e..7b29c227a18 100644 --- a/src/generated/Users/Item/Onenote/Sections/SectionsRequestBuilder.cs +++ b/src/generated/Users/Item/Onenote/Sections/SectionsRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,26 +71,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/OnlineMeetings/CreateOrGet/CreateOrGetRequestBuilder.cs b/src/generated/Users/Item/OnlineMeetings/CreateOrGet/CreateOrGetRequestBuilder.cs index 2919d72d8f1..8d27cd6082d 100644 --- a/src/generated/Users/Item/OnlineMeetings/CreateOrGet/CreateOrGetRequestBuilder.cs +++ b/src/generated/Users/Item/OnlineMeetings/CreateOrGet/CreateOrGetRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createOrGet"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/AttendanceReportsRequestBuilder.cs b/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/AttendanceReportsRequestBuilder.cs new file mode 100644 index 00000000000..12a5ab6bfb1 --- /dev/null +++ b/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/AttendanceReportsRequestBuilder.cs @@ -0,0 +1,225 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Users.Item.OnlineMeetings.Item.AttendanceReports.Item; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Users.Item.OnlineMeetings.Item.AttendanceReports { + /// Builds and executes requests for operations under \users\{user-id}\onlineMeetings\{onlineMeeting-id}\attendanceReports + public class AttendanceReportsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new MeetingAttendanceReportRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildAttendanceRecordsCommand(), + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new AttendanceReportsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AttendanceReportsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/users/{user_id}/onlineMeetings/{onlineMeeting_id}/attendanceReports{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(MeetingAttendanceReport body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(MeetingAttendanceReport model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// The attendance reports of an online meeting. Read-only. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/AttendanceReportsResponse.cs b/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/AttendanceReportsResponse.cs new file mode 100644 index 00000000000..417bd5817f5 --- /dev/null +++ b/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/AttendanceReportsResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Users.Item.OnlineMeetings.Item.AttendanceReports { + public class AttendanceReportsResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new attendanceReportsResponse and sets the default values. + /// + public AttendanceReportsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as AttendanceReportsResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as AttendanceReportsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsRequestBuilder.cs b/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsRequestBuilder.cs new file mode 100644 index 00000000000..e3552b68b7c --- /dev/null +++ b/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsRequestBuilder.cs @@ -0,0 +1,230 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Users.Item.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords.Item; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Users.Item.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords { + /// Builds and executes requests for operations under \users\{user-id}\onlineMeetings\{onlineMeeting-id}\attendanceReports\{meetingAttendanceReport-id}\attendanceRecords + public class AttendanceRecordsRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public List BuildCommand() { + var builder = new AttendanceRecordRequestBuilder(PathParameters, RequestAdapter); + var commands = new List { + builder.BuildDeleteCommand(), + builder.BuildGetCommand(), + builder.BuildPatchCommand(), + }; + return commands; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildCreateCommand() { + var command = new Command("create"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, meetingAttendanceReportId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePostRequestInformation(model, q => { + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildListCommand() { + var command = new Command("list"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, meetingAttendanceReportId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// Instantiates a new AttendanceRecordsRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AttendanceRecordsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/users/{user_id}/onlineMeetings/{onlineMeeting_id}/attendanceReports/{meetingAttendanceReport_id}/attendanceRecords{?top,skip,search,filter,count,orderby,select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePostRequestInformation(AttendanceRecord body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PostAsync(AttendanceRecord model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePostRequestInformation(model, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// List of attendance records of an attendance report. Read-only. + public class GetQueryParameters : QueryParametersBase { + /// Include count of items + public bool? Count { get; set; } + /// Expand related entities + public string[] Expand { get; set; } + /// Filter items by property values + public string Filter { get; set; } + /// Order items by property values + public string[] Orderby { get; set; } + /// Search items by search phrases + public string Search { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + /// Skip the first n items + public int? Skip { get; set; } + /// Show only the first n items + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsResponse.cs b/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsResponse.cs new file mode 100644 index 00000000000..6154c70b7e6 --- /dev/null +++ b/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/AttendanceRecordsResponse.cs @@ -0,0 +1,39 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace ApiSdk.Users.Item.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords { + public class AttendanceRecordsResponse : IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + public string NextLink { get; set; } + public List Value { get; set; } + /// + /// Instantiates a new attendanceRecordsResponse and sets the default values. + /// + public AttendanceRecordsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// The deserialization information for the current model + /// + public IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"@odata.nextLink", (o,n) => { (o as AttendanceRecordsResponse).NextLink = n.GetStringValue(); } }, + {"value", (o,n) => { (o as AttendanceRecordsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// Serialization writer to use to serialize this model + /// + public void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.nextLink", NextLink); + writer.WriteCollectionOfObjectValues("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/Item/AttendanceRecordRequestBuilder.cs b/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/Item/AttendanceRecordRequestBuilder.cs new file mode 100644 index 00000000000..7f1cd920dd9 --- /dev/null +++ b/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/Item/AttendanceRecords/Item/AttendanceRecordRequestBuilder.cs @@ -0,0 +1,238 @@ +using ApiSdk.Models.Microsoft.Graph; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Users.Item.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords.Item { + /// Builds and executes requests for operations under \users\{user-id}\onlineMeetings\{onlineMeeting-id}\attendanceReports\{meetingAttendanceReport-id}\attendanceRecords\{attendanceRecord-id} + public class AttendanceRecordRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var attendanceRecordIdOption = new Option("--attendancerecord-id", description: "key: id of attendanceRecord"); + attendanceRecordIdOption.IsRequired = true; + command.AddOption(attendanceRecordIdOption); + command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, meetingAttendanceReportId, attendanceRecordId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var attendanceRecordIdOption = new Option("--attendancerecord-id", description: "key: id of attendanceRecord"); + attendanceRecordIdOption.IsRequired = true; + command.AddOption(attendanceRecordIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, meetingAttendanceReportId, attendanceRecordId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "List of attendance records of an attendance report. Read-only."; + // Create options for all the parameters + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var attendanceRecordIdOption = new Option("--attendancerecord-id", description: "key: id of attendanceRecord"); + attendanceRecordIdOption.IsRequired = true; + command.AddOption(attendanceRecordIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, meetingAttendanceReportId, attendanceRecordId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new AttendanceRecordRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public AttendanceRecordRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/users/{user_id}/onlineMeetings/{onlineMeeting_id}/attendanceReports/{meetingAttendanceReport_id}/attendanceRecords/{attendanceRecord_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(AttendanceRecord body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// List of attendance records of an attendance report. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(AttendanceRecord model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// List of attendance records of an attendance report. Read-only. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/Item/MeetingAttendanceReportRequestBuilder.cs b/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/Item/MeetingAttendanceReportRequestBuilder.cs new file mode 100644 index 00000000000..81b7ff11740 --- /dev/null +++ b/src/generated/Users/Item/OnlineMeetings/Item/AttendanceReports/Item/MeetingAttendanceReportRequestBuilder.cs @@ -0,0 +1,237 @@ +using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Users.Item.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Serialization; +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +namespace ApiSdk.Users.Item.OnlineMeetings.Item.AttendanceReports.Item { + /// Builds and executes requests for operations under \users\{user-id}\onlineMeetings\{onlineMeeting-id}\attendanceReports\{meetingAttendanceReport-id} + public class MeetingAttendanceReportRequestBuilder { + /// Path parameters for the request + private Dictionary PathParameters { get; set; } + /// The request adapter to use to execute the requests. + private IRequestAdapter RequestAdapter { get; set; } + /// Url template to use to build the URL for the current request builder + private string UrlTemplate { get; set; } + public Command BuildAttendanceRecordsCommand() { + var command = new Command("attendance-records"); + var builder = new ApiSdk.Users.Item.OnlineMeetings.Item.AttendanceReports.Item.AttendanceRecords.AttendanceRecordsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildDeleteCommand() { + var command = new Command("delete"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, meetingAttendanceReportId) => { + var requestInfo = CreateDeleteRequestInformation(q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildGetCommand() { + var command = new Command("get"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, meetingAttendanceReportId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); + var result = await RequestAdapter.SendAsync(requestInfo); + // Print request output. What if the request has no return? + using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); + serializer.WriteObjectValue(null, result); + using var content = serializer.GetSerializedContent(); + using var reader = new StreamReader(content); + var strContent = await reader.ReadToEndAsync(); + Console.Write(strContent + "\n"); + }); + return command; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + public Command BuildPatchCommand() { + var command = new Command("patch"); + command.Description = "The attendance reports of an online meeting. Read-only."; + // Create options for all the parameters + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var meetingAttendanceReportIdOption = new Option("--meetingattendancereport-id", description: "key: id of meetingAttendanceReport"); + meetingAttendanceReportIdOption.IsRequired = true; + command.AddOption(meetingAttendanceReportIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, meetingAttendanceReportId, body) => { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); + await RequestAdapter.SendNoContentAsync(requestInfo); + // Print request output. What if the request has no return? + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new MeetingAttendanceReportRequestBuilder and sets the default values. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// + public MeetingAttendanceReportRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); + _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + UrlTemplate = "{+baseurl}/users/{user_id}/onlineMeetings/{onlineMeeting_id}/attendanceReports/{meetingAttendanceReport_id}{?select,expand}"; + var urlTplParams = new Dictionary(pathParameters); + PathParameters = urlTplParams; + RequestAdapter = requestAdapter; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Request headers + /// Request options + /// + public RequestInformation CreateDeleteRequestInformation(Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Request headers + /// Request options + /// Request query parameters + /// + public RequestInformation CreateGetRequestInformation(Action q = default, Action> h = default, IEnumerable o = default) { + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (q != null) { + var qParams = new GetQueryParameters(); + q.Invoke(qParams); + qParams.AddQueryParameters(requestInfo.QueryParameters); + } + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// + /// Request headers + /// Request options + /// + public RequestInformation CreatePatchRequestInformation(MeetingAttendanceReport body, Action> h = default, IEnumerable o = default) { + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = HttpMethod.PATCH, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + h?.Invoke(requestInfo.Headers); + requestInfo.AddRequestOptions(o?.ToArray()); + return requestInfo; + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateDeleteRequestInformation(h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// Request options + /// Request query parameters + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + var requestInfo = CreateGetRequestInformation(q, h, o); + return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + } + /// + /// The attendance reports of an online meeting. Read-only. + /// Cancellation token to use when cancelling requests + /// Request headers + /// + /// Request options + /// Response handler to use in place of the default response handling provided by the core service + /// + public async Task PatchAsync(MeetingAttendanceReport model, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { + _ = model ?? throw new ArgumentNullException(nameof(model)); + var requestInfo = CreatePatchRequestInformation(model, h, o); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + } + /// The attendance reports of an online meeting. Read-only. + public class GetQueryParameters : QueryParametersBase { + /// Expand related entities + public string[] Expand { get; set; } + /// Select properties to be returned + public string[] Select { get; set; } + } + } +} diff --git a/src/generated/Users/Item/OnlineMeetings/Item/AttendeeReport/AttendeeReportRequestBuilder.cs b/src/generated/Users/Item/OnlineMeetings/Item/AttendeeReport/AttendeeReportRequestBuilder.cs index 97bfb8b3e00..736b85204cd 100644 --- a/src/generated/Users/Item/OnlineMeetings/Item/AttendeeReport/AttendeeReportRequestBuilder.cs +++ b/src/generated/Users/Item/OnlineMeetings/Item/AttendeeReport/AttendeeReportRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property onlineMeetings from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property onlineMeetings in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/OnlineMeetings/Item/OnlineMeetingRequestBuilder.cs b/src/generated/Users/Item/OnlineMeetings/Item/OnlineMeetingRequestBuilder.cs index 8ffc63ce1da..11a6f995821 100644 --- a/src/generated/Users/Item/OnlineMeetings/Item/OnlineMeetingRequestBuilder.cs +++ b/src/generated/Users/Item/OnlineMeetings/Item/OnlineMeetingRequestBuilder.cs @@ -1,4 +1,5 @@ using ApiSdk.Models.Microsoft.Graph; +using ApiSdk.Users.Item.OnlineMeetings.Item.AttendanceReports; using ApiSdk.Users.Item.OnlineMeetings.Item.AttendeeReport; using Microsoft.Kiota.Abstractions; using Microsoft.Kiota.Abstractions.Serialization; @@ -20,6 +21,13 @@ public class OnlineMeetingRequestBuilder { private IRequestAdapter RequestAdapter { get; set; } /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } + public Command BuildAttendanceReportsCommand() { + var command = new Command("attendance-reports"); + var builder = new ApiSdk.Users.Item.OnlineMeetings.Item.AttendanceReports.AttendanceReportsRequestBuilder(PathParameters, RequestAdapter); + command.AddCommand(builder.BuildCreateCommand()); + command.AddCommand(builder.BuildListCommand()); + return command; + } public Command BuildAttendeeReportCommand() { var command = new Command("attendee-report"); var builder = new ApiSdk.Users.Item.OnlineMeetings.Item.AttendeeReport.AttendeeReportRequestBuilder(PathParameters, RequestAdapter); @@ -34,12 +42,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property onlineMeetings for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); command.Handler = CommandHandler.Create(async (userId, onlineMeetingId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +64,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get onlineMeetings from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +101,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property onlineMeetings in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--onlinemeeting-id", description: "key: id of onlineMeeting")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var onlineMeetingIdOption = new Option("--onlinemeeting-id", description: "key: id of onlineMeeting"); + onlineMeetingIdOption.IsRequired = true; + command.AddOption(onlineMeetingIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, onlineMeetingId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(onlineMeetingId)) requestInfo.PathParameters.Add("onlineMeeting_id", onlineMeetingId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/OnlineMeetings/OnlineMeetingsRequestBuilder.cs b/src/generated/Users/Item/OnlineMeetings/OnlineMeetingsRequestBuilder.cs index 62b07e35422..864c7c80cbc 100644 --- a/src/generated/Users/Item/OnlineMeetings/OnlineMeetingsRequestBuilder.cs +++ b/src/generated/Users/Item/OnlineMeetings/OnlineMeetingsRequestBuilder.cs @@ -24,6 +24,7 @@ public class OnlineMeetingsRequestBuilder { public List BuildCommand() { var builder = new OnlineMeetingRequestBuilder(PathParameters, RequestAdapter); var commands = new List { + builder.BuildAttendanceReportsCommand(), builder.BuildAttendeeReportCommand(), builder.BuildDeleteCommand(), builder.BuildGetCommand(), @@ -38,14 +39,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to onlineMeetings for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,26 +75,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get onlineMeetings from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Outlook/MasterCategories/Item/OutlookCategoryRequestBuilder.cs b/src/generated/Users/Item/Outlook/MasterCategories/Item/OutlookCategoryRequestBuilder.cs index 9653a6e5620..a586748d2d5 100644 --- a/src/generated/Users/Item/Outlook/MasterCategories/Item/OutlookCategoryRequestBuilder.cs +++ b/src/generated/Users/Item/Outlook/MasterCategories/Item/OutlookCategoryRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A list of categories defined for the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--outlookcategory-id", description: "key: id of outlookCategory")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var outlookCategoryIdOption = new Option("--outlookcategory-id", description: "key: id of outlookCategory"); + outlookCategoryIdOption.IsRequired = true; + command.AddOption(outlookCategoryIdOption); command.Handler = CommandHandler.Create(async (userId, outlookCategoryId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(outlookCategoryId)) requestInfo.PathParameters.Add("outlookCategory_id", outlookCategoryId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +48,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A list of categories defined for the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--outlookcategory-id", description: "key: id of outlookCategory")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, outlookCategoryId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(outlookCategoryId)) requestInfo.PathParameters.Add("outlookCategory_id", outlookCategoryId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var outlookCategoryIdOption = new Option("--outlookcategory-id", description: "key: id of outlookCategory"); + outlookCategoryIdOption.IsRequired = true; + command.AddOption(outlookCategoryIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, outlookCategoryId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,16 +80,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A list of categories defined for the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--outlookcategory-id", description: "key: id of outlookCategory")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var outlookCategoryIdOption = new Option("--outlookcategory-id", description: "key: id of outlookCategory"); + outlookCategoryIdOption.IsRequired = true; + command.AddOption(outlookCategoryIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, outlookCategoryId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(outlookCategoryId)) requestInfo.PathParameters.Add("outlookCategory_id", outlookCategoryId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Outlook/MasterCategories/MasterCategoriesRequestBuilder.cs b/src/generated/Users/Item/Outlook/MasterCategories/MasterCategoriesRequestBuilder.cs index 872f4e27db0..dd46714dfde 100644 --- a/src/generated/Users/Item/Outlook/MasterCategories/MasterCategoriesRequestBuilder.cs +++ b/src/generated/Users/Item/Outlook/MasterCategories/MasterCategoriesRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A list of categories defined for the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,22 +66,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A list of categories defined for the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Outlook/OutlookRequestBuilder.cs b/src/generated/Users/Item/Outlook/OutlookRequestBuilder.cs index ba686be75cb..21f53e77b16 100644 --- a/src/generated/Users/Item/Outlook/OutlookRequestBuilder.cs +++ b/src/generated/Users/Item/Outlook/OutlookRequestBuilder.cs @@ -24,16 +24,18 @@ public class OutlookRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only."; + command.Description = "Selective Outlook services available to the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -41,18 +43,23 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only."; + command.Description = "Selective Outlook services available to the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,20 +79,24 @@ public Command BuildMasterCategoriesCommand() { return command; } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only."; + command.Description = "Selective Outlook services available to the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -106,7 +117,7 @@ public OutlookRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// Request headers /// Request options /// @@ -121,7 +132,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -142,7 +153,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// /// Request headers /// Request options @@ -160,7 +171,7 @@ public RequestInformation CreatePatchRequestInformation(OutlookUser body, Action return requestInfo; } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -171,7 +182,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -183,7 +194,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -215,7 +226,7 @@ public SupportedTimeZonesWithTimeZoneStandardRequestBuilder SupportedTimeZonesWi if(string.IsNullOrEmpty(timeZoneStandard)) throw new ArgumentNullException(nameof(timeZoneStandard)); return new SupportedTimeZonesWithTimeZoneStandardRequestBuilder(PathParameters, RequestAdapter, timeZoneStandard); } - /// Read-only. + /// Selective Outlook services available to the user. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Select properties to be returned public string[] Select { get; set; } diff --git a/src/generated/Users/Item/Outlook/SupportedLanguages/SupportedLanguagesRequestBuilder.cs b/src/generated/Users/Item/Outlook/SupportedLanguages/SupportedLanguagesRequestBuilder.cs index 8d12df8e4c4..485d681d95a 100644 --- a/src/generated/Users/Item/Outlook/SupportedLanguages/SupportedLanguagesRequestBuilder.cs +++ b/src/generated/Users/Item/Outlook/SupportedLanguages/SupportedLanguagesRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function supportedLanguages"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Outlook/SupportedTimeZones/SupportedTimeZonesRequestBuilder.cs b/src/generated/Users/Item/Outlook/SupportedTimeZones/SupportedTimeZonesRequestBuilder.cs index afe169bc529..70d08864601 100644 --- a/src/generated/Users/Item/Outlook/SupportedTimeZones/SupportedTimeZonesRequestBuilder.cs +++ b/src/generated/Users/Item/Outlook/SupportedTimeZones/SupportedTimeZonesRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function supportedTimeZones"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Outlook/SupportedTimeZonesWithTimeZoneStandard/SupportedTimeZonesWithTimeZoneStandardRequestBuilder.cs b/src/generated/Users/Item/Outlook/SupportedTimeZonesWithTimeZoneStandard/SupportedTimeZonesWithTimeZoneStandardRequestBuilder.cs index 61bb63aad4d..58ce3f62eaa 100644 --- a/src/generated/Users/Item/Outlook/SupportedTimeZonesWithTimeZoneStandard/SupportedTimeZonesWithTimeZoneStandardRequestBuilder.cs +++ b/src/generated/Users/Item/Outlook/SupportedTimeZonesWithTimeZoneStandard/SupportedTimeZonesWithTimeZoneStandardRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function supportedTimeZones"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--timezonestandard", description: "Usage: TimeZoneStandard={TimeZoneStandard}")); - command.Handler = CommandHandler.Create(async (userId, TimeZoneStandard) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(TimeZoneStandard)) requestInfo.PathParameters.Add("TimeZoneStandard", TimeZoneStandard); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var TimeZoneStandardOption = new Option("--timezonestandard", description: "Usage: TimeZoneStandard={TimeZoneStandard}"); + TimeZoneStandardOption.IsRequired = true; + command.AddOption(TimeZoneStandardOption); + command.Handler = CommandHandler.Create(async (userId, TimeZoneStandard) => { + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/OwnedDevices/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/OwnedDevices/@Ref/RefRequestBuilder.cs index 7157c3e7c6b..cca88287be8 100644 --- a/src/generated/Users/Item/OwnedDevices/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/OwnedDevices/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Devices that are owned by the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Devices that are owned by the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/OwnedDevices/OwnedDevicesRequestBuilder.cs b/src/generated/Users/Item/OwnedDevices/OwnedDevicesRequestBuilder.cs index 89b7bdeebb0..4066d1039ad 100644 --- a/src/generated/Users/Item/OwnedDevices/OwnedDevicesRequestBuilder.cs +++ b/src/generated/Users/Item/OwnedDevices/OwnedDevicesRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Devices that are owned by the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/OwnedObjects/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/OwnedObjects/@Ref/RefRequestBuilder.cs index fdcf311702f..6fd956a1ec2 100644 --- a/src/generated/Users/Item/OwnedObjects/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/OwnedObjects/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects that are owned by the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Directory objects that are owned by the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/OwnedObjects/OwnedObjectsRequestBuilder.cs b/src/generated/Users/Item/OwnedObjects/OwnedObjectsRequestBuilder.cs index 0630fa311f5..c98595a98ac 100644 --- a/src/generated/Users/Item/OwnedObjects/OwnedObjectsRequestBuilder.cs +++ b/src/generated/Users/Item/OwnedObjects/OwnedObjectsRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Directory objects that are owned by the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/People/Item/PersonRequestBuilder.cs b/src/generated/Users/Item/People/Item/PersonRequestBuilder.cs index fb718b9f77a..e0da13bd90d 100644 --- a/src/generated/Users/Item/People/Item/PersonRequestBuilder.cs +++ b/src/generated/Users/Item/People/Item/PersonRequestBuilder.cs @@ -20,18 +20,21 @@ public class PersonRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "People that are relevant to the user. Read-only. Nullable."; + command.Description = "Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--person-id", description: "key: id of person")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var personIdOption = new Option("--person-id", description: "key: id of person"); + personIdOption.IsRequired = true; + command.AddOption(personIdOption); command.Handler = CommandHandler.Create(async (userId, personId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(personId)) requestInfo.PathParameters.Add("person_id", personId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,20 +42,26 @@ public Command BuildDeleteCommand() { return command; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "People that are relevant to the user. Read-only. Nullable."; + command.Description = "Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--person-id", description: "key: id of person")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, personId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(personId)) requestInfo.PathParameters.Add("person_id", personId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var personIdOption = new Option("--person-id", description: "key: id of person"); + personIdOption.IsRequired = true; + command.AddOption(personIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, personId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,22 +74,27 @@ public Command BuildGetCommand() { return command; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "People that are relevant to the user. Read-only. Nullable."; + command.Description = "Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--person-id", description: "key: id of person")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var personIdOption = new Option("--person-id", description: "key: id of person"); + personIdOption.IsRequired = true; + command.AddOption(personIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, personId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(personId)) requestInfo.PathParameters.Add("person_id", personId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -101,7 +115,7 @@ public PersonRequestBuilder(Dictionary pathParameters, IRequestA RequestAdapter = requestAdapter; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Request headers /// Request options /// @@ -116,7 +130,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Request headers /// Request options /// Request query parameters @@ -137,7 +151,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// /// Request headers /// Request options @@ -155,7 +169,7 @@ public RequestInformation CreatePatchRequestInformation(Person body, Action - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -166,7 +180,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -178,7 +192,7 @@ public async Task GetAsync(Action q = default, Actio return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -190,7 +204,7 @@ public async Task PatchAsync(Person model, Action> h var requestInfo = CreatePatchRequestInformation(model, h, o); await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. public class GetQueryParameters : QueryParametersBase { /// Select properties to be returned public string[] Select { get; set; } diff --git a/src/generated/Users/Item/People/PeopleRequestBuilder.cs b/src/generated/Users/Item/People/PeopleRequestBuilder.cs index 1b75c710fe0..f458c1ba0c7 100644 --- a/src/generated/Users/Item/People/PeopleRequestBuilder.cs +++ b/src/generated/Users/Item/People/PeopleRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "People that are relevant to the user. Read-only. Nullable."; + command.Description = "Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,30 +60,48 @@ public Command BuildCreateCommand() { return command; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "People that are relevant to the user. Read-only. Nullable."; + command.Description = "Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -105,7 +127,7 @@ public PeopleRequestBuilder(Dictionary pathParameters, IRequestA RequestAdapter = requestAdapter; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Request headers /// Request options /// Request query parameters @@ -126,7 +148,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// /// Request headers /// Request options @@ -144,7 +166,7 @@ public RequestInformation CreatePostRequestInformation(Person body, Action - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -156,7 +178,7 @@ public async Task GetAsync(Action q = defaul return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -168,7 +190,7 @@ public async Task PostAsync(Person model, Action(requestInfo, responseHandler, cancellationToken); } - /// People that are relevant to the user. Read-only. Nullable. + /// Read-only. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Users/Item/Photo/PhotoRequestBuilder.cs b/src/generated/Users/Item/Photo/PhotoRequestBuilder.cs index c03d4265ce1..ef411e69f23 100644 --- a/src/generated/Users/Item/Photo/PhotoRequestBuilder.cs +++ b/src/generated/Users/Item/Photo/PhotoRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,12 +53,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,14 +82,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Photo/Value/ContentRequestBuilder.cs b/src/generated/Users/Item/Photo/Value/ContentRequestBuilder.cs index 96e817bb742..0652b1cb6eb 100644 --- a/src/generated/Users/Item/Photo/Value/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/Photo/Value/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The user's profile photo. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Photos/Item/ProfilePhotoRequestBuilder.cs b/src/generated/Users/Item/Photos/Item/ProfilePhotoRequestBuilder.cs index 842ae1466b2..ef45ff03c79 100644 --- a/src/generated/Users/Item/Photos/Item/ProfilePhotoRequestBuilder.cs +++ b/src/generated/Users/Item/Photos/Item/ProfilePhotoRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); command.Handler = CommandHandler.Create(async (userId, profilePhotoId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,14 +56,20 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, profilePhotoId, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, profilePhotoId, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,16 +88,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, profilePhotoId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Photos/Item/Value/ContentRequestBuilder.cs b/src/generated/Users/Item/Photos/Item/Value/ContentRequestBuilder.cs index 0c0f01953bc..250b88984c7 100644 --- a/src/generated/Users/Item/Photos/Item/Value/ContentRequestBuilder.cs +++ b/src/generated/Users/Item/Photos/Item/Value/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get media content for the navigation property photos from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (userId, profilePhotoId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Update media content for the navigation property photos in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--profilephoto-id", description: "key: id of profilePhoto")); - command.AddOption(new Option("--file", description: "Binary request body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var profilePhotoIdOption = new Option("--profilephoto-id", description: "key: id of profilePhoto"); + profilePhotoIdOption.IsRequired = true; + command.AddOption(profilePhotoIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (userId, profilePhotoId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(profilePhotoId)) requestInfo.PathParameters.Add("profilePhoto_id", profilePhotoId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Photos/PhotosRequestBuilder.cs b/src/generated/Users/Item/Photos/PhotosRequestBuilder.cs index 243f46421be..3cfe0f77ce3 100644 --- a/src/generated/Users/Item/Photos/PhotosRequestBuilder.cs +++ b/src/generated/Users/Item/Photos/PhotosRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,22 +67,38 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, filter, count, orderby, select) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Planner/PlannerRequestBuilder.cs b/src/generated/Users/Item/Planner/PlannerRequestBuilder.cs index 54da869d3c2..5c8c5eb5ad0 100644 --- a/src/generated/Users/Item/Planner/PlannerRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/PlannerRequestBuilder.cs @@ -22,16 +22,18 @@ public class PlannerRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Entry-point to the Planner resource that might exist for a user. Read-only."; + command.Description = "Selective Planner services available to the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,20 +41,28 @@ public Command BuildDeleteCommand() { return command; } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Entry-point to the Planner resource that might exist for a user. Read-only."; + command.Description = "Selective Planner services available to the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,20 +75,24 @@ public Command BuildGetCommand() { return command; } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Entry-point to the Planner resource that might exist for a user. Read-only."; + command.Description = "Selective Planner services available to the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -113,7 +127,7 @@ public PlannerRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// Request headers /// Request options /// @@ -128,7 +142,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -149,7 +163,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// /// Request headers /// Request options @@ -167,7 +181,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerUser body, Action return requestInfo; } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -178,7 +192,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -190,7 +204,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Entry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -202,7 +216,7 @@ public async Task PatchAsync(PlannerUser model, ActionEntry-point to the Planner resource that might exist for a user. Read-only. + /// Selective Planner services available to the user. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Users/Item/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs index 81901266478..22b4487276c 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Buckets/BucketsRequestBuilder.cs @@ -31,22 +31,27 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,34 +64,56 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -112,7 +139,7 @@ public BucketsRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -133,7 +160,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -151,7 +178,7 @@ public RequestInformation CreatePostRequestInformation(PlannerBucket body, Actio return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -163,7 +190,7 @@ public async Task GetAsync(Action q = defau return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -175,7 +202,7 @@ public async Task PostAsync(PlannerBucket model, Action(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs index 14921583829..7db7324fdfa 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/PlannerBucketRequestBuilder.cs @@ -21,20 +21,24 @@ public class PlannerBucketRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,24 +46,34 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -72,24 +86,30 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Collection of buckets in the plan."; + command.Description = "Collection of buckets in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -117,7 +137,7 @@ public PlannerBucketRequestBuilder(Dictionary pathParameters, IR RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Request headers /// Request options /// @@ -132,7 +152,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -153,7 +173,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -171,7 +191,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerBucket body, Acti return requestInfo; } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -182,7 +202,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -194,7 +214,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -206,7 +226,7 @@ public async Task PatchAsync(PlannerBucket model, ActionRead-only. Nullable. Collection of buckets in the plan. + /// Collection of buckets in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs index d7cf8fad621..4f8bbbbc525 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs index dc1cf387199..3dedb20cadf 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs index d58ea061e86..39c641158c2 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/Details/DetailsRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs index 9724abe7e42..a52dc115db1 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/PlannerTaskRequestBuilder.cs @@ -46,16 +46,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -77,20 +82,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,20 +125,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs index b7ba8d41dfe..03db9732480 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs index 8e4816a3cdc..ec69f45307e 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Buckets/Item/Tasks/TasksRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,30 +76,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable. The collection of tasks in the bucket."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannerbucket-id", description: "key: id of plannerBucket")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerBucketId)) requestInfo.PathParameters.Add("plannerBucket_id", plannerBucketId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerBucketIdOption = new Option("--plannerbucket-id", description: "key: id of plannerBucket"); + plannerBucketIdOption.IsRequired = true; + command.AddOption(plannerBucketIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerBucketId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Planner/Plans/Item/Details/DetailsRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Details/DetailsRequestBuilder.cs index 576600ac664..f12a3a13ebb 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Details/DetailsRequestBuilder.cs @@ -20,18 +20,21 @@ public class DetailsRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Additional details about the plan."; + command.Description = "Additional details about the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Additional details about the plan."; + command.Description = "Additional details about the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Additional details about the plan."; + command.Description = "Additional details about the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public DetailsRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerPlanDetails body, return requestInfo; } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = de return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(PlannerPlanDetails model, ActionRead-only. Nullable. Additional details about the plan. + /// Additional details about the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Users/Item/Planner/Plans/Item/PlannerPlanRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/PlannerPlanRequestBuilder.cs index 6824382299b..aee64581b68 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/PlannerPlanRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/PlannerPlanRequestBuilder.cs @@ -36,12 +36,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,16 +66,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -91,16 +103,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs index fbffa987478..a5bc5887330 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs index b7d9ce18cd7..5256c5b6218 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs index 46a16f50ad8..0587ad3123e 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/Details/DetailsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs index 5363b4b868e..5ae12f2cfd6 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/PlannerTaskRequestBuilder.cs @@ -40,20 +40,24 @@ public Command BuildBucketTaskBoardFormatCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -69,24 +73,34 @@ public Command BuildDetailsCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,24 +113,30 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -145,7 +165,7 @@ public PlannerTaskRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Request headers /// Request options /// @@ -160,7 +180,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -181,7 +201,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -199,7 +219,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerTask body, Action return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -210,7 +230,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -222,7 +242,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -234,7 +254,7 @@ public async Task PatchAsync(PlannerTask model, ActionRead-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs index 8dfc9ce5147..f5c49350d55 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs index 74fde8a1991..cc38ced3ad5 100644 --- a/src/generated/Users/Item/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/Item/Tasks/TasksRequestBuilder.cs @@ -34,22 +34,27 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerPlanId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,34 +67,56 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable. Collection of tasks in the plan."; + command.Description = "Collection of tasks in the plan. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannerplan-id", description: "key: id of plannerPlan")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerPlanId)) requestInfo.PathParameters.Add("plannerPlan_id", plannerPlanId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerPlanIdOption = new Option("--plannerplan-id", description: "key: id of plannerPlan"); + plannerPlanIdOption.IsRequired = true; + command.AddOption(plannerPlanIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerPlanId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -115,7 +142,7 @@ public TasksRequestBuilder(Dictionary pathParameters, IRequestAd RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -136,7 +163,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// /// Request headers /// Request options @@ -154,7 +181,7 @@ public RequestInformation CreatePostRequestInformation(PlannerTask body, Action< return requestInfo; } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -166,7 +193,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -178,7 +205,7 @@ public async Task PostAsync(PlannerTask model, Action(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. Collection of tasks in the plan. + /// Collection of tasks in the plan. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Users/Item/Planner/Plans/PlansRequestBuilder.cs b/src/generated/Users/Item/Planner/Plans/PlansRequestBuilder.cs index 562cc41dcc9..dc6b892191e 100644 --- a/src/generated/Users/Item/Planner/Plans/PlansRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Plans/PlansRequestBuilder.cs @@ -39,14 +39,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,26 +69,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Planner/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs b/src/generated/Users/Item/Planner/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs index 216acbfef03..9183ffc8a5b 100644 --- a/src/generated/Users/Item/Planner/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Tasks/Item/AssignedToTaskBoardFormat/AssignedToTaskBoardFormatRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by assignedTo."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Planner/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs b/src/generated/Users/Item/Planner/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs index 9663b1e1171..bbc8ce52740 100644 --- a/src/generated/Users/Item/Planner/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Tasks/Item/BucketTaskBoardFormat/BucketTaskBoardFormatRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by bucket."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Planner/Tasks/Item/Details/DetailsRequestBuilder.cs b/src/generated/Users/Item/Planner/Tasks/Item/Details/DetailsRequestBuilder.cs index 46064ae7278..d0131d7cce5 100644 --- a/src/generated/Users/Item/Planner/Tasks/Item/Details/DetailsRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Tasks/Item/Details/DetailsRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Additional details about the task."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Planner/Tasks/Item/PlannerTaskRequestBuilder.cs b/src/generated/Users/Item/Planner/Tasks/Item/PlannerTaskRequestBuilder.cs index e6788f44213..5df99f6b5f2 100644 --- a/src/generated/Users/Item/Planner/Tasks/Item/PlannerTaskRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Tasks/Item/PlannerTaskRequestBuilder.cs @@ -40,18 +40,21 @@ public Command BuildBucketTaskBoardFormatCommand() { return command; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Read-only. Nullable. Returns the plannerPlans shared with the user."; + command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,22 +70,31 @@ public Command BuildDetailsCommand() { return command; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read-only. Nullable. Returns the plannerPlans shared with the user."; + command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,22 +107,27 @@ public Command BuildGetCommand() { return command; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Read-only. Nullable. Returns the plannerPlans shared with the user."; + command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -139,7 +156,7 @@ public PlannerTaskRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Request headers /// Request options /// @@ -154,7 +171,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Request headers /// Request options /// Request query parameters @@ -175,7 +192,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// /// Request headers /// Request options @@ -193,7 +210,7 @@ public RequestInformation CreatePatchRequestInformation(PlannerTask body, Action return requestInfo; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -204,7 +221,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -216,7 +233,7 @@ public async Task GetAsync(Action q = default, return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -228,7 +245,7 @@ public async Task PatchAsync(PlannerTask model, ActionRead-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Users/Item/Planner/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs b/src/generated/Users/Item/Planner/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs index 0fe2afdc7a7..3cf2b6b9bfe 100644 --- a/src/generated/Users/Item/Planner/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Tasks/Item/ProgressTaskBoardFormat/ProgressTaskBoardFormatRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); command.Handler = CommandHandler.Create(async (userId, plannerTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, plannerTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, plannerTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable. Used to render the task correctly in the task board view when grouped by progress."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--plannertask-id", description: "key: id of plannerTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var plannerTaskIdOption = new Option("--plannertask-id", description: "key: id of plannerTask"); + plannerTaskIdOption.IsRequired = true; + command.AddOption(plannerTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, plannerTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(plannerTaskId)) requestInfo.PathParameters.Add("plannerTask_id", plannerTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Planner/Tasks/TasksRequestBuilder.cs b/src/generated/Users/Item/Planner/Tasks/TasksRequestBuilder.cs index 5ddbb838bf0..6c8a738ce16 100644 --- a/src/generated/Users/Item/Planner/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Users/Item/Planner/Tasks/TasksRequestBuilder.cs @@ -34,20 +34,24 @@ public List BuildCommand() { return commands; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Read-only. Nullable. Returns the plannerPlans shared with the user."; + command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -60,32 +64,53 @@ public Command BuildCreateCommand() { return command; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Read-only. Nullable. Returns the plannerPlans shared with the user."; + command.Description = "Read-only. Nullable. Returns the plannerTasks assigned to the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -111,7 +136,7 @@ public TasksRequestBuilder(Dictionary pathParameters, IRequestAd RequestAdapter = requestAdapter; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Request headers /// Request options /// Request query parameters @@ -132,7 +157,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// /// Request headers /// Request options @@ -150,7 +175,7 @@ public RequestInformation CreatePostRequestInformation(PlannerTask body, Action< return requestInfo; } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -162,7 +187,7 @@ public async Task GetAsync(Action q = default return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -174,7 +199,7 @@ public async Task PostAsync(PlannerTask model, Action(requestInfo, responseHandler, cancellationToken); } - /// Read-only. Nullable. Returns the plannerPlans shared with the user. + /// Read-only. Nullable. Returns the plannerTasks assigned to the user. public class GetQueryParameters : QueryParametersBase { /// Include count of items public bool? Count { get; set; } diff --git a/src/generated/Users/Item/Presence/ClearPresence/ClearPresenceRequestBuilder.cs b/src/generated/Users/Item/Presence/ClearPresence/ClearPresenceRequestBuilder.cs index e1837b38ea7..f3d0cd67477 100644 --- a/src/generated/Users/Item/Presence/ClearPresence/ClearPresenceRequestBuilder.cs +++ b/src/generated/Users/Item/Presence/ClearPresence/ClearPresenceRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clearPresence"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Presence/PresenceRequestBuilder.cs b/src/generated/Users/Item/Presence/PresenceRequestBuilder.cs index 91b61c6d312..5f76f109b4a 100644 --- a/src/generated/Users/Item/Presence/PresenceRequestBuilder.cs +++ b/src/generated/Users/Item/Presence/PresenceRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property presence for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get presence from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property presence in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Presence/SetPresence/SetPresenceRequestBuilder.cs b/src/generated/Users/Item/Presence/SetPresence/SetPresenceRequestBuilder.cs index d218d1162f3..0d5120c4411 100644 --- a/src/generated/Users/Item/Presence/SetPresence/SetPresenceRequestBuilder.cs +++ b/src/generated/Users/Item/Presence/SetPresence/SetPresenceRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setPresence"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/RegisteredDevices/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/RegisteredDevices/@Ref/RefRequestBuilder.cs index 491f4985b4a..b1ff57e4e7c 100644 --- a/src/generated/Users/Item/RegisteredDevices/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/RegisteredDevices/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Devices that are registered for the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Devices that are registered for the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/RegisteredDevices/RegisteredDevicesRequestBuilder.cs b/src/generated/Users/Item/RegisteredDevices/RegisteredDevicesRequestBuilder.cs index 94f17b8c507..06390eec3b0 100644 --- a/src/generated/Users/Item/RegisteredDevices/RegisteredDevicesRequestBuilder.cs +++ b/src/generated/Users/Item/RegisteredDevices/RegisteredDevicesRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Devices that are registered for the user. Read-only. Nullable. Supports $expand."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ReminderViewWithStartDateTimeWithEndDateTime/ReminderViewWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/Users/Item/ReminderViewWithStartDateTimeWithEndDateTime/ReminderViewWithStartDateTimeWithEndDateTimeRequestBuilder.cs index fd9d8dd5f84..dbffb7a03f7 100644 --- a/src/generated/Users/Item/ReminderViewWithStartDateTimeWithEndDateTime/ReminderViewWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/Users/Item/ReminderViewWithStartDateTimeWithEndDateTime/ReminderViewWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function reminderView"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--startdatetime", description: "Usage: StartDateTime={StartDateTime}")); - command.AddOption(new Option("--enddatetime", description: "Usage: EndDateTime={EndDateTime}")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var StartDateTimeOption = new Option("--startdatetime", description: "Usage: StartDateTime={StartDateTime}"); + StartDateTimeOption.IsRequired = true; + command.AddOption(StartDateTimeOption); + var EndDateTimeOption = new Option("--enddatetime", description: "Usage: EndDateTime={EndDateTime}"); + EndDateTimeOption.IsRequired = true; + command.AddOption(EndDateTimeOption); command.Handler = CommandHandler.Create(async (userId, StartDateTime, EndDateTime) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(StartDateTime)) requestInfo.PathParameters.Add("StartDateTime", StartDateTime); - if (!String.IsNullOrEmpty(EndDateTime)) requestInfo.PathParameters.Add("EndDateTime", EndDateTime); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/RemoveAllDevicesFromManagement/RemoveAllDevicesFromManagementRequestBuilder.cs b/src/generated/Users/Item/RemoveAllDevicesFromManagement/RemoveAllDevicesFromManagementRequestBuilder.cs index 8381f619b13..a3e85bea6ad 100644 --- a/src/generated/Users/Item/RemoveAllDevicesFromManagement/RemoveAllDevicesFromManagementRequestBuilder.cs +++ b/src/generated/Users/Item/RemoveAllDevicesFromManagement/RemoveAllDevicesFromManagementRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Retire all devices from management for this user"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ReprocessLicenseAssignment/ReprocessLicenseAssignmentRequestBuilder.cs b/src/generated/Users/Item/ReprocessLicenseAssignment/ReprocessLicenseAssignmentRequestBuilder.cs index 43d9be8000b..2bf0a61d08b 100644 --- a/src/generated/Users/Item/ReprocessLicenseAssignment/ReprocessLicenseAssignmentRequestBuilder.cs +++ b/src/generated/Users/Item/ReprocessLicenseAssignment/ReprocessLicenseAssignmentRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reprocessLicenseAssignment"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Restore/RestoreRequestBuilder.cs b/src/generated/Users/Item/Restore/RestoreRequestBuilder.cs index 120133a2bdc..afc8c054bce 100644 --- a/src/generated/Users/Item/Restore/RestoreRequestBuilder.cs +++ b/src/generated/Users/Item/Restore/RestoreRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restore"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/RevokeSignInSessions/RevokeSignInSessionsRequestBuilder.cs b/src/generated/Users/Item/RevokeSignInSessions/RevokeSignInSessionsRequestBuilder.cs index 604bb2a77ea..4c117d7551c 100644 --- a/src/generated/Users/Item/RevokeSignInSessions/RevokeSignInSessionsRequestBuilder.cs +++ b/src/generated/Users/Item/RevokeSignInSessions/RevokeSignInSessionsRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action revokeSignInSessions"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/ScopedRoleMemberOf/Item/ScopedRoleMembershipRequestBuilder.cs b/src/generated/Users/Item/ScopedRoleMemberOf/Item/ScopedRoleMembershipRequestBuilder.cs index 1b9ea281c66..41f20d84743 100644 --- a/src/generated/Users/Item/ScopedRoleMemberOf/Item/ScopedRoleMembershipRequestBuilder.cs +++ b/src/generated/Users/Item/ScopedRoleMemberOf/Item/ScopedRoleMembershipRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The scoped-role administrative unit memberships for this user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); command.Handler = CommandHandler.Create(async (userId, scopedRoleMembershipId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The scoped-role administrative unit memberships for this user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, scopedRoleMembershipId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, scopedRoleMembershipId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The scoped-role administrative unit memberships for this user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var scopedRoleMembershipIdOption = new Option("--scopedrolemembership-id", description: "key: id of scopedRoleMembership"); + scopedRoleMembershipIdOption.IsRequired = true; + command.AddOption(scopedRoleMembershipIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, scopedRoleMembershipId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(scopedRoleMembershipId)) requestInfo.PathParameters.Add("scopedRoleMembership_id", scopedRoleMembershipId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/ScopedRoleMemberOf/ScopedRoleMemberOfRequestBuilder.cs b/src/generated/Users/Item/ScopedRoleMemberOf/ScopedRoleMemberOfRequestBuilder.cs index 444b9cbcc11..c195e1cfeb2 100644 --- a/src/generated/Users/Item/ScopedRoleMemberOf/ScopedRoleMemberOfRequestBuilder.cs +++ b/src/generated/Users/Item/ScopedRoleMemberOf/ScopedRoleMemberOfRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The scoped-role administrative unit memberships for this user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The scoped-role administrative unit memberships for this user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/SendMail/SendMailRequestBuilder.cs b/src/generated/Users/Item/SendMail/SendMailRequestBuilder.cs index ea7849423dd..509be2baf6a 100644 --- a/src/generated/Users/Item/SendMail/SendMailRequestBuilder.cs +++ b/src/generated/Users/Item/SendMail/SendMailRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sendMail"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Settings/SettingsRequestBuilder.cs b/src/generated/Users/Item/Settings/SettingsRequestBuilder.cs index 2b4fd087250..c4c73e6e4f7 100644 --- a/src/generated/Users/Item/Settings/SettingsRequestBuilder.cs +++ b/src/generated/Users/Item/Settings/SettingsRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,14 +80,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Settings/ShiftPreferences/ShiftPreferencesRequestBuilder.cs b/src/generated/Users/Item/Settings/ShiftPreferences/ShiftPreferencesRequestBuilder.cs index 6d8f533fab7..4d93fc18680 100644 --- a/src/generated/Users/Item/Settings/ShiftPreferences/ShiftPreferencesRequestBuilder.cs +++ b/src/generated/Users/Item/Settings/ShiftPreferences/ShiftPreferencesRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The shift preferences for the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The shift preferences for the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The shift preferences for the user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Teamwork/InstalledApps/InstalledAppsRequestBuilder.cs b/src/generated/Users/Item/Teamwork/InstalledApps/InstalledAppsRequestBuilder.cs index 24b43052fea..dbf921c316e 100644 --- a/src/generated/Users/Item/Teamwork/InstalledApps/InstalledAppsRequestBuilder.cs +++ b/src/generated/Users/Item/Teamwork/InstalledApps/InstalledAppsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The apps installed in the personal scope of this user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The apps installed in the personal scope of this user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Teamwork/InstalledApps/Item/Chat/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/Teamwork/InstalledApps/Item/Chat/@Ref/RefRequestBuilder.cs index b08e378d167..87cb2e4d937 100644 --- a/src/generated/Users/Item/Teamwork/InstalledApps/Item/Chat/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/Teamwork/InstalledApps/Item/Chat/@Ref/RefRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The chat between the user and Teams app."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userScopeTeamsAppInstallationIdOption = new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation"); + userScopeTeamsAppInstallationIdOption.IsRequired = true; + command.AddOption(userScopeTeamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (userId, userScopeTeamsAppInstallationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userScopeTeamsAppInstallationId)) requestInfo.PathParameters.Add("userScopeTeamsAppInstallation_id", userScopeTeamsAppInstallationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,12 +47,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The chat between the user and Teams app."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userScopeTeamsAppInstallationIdOption = new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation"); + userScopeTeamsAppInstallationIdOption.IsRequired = true; + command.AddOption(userScopeTeamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (userId, userScopeTeamsAppInstallationId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userScopeTeamsAppInstallationId)) requestInfo.PathParameters.Add("userScopeTeamsAppInstallation_id", userScopeTeamsAppInstallationId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -68,16 +74,21 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The chat between the user and Teams app."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userScopeTeamsAppInstallationIdOption = new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation"); + userScopeTeamsAppInstallationIdOption.IsRequired = true; + command.AddOption(userScopeTeamsAppInstallationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, userScopeTeamsAppInstallationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userScopeTeamsAppInstallationId)) requestInfo.PathParameters.Add("userScopeTeamsAppInstallation_id", userScopeTeamsAppInstallationId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Teamwork/InstalledApps/Item/Chat/ChatRequestBuilder.cs b/src/generated/Users/Item/Teamwork/InstalledApps/Item/Chat/ChatRequestBuilder.cs index 318fe8e3461..ea47bfbd7f0 100644 --- a/src/generated/Users/Item/Teamwork/InstalledApps/Item/Chat/ChatRequestBuilder.cs +++ b/src/generated/Users/Item/Teamwork/InstalledApps/Item/Chat/ChatRequestBuilder.cs @@ -27,16 +27,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The chat between the user and Teams app."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, userScopeTeamsAppInstallationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userScopeTeamsAppInstallationId)) requestInfo.PathParameters.Add("userScopeTeamsAppInstallation_id", userScopeTeamsAppInstallationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userScopeTeamsAppInstallationIdOption = new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation"); + userScopeTeamsAppInstallationIdOption.IsRequired = true; + command.AddOption(userScopeTeamsAppInstallationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, userScopeTeamsAppInstallationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Teamwork/InstalledApps/Item/UserScopeTeamsAppInstallationRequestBuilder.cs b/src/generated/Users/Item/Teamwork/InstalledApps/Item/UserScopeTeamsAppInstallationRequestBuilder.cs index f9f4f5fb58f..5fec7f00d0f 100644 --- a/src/generated/Users/Item/Teamwork/InstalledApps/Item/UserScopeTeamsAppInstallationRequestBuilder.cs +++ b/src/generated/Users/Item/Teamwork/InstalledApps/Item/UserScopeTeamsAppInstallationRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The apps installed in the personal scope of this user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userScopeTeamsAppInstallationIdOption = new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation"); + userScopeTeamsAppInstallationIdOption.IsRequired = true; + command.AddOption(userScopeTeamsAppInstallationIdOption); command.Handler = CommandHandler.Create(async (userId, userScopeTeamsAppInstallationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userScopeTeamsAppInstallationId)) requestInfo.PathParameters.Add("userScopeTeamsAppInstallation_id", userScopeTeamsAppInstallationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The apps installed in the personal scope of this user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, userScopeTeamsAppInstallationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userScopeTeamsAppInstallationId)) requestInfo.PathParameters.Add("userScopeTeamsAppInstallation_id", userScopeTeamsAppInstallationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userScopeTeamsAppInstallationIdOption = new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation"); + userScopeTeamsAppInstallationIdOption.IsRequired = true; + command.AddOption(userScopeTeamsAppInstallationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, userScopeTeamsAppInstallationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The apps installed in the personal scope of this user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var userScopeTeamsAppInstallationIdOption = new Option("--userscopeteamsappinstallation-id", description: "key: id of userScopeTeamsAppInstallation"); + userScopeTeamsAppInstallationIdOption.IsRequired = true; + command.AddOption(userScopeTeamsAppInstallationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, userScopeTeamsAppInstallationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(userScopeTeamsAppInstallationId)) requestInfo.PathParameters.Add("userScopeTeamsAppInstallation_id", userScopeTeamsAppInstallationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Teamwork/SendActivityNotification/SendActivityNotificationRequestBuilder.cs b/src/generated/Users/Item/Teamwork/SendActivityNotification/SendActivityNotificationRequestBuilder.cs index 91d515e1c90..52a5ced3358 100644 --- a/src/generated/Users/Item/Teamwork/SendActivityNotification/SendActivityNotificationRequestBuilder.cs +++ b/src/generated/Users/Item/Teamwork/SendActivityNotification/SendActivityNotificationRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sendActivityNotification"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Teamwork/TeamworkRequestBuilder.cs b/src/generated/Users/Item/Teamwork/TeamworkRequestBuilder.cs index 6580beef897..650e1f8c4df 100644 --- a/src/generated/Users/Item/Teamwork/TeamworkRequestBuilder.cs +++ b/src/generated/Users/Item/Teamwork/TeamworkRequestBuilder.cs @@ -28,10 +28,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A container for Microsoft Teams features available for the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,14 +47,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A container for Microsoft Teams features available for the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,14 +88,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A container for Microsoft Teams features available for the user. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Todo/Lists/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Todo/Lists/Delta/DeltaRequestBuilder.cs index d998e0369fd..1a4c095ac7a 100644 --- a/src/generated/Users/Item/Todo/Lists/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Todo/Lists/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Todo/Lists/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/Todo/Lists/Item/Extensions/ExtensionsRequestBuilder.cs index de4122e1256..b2df5cabbf2 100644 --- a/src/generated/Users/Item/Todo/Lists/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/Todo/Lists/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the task list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the task list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, todoTaskListId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, todoTaskListId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Todo/Lists/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/Todo/Lists/Item/Extensions/Item/ExtensionRequestBuilder.cs index 1f90bfc6d69..d9a4277ac93 100644 --- a/src/generated/Users/Item/Todo/Lists/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/Todo/Lists/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the task list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the task list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, todoTaskListId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, todoTaskListId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the task list. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Todo/Lists/Item/Tasks/Delta/DeltaRequestBuilder.cs b/src/generated/Users/Item/Todo/Lists/Item/Tasks/Delta/DeltaRequestBuilder.cs index 93c6f49ddd4..829ee9d6633 100644 --- a/src/generated/Users/Item/Todo/Lists/Item/Tasks/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Users/Item/Todo/Lists/Item/Tasks/Delta/DeltaRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/Extensions/ExtensionsRequestBuilder.cs b/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/Extensions/ExtensionsRequestBuilder.cs index efc62e964b2..abd98a41bcf 100644 --- a/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/Extensions/ExtensionsRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The collection of open extensions defined for the task. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The collection of open extensions defined for the task. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/Extensions/Item/ExtensionRequestBuilder.cs b/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/Extensions/Item/ExtensionRequestBuilder.cs index 23fb16d7a62..d719894d645 100644 --- a/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/Extensions/Item/ExtensionRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The collection of open extensions defined for the task. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, extensionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The collection of open extensions defined for the task. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, extensionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, extensionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The collection of open extensions defined for the task. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--extension-id", description: "key: id of extension")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var extensionIdOption = new Option("--extension-id", description: "key: id of extension"); + extensionIdOption.IsRequired = true; + command.AddOption(extensionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, extensionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - if (!String.IsNullOrEmpty(extensionId)) requestInfo.PathParameters.Add("extension_id", extensionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/LinkedResources/Item/LinkedResourceRequestBuilder.cs b/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/LinkedResources/Item/LinkedResourceRequestBuilder.cs index fc66362cbf1..26c15dfd809 100644 --- a/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/LinkedResources/Item/LinkedResourceRequestBuilder.cs +++ b/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/LinkedResources/Item/LinkedResourceRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of resources linked to the task."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--linkedresource-id", description: "key: id of linkedResource")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var linkedResourceIdOption = new Option("--linkedresource-id", description: "key: id of linkedResource"); + linkedResourceIdOption.IsRequired = true; + command.AddOption(linkedResourceIdOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, linkedResourceId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - if (!String.IsNullOrEmpty(linkedResourceId)) requestInfo.PathParameters.Add("linkedResource_id", linkedResourceId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,20 +54,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of resources linked to the task."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--linkedresource-id", description: "key: id of linkedResource")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, linkedResourceId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - if (!String.IsNullOrEmpty(linkedResourceId)) requestInfo.PathParameters.Add("linkedResource_id", linkedResourceId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var linkedResourceIdOption = new Option("--linkedresource-id", description: "key: id of linkedResource"); + linkedResourceIdOption.IsRequired = true; + command.AddOption(linkedResourceIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, linkedResourceId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,20 +97,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of resources linked to the task."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--linkedresource-id", description: "key: id of linkedResource")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var linkedResourceIdOption = new Option("--linkedresource-id", description: "key: id of linkedResource"); + linkedResourceIdOption.IsRequired = true; + command.AddOption(linkedResourceIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, linkedResourceId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - if (!String.IsNullOrEmpty(linkedResourceId)) requestInfo.PathParameters.Add("linkedResource_id", linkedResourceId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/LinkedResources/LinkedResourcesRequestBuilder.cs b/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/LinkedResources/LinkedResourcesRequestBuilder.cs index acec6ba8f18..143290acbea 100644 --- a/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/LinkedResources/LinkedResourcesRequestBuilder.cs +++ b/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/LinkedResources/LinkedResourcesRequestBuilder.cs @@ -36,18 +36,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "A collection of resources linked to the task."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -66,30 +72,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "A collection of resources linked to the task."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/TodoTaskRequestBuilder.cs b/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/TodoTaskRequestBuilder.cs index cacb70a1901..9705e317ff6 100644 --- a/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/TodoTaskRequestBuilder.cs +++ b/src/generated/Users/Item/Todo/Lists/Item/Tasks/Item/TodoTaskRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The tasks in this task list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The tasks in this task list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -93,18 +107,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The tasks in this task list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--todotask-id", description: "key: id of todoTask")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var todoTaskIdOption = new Option("--todotask-id", description: "key: id of todoTask"); + todoTaskIdOption.IsRequired = true; + command.AddOption(todoTaskIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId, todoTaskId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - if (!String.IsNullOrEmpty(todoTaskId)) requestInfo.PathParameters.Add("todoTask_id", todoTaskId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Todo/Lists/Item/Tasks/TasksRequestBuilder.cs b/src/generated/Users/Item/Todo/Lists/Item/Tasks/TasksRequestBuilder.cs index b330081435d..21330379b99 100644 --- a/src/generated/Users/Item/Todo/Lists/Item/Tasks/TasksRequestBuilder.cs +++ b/src/generated/Users/Item/Todo/Lists/Item/Tasks/TasksRequestBuilder.cs @@ -39,16 +39,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The tasks in this task list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,28 +72,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The tasks in this task list. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, todoTaskListId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, todoTaskListId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Todo/Lists/Item/TodoTaskListRequestBuilder.cs b/src/generated/Users/Item/Todo/Lists/Item/TodoTaskListRequestBuilder.cs index 40080532001..40cc046f047 100644 --- a/src/generated/Users/Item/Todo/Lists/Item/TodoTaskListRequestBuilder.cs +++ b/src/generated/Users/Item/Todo/Lists/Item/TodoTaskListRequestBuilder.cs @@ -28,12 +28,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The task lists in the users mailbox."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The task lists in the users mailbox."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, todoTaskListId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, todoTaskListId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The task lists in the users mailbox."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--todotasklist-id", description: "key: id of todoTaskList")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var todoTaskListIdOption = new Option("--todotasklist-id", description: "key: id of todoTaskList"); + todoTaskListIdOption.IsRequired = true; + command.AddOption(todoTaskListIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, todoTaskListId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - if (!String.IsNullOrEmpty(todoTaskListId)) requestInfo.PathParameters.Add("todoTaskList_id", todoTaskListId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/Todo/Lists/ListsRequestBuilder.cs b/src/generated/Users/Item/Todo/Lists/ListsRequestBuilder.cs index 2f8f23cbf86..8a5551b7f74 100644 --- a/src/generated/Users/Item/Todo/Lists/ListsRequestBuilder.cs +++ b/src/generated/Users/Item/Todo/Lists/ListsRequestBuilder.cs @@ -39,14 +39,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The task lists in the users mailbox."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -65,26 +69,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The task lists in the users mailbox."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/Todo/TodoRequestBuilder.cs b/src/generated/Users/Item/Todo/TodoRequestBuilder.cs index bf23e356fe5..28e1ba40077 100644 --- a/src/generated/Users/Item/Todo/TodoRequestBuilder.cs +++ b/src/generated/Users/Item/Todo/TodoRequestBuilder.cs @@ -27,10 +27,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the To Do services available to a user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -44,14 +46,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the To Do services available to a user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the To Do services available to a user."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs b/src/generated/Users/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs index 350927d84e9..507a2d67609 100644 --- a/src/generated/Users/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs +++ b/src/generated/Users/Item/TransitiveMemberOf/@Ref/RefRequestBuilder.cs @@ -25,22 +25,37 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get ref of transitiveMemberOf from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -59,14 +74,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Create new navigation property ref to transitiveMemberOf for users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs b/src/generated/Users/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs index af93eb40f2e..e5dd32f1b31 100644 --- a/src/generated/Users/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs +++ b/src/generated/Users/Item/TransitiveMemberOf/TransitiveMemberOfRequestBuilder.cs @@ -26,26 +26,47 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get transitiveMemberOf from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/TranslateExchangeIds/TranslateExchangeIdsRequestBuilder.cs b/src/generated/Users/Item/TranslateExchangeIds/TranslateExchangeIdsRequestBuilder.cs index 25f77b08343..dddb92ad75e 100644 --- a/src/generated/Users/Item/TranslateExchangeIds/TranslateExchangeIdsRequestBuilder.cs +++ b/src/generated/Users/Item/TranslateExchangeIds/TranslateExchangeIdsRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action translateExchangeIds"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/Item/UserRequestBuilder.cs b/src/generated/Users/Item/UserRequestBuilder.cs index 48f541cc1a2..bca21b8d3aa 100644 --- a/src/generated/Users/Item/UserRequestBuilder.cs +++ b/src/generated/Users/Item/UserRequestBuilder.cs @@ -211,10 +211,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); command.Handler = CommandHandler.Create(async (userId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -290,14 +292,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from users by key"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (userId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (userId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -462,14 +472,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in users"; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/Item/WipeManagedAppRegistrationsByDeviceTag/WipeManagedAppRegistrationsByDeviceTagRequestBuilder.cs b/src/generated/Users/Item/WipeManagedAppRegistrationsByDeviceTag/WipeManagedAppRegistrationsByDeviceTagRequestBuilder.cs index 67dc7d40263..03c151fcc0a 100644 --- a/src/generated/Users/Item/WipeManagedAppRegistrationsByDeviceTag/WipeManagedAppRegistrationsByDeviceTagRequestBuilder.cs +++ b/src/generated/Users/Item/WipeManagedAppRegistrationsByDeviceTag/WipeManagedAppRegistrationsByDeviceTagRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Issues a wipe operation on an app registration with specified device tag."; // Create options for all the parameters - command.AddOption(new Option("--user-id", description: "key: id of user")); - command.AddOption(new Option("--body")); + var userIdOption = new Option("--user-id", description: "key: id of user"); + userIdOption.IsRequired = true; + command.AddOption(userIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (userId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(userId)) requestInfo.PathParameters.Add("user_id", userId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Users/UsersRequestBuilder.cs b/src/generated/Users/UsersRequestBuilder.cs index 1a889441f62..f187768471f 100644 --- a/src/generated/Users/UsersRequestBuilder.cs +++ b/src/generated/Users/UsersRequestBuilder.cs @@ -102,12 +102,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to users"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -138,24 +141,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from users"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Users/ValidateProperties/ValidatePropertiesRequestBuilder.cs b/src/generated/Users/ValidateProperties/ValidatePropertiesRequestBuilder.cs index 8b58083c045..c26f3d2a354 100644 --- a/src/generated/Users/ValidateProperties/ValidatePropertiesRequestBuilder.cs +++ b/src/generated/Users/ValidateProperties/ValidatePropertiesRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validateProperties"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Analytics/@Ref/RefRequestBuilder.cs b/src/generated/Workbooks/Item/Analytics/@Ref/RefRequestBuilder.cs index f677a178737..ad74f671ef8 100644 --- a/src/generated/Workbooks/Item/Analytics/@Ref/RefRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Analytics/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Analytics/AnalyticsRequestBuilder.cs b/src/generated/Workbooks/Item/Analytics/AnalyticsRequestBuilder.cs index 33ff9b548d3..3e7a0529da2 100644 --- a/src/generated/Workbooks/Item/Analytics/AnalyticsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Analytics/AnalyticsRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Checkin/CheckinRequestBuilder.cs b/src/generated/Workbooks/Item/Checkin/CheckinRequestBuilder.cs index d9c76fa1407..5aabe8c48c5 100644 --- a/src/generated/Workbooks/Item/Checkin/CheckinRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Checkin/CheckinRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkin"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Checkout/CheckoutRequestBuilder.cs b/src/generated/Workbooks/Item/Checkout/CheckoutRequestBuilder.cs index eb7a66b9782..921fe88a5c4 100644 --- a/src/generated/Workbooks/Item/Checkout/CheckoutRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Checkout/CheckoutRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action checkout"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Children/ChildrenRequestBuilder.cs b/src/generated/Workbooks/Item/Children/ChildrenRequestBuilder.cs index 280dc2e8f8a..50915fc7796 100644 --- a/src/generated/Workbooks/Item/Children/ChildrenRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Children/ChildrenRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Children/Item/Content/ContentRequestBuilder.cs b/src/generated/Workbooks/Item/Children/Item/Content/ContentRequestBuilder.cs index ce06fe4a603..4b3fa9ce0d9 100644 --- a/src/generated/Workbooks/Item/Children/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Children/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The content stream, if the item represents a file."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--driveitem-id1", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemId1Option = new Option("--driveitem-id1", description: "key: id of driveItem"); + driveItemId1Option.IsRequired = true; + command.AddOption(driveItemId1Option); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (driveItemId, driveItemId1, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(driveItemId1)) requestInfo.PathParameters.Add("driveItem_id1", driveItemId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The content stream, if the item represents a file."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--driveitem-id1", description: "key: id of driveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemId1Option = new Option("--driveitem-id1", description: "key: id of driveItem"); + driveItemId1Option.IsRequired = true; + command.AddOption(driveItemId1Option); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (driveItemId, driveItemId1, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(driveItemId1)) requestInfo.PathParameters.Add("driveItem_id1", driveItemId1); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Children/Item/DriveItemRequestBuilder.cs b/src/generated/Workbooks/Item/Children/Item/DriveItemRequestBuilder.cs index ca87dddf0e0..1ff49714d57 100644 --- a/src/generated/Workbooks/Item/Children/Item/DriveItemRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Children/Item/DriveItemRequestBuilder.cs @@ -34,12 +34,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--driveitem-id1", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemId1Option = new Option("--driveitem-id1", description: "key: id of driveItem"); + driveItemId1Option.IsRequired = true; + command.AddOption(driveItemId1Option); command.Handler = CommandHandler.Create(async (driveItemId, driveItemId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(driveItemId1)) requestInfo.PathParameters.Add("driveItem_id1", driveItemId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -53,16 +56,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--driveitem-id1", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, driveItemId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(driveItemId1)) requestInfo.PathParameters.Add("driveItem_id1", driveItemId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemId1Option = new Option("--driveitem-id1", description: "key: id of driveItem"); + driveItemId1Option.IsRequired = true; + command.AddOption(driveItemId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, driveItemId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -81,16 +93,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--driveitem-id1", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemId1Option = new Option("--driveitem-id1", description: "key: id of driveItem"); + driveItemId1Option.IsRequired = true; + command.AddOption(driveItemId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, driveItemId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(driveItemId1)) requestInfo.PathParameters.Add("driveItem_id1", driveItemId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Content/ContentRequestBuilder.cs b/src/generated/Workbooks/Item/Content/ContentRequestBuilder.cs index 44d05f00d7f..ec306bcf140 100644 --- a/src/generated/Workbooks/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Content/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The content stream, if the item represents a file."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (driveItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The content stream, if the item represents a file."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (driveItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Copy/CopyRequestBuilder.cs b/src/generated/Workbooks/Item/Copy/CopyRequestBuilder.cs index 773d0c4ec6e..fbfc144216d 100644 --- a/src/generated/Workbooks/Item/Copy/CopyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Copy/CopyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action copy"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/CreateLink/CreateLinkRequestBuilder.cs b/src/generated/Workbooks/Item/CreateLink/CreateLinkRequestBuilder.cs index 58b1a8a4215..4480a6c38b1 100644 --- a/src/generated/Workbooks/Item/CreateLink/CreateLinkRequestBuilder.cs +++ b/src/generated/Workbooks/Item/CreateLink/CreateLinkRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createLink"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Workbooks/Item/CreateUploadSession/CreateUploadSessionRequestBuilder.cs index 1ac8bcba861..fd948441f28 100644 --- a/src/generated/Workbooks/Item/CreateUploadSession/CreateUploadSessionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createUploadSession"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Delta/DeltaRequestBuilder.cs b/src/generated/Workbooks/Item/Delta/DeltaRequestBuilder.cs index 7738a6673ac..4f4772bc449 100644 --- a/src/generated/Workbooks/Item/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Delta/DeltaRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/DeltaWithToken/DeltaWithTokenRequestBuilder.cs b/src/generated/Workbooks/Item/DeltaWithToken/DeltaWithTokenRequestBuilder.cs index 9be5a08bab7..3cbc0ff630f 100644 --- a/src/generated/Workbooks/Item/DeltaWithToken/DeltaWithTokenRequestBuilder.cs +++ b/src/generated/Workbooks/Item/DeltaWithToken/DeltaWithTokenRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function delta"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--token", description: "Usage: token={token}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var tokenOption = new Option("--token", description: "Usage: token={token}"); + tokenOption.IsRequired = true; + command.AddOption(tokenOption); command.Handler = CommandHandler.Create(async (driveItemId, token) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(token)) requestInfo.PathParameters.Add("token", token); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/DriveItemRequestBuilder.cs b/src/generated/Workbooks/Item/DriveItemRequestBuilder.cs index 56291fa446b..ef43072a2a7 100644 --- a/src/generated/Workbooks/Item/DriveItemRequestBuilder.cs +++ b/src/generated/Workbooks/Item/DriveItemRequestBuilder.cs @@ -102,10 +102,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete entity from workbooks"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -125,14 +127,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get entity from workbooks by key"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -169,14 +179,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update entity in workbooks"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Follow/FollowRequestBuilder.cs b/src/generated/Workbooks/Item/Follow/FollowRequestBuilder.cs index a9bdf45e5be..31deb5ba675 100644 --- a/src/generated/Workbooks/Item/Follow/FollowRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Follow/FollowRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action follow"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs b/src/generated/Workbooks/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs index 79d19493a50..fc90fae396b 100644 --- a/src/generated/Workbooks/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs +++ b/src/generated/Workbooks/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs b/src/generated/Workbooks/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs index 21d258d6ab9..0624433afbc 100644 --- a/src/generated/Workbooks/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs +++ b/src/generated/Workbooks/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}")); - command.AddOption(new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}")); - command.AddOption(new Option("--interval", description: "Usage: interval={interval}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var intervalOption = new Option("--interval", description: "Usage: interval={interval}"); + intervalOption.IsRequired = true; + command.AddOption(intervalOption); command.Handler = CommandHandler.Create(async (driveItemId, startDateTime, endDateTime, interval) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.PathParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.PathParameters.Add("endDateTime", endDateTime); - if (!String.IsNullOrEmpty(interval)) requestInfo.PathParameters.Add("interval", interval); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Invite/InviteRequestBuilder.cs b/src/generated/Workbooks/Item/Invite/InviteRequestBuilder.cs index 7c0ef93d39e..553695caa43 100644 --- a/src/generated/Workbooks/Item/Invite/InviteRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Invite/InviteRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action invite"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/ListItem/Analytics/@Ref/RefRequestBuilder.cs b/src/generated/Workbooks/Item/ListItem/Analytics/@Ref/RefRequestBuilder.cs index 52141becb5e..f62c19b8eaf 100644 --- a/src/generated/Workbooks/Item/ListItem/Analytics/@Ref/RefRequestBuilder.cs +++ b/src/generated/Workbooks/Item/ListItem/Analytics/@Ref/RefRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -42,10 +44,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,14 +68,18 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePutRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePutRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/ListItem/Analytics/AnalyticsRequestBuilder.cs b/src/generated/Workbooks/Item/ListItem/Analytics/AnalyticsRequestBuilder.cs index 4998ee38237..ebf4cb20411 100644 --- a/src/generated/Workbooks/Item/ListItem/Analytics/AnalyticsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/ListItem/Analytics/AnalyticsRequestBuilder.cs @@ -27,14 +27,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Analytics about the view activities that took place on this item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/ListItem/DriveItem/Content/ContentRequestBuilder.cs b/src/generated/Workbooks/Item/ListItem/DriveItem/Content/ContentRequestBuilder.cs index 9c82a11c240..17e25ec39df 100644 --- a/src/generated/Workbooks/Item/ListItem/DriveItem/Content/ContentRequestBuilder.cs +++ b/src/generated/Workbooks/Item/ListItem/DriveItem/Content/ContentRequestBuilder.cs @@ -25,11 +25,13 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The content stream, if the item represents a file."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (driveItemId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -52,12 +54,16 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The content stream, if the item represents a file."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--file", description: "Binary request body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (driveItemId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/ListItem/DriveItem/DriveItemRequestBuilder.cs b/src/generated/Workbooks/Item/ListItem/DriveItem/DriveItemRequestBuilder.cs index d3a0ab90bbf..1458686d12d 100644 --- a/src/generated/Workbooks/Item/ListItem/DriveItem/DriveItemRequestBuilder.cs +++ b/src/generated/Workbooks/Item/ListItem/DriveItem/DriveItemRequestBuilder.cs @@ -34,10 +34,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -51,14 +53,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,14 +87,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "For document libraries, the driveItem relationship exposes the listItem as a [driveItem][]"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/ListItem/Fields/FieldsRequestBuilder.cs b/src/generated/Workbooks/Item/ListItem/Fields/FieldsRequestBuilder.cs index 7a29abbf5cd..7262825b02e 100644 --- a/src/generated/Workbooks/Item/ListItem/Fields/FieldsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/ListItem/Fields/FieldsRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -43,14 +45,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -69,14 +79,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The values of the columns set on this list item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/ListItem/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs b/src/generated/Workbooks/Item/ListItem/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs index ef7c1beeff8..7fb0a029f4f 100644 --- a/src/generated/Workbooks/Item/ListItem/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs +++ b/src/generated/Workbooks/Item/ListItem/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/ListItem/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs b/src/generated/Workbooks/Item/ListItem/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs index 75016aecf2a..5a3036831ae 100644 --- a/src/generated/Workbooks/Item/ListItem/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs +++ b/src/generated/Workbooks/Item/ListItem/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function getActivitiesByInterval"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}")); - command.AddOption(new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}")); - command.AddOption(new Option("--interval", description: "Usage: interval={interval}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var startDateTimeOption = new Option("--startdatetime", description: "Usage: startDateTime={startDateTime}"); + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--enddatetime", description: "Usage: endDateTime={endDateTime}"); + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var intervalOption = new Option("--interval", description: "Usage: interval={interval}"); + intervalOption.IsRequired = true; + command.AddOption(intervalOption); command.Handler = CommandHandler.Create(async (driveItemId, startDateTime, endDateTime, interval) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(startDateTime)) requestInfo.PathParameters.Add("startDateTime", startDateTime); - if (!String.IsNullOrEmpty(endDateTime)) requestInfo.PathParameters.Add("endDateTime", endDateTime); - if (!String.IsNullOrEmpty(interval)) requestInfo.PathParameters.Add("interval", interval); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/ListItem/ListItemRequestBuilder.cs b/src/generated/Workbooks/Item/ListItem/ListItemRequestBuilder.cs index 38310fb7228..db55565ce5a 100644 --- a/src/generated/Workbooks/Item/ListItem/ListItemRequestBuilder.cs +++ b/src/generated/Workbooks/Item/ListItem/ListItemRequestBuilder.cs @@ -39,10 +39,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "For drives in SharePoint, the associated document library list item. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -73,14 +75,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "For drives in SharePoint, the associated document library list item. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,14 +109,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "For drives in SharePoint, the associated document library list item. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/ListItem/Versions/Item/Fields/FieldsRequestBuilder.cs b/src/generated/Workbooks/Item/ListItem/Versions/Item/Fields/FieldsRequestBuilder.cs index 0e18f4cebcd..b6fa8ca2b50 100644 --- a/src/generated/Workbooks/Item/ListItem/Versions/Item/Fields/FieldsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/ListItem/Versions/Item/Fields/FieldsRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (driveItemId, listItemVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, listItemVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, listItemVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "A collection of the fields and values for this version of the list item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, listItemVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/ListItem/Versions/Item/ListItemVersionRequestBuilder.cs b/src/generated/Workbooks/Item/ListItem/Versions/Item/ListItemVersionRequestBuilder.cs index 32d09410100..9fa66eddbda 100644 --- a/src/generated/Workbooks/Item/ListItem/Versions/Item/ListItemVersionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/ListItem/Versions/Item/ListItemVersionRequestBuilder.cs @@ -28,12 +28,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (driveItemId, listItemVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,16 +58,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, listItemVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, listItemVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,16 +95,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, listItemVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/ListItem/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs b/src/generated/Workbooks/Item/ListItem/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs index 24e5532fc99..e8270977326 100644 --- a/src/generated/Workbooks/Item/ListItem/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/ListItem/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restoreVersion"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--listitemversion-id", description: "key: id of listItemVersion")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var listItemVersionIdOption = new Option("--listitemversion-id", description: "key: id of listItemVersion"); + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); command.Handler = CommandHandler.Create(async (driveItemId, listItemVersionId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(listItemVersionId)) requestInfo.PathParameters.Add("listItemVersion_id", listItemVersionId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/ListItem/Versions/VersionsRequestBuilder.cs b/src/generated/Workbooks/Item/ListItem/Versions/VersionsRequestBuilder.cs index 9964a0d2783..ee8c4fbba39 100644 --- a/src/generated/Workbooks/Item/ListItem/Versions/VersionsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/ListItem/Versions/VersionsRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +68,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of previous versions of the list item."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Permissions/Item/Grant/GrantRequestBuilder.cs b/src/generated/Workbooks/Item/Permissions/Item/Grant/GrantRequestBuilder.cs index 90d7eb8c26a..cc9d50c5089 100644 --- a/src/generated/Workbooks/Item/Permissions/Item/Grant/GrantRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Permissions/Item/Grant/GrantRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action grant"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--permission-id", description: "key: id of permission")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var permissionIdOption = new Option("--permission-id", description: "key: id of permission"); + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, permissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(permissionId)) requestInfo.PathParameters.Add("permission_id", permissionId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Permissions/Item/PermissionRequestBuilder.cs b/src/generated/Workbooks/Item/Permissions/Item/PermissionRequestBuilder.cs index ff76dc300c9..706e808ce5c 100644 --- a/src/generated/Workbooks/Item/Permissions/Item/PermissionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Permissions/Item/PermissionRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The set of permissions for the item. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--permission-id", description: "key: id of permission")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var permissionIdOption = new Option("--permission-id", description: "key: id of permission"); + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); command.Handler = CommandHandler.Create(async (driveItemId, permissionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(permissionId)) requestInfo.PathParameters.Add("permission_id", permissionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The set of permissions for the item. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--permission-id", description: "key: id of permission")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, permissionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(permissionId)) requestInfo.PathParameters.Add("permission_id", permissionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var permissionIdOption = new Option("--permission-id", description: "key: id of permission"); + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, permissionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,16 +92,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The set of permissions for the item. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--permission-id", description: "key: id of permission")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var permissionIdOption = new Option("--permission-id", description: "key: id of permission"); + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, permissionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(permissionId)) requestInfo.PathParameters.Add("permission_id", permissionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Permissions/PermissionsRequestBuilder.cs b/src/generated/Workbooks/Item/Permissions/PermissionsRequestBuilder.cs index c8494d490ba..7de3ec8fbd3 100644 --- a/src/generated/Workbooks/Item/Permissions/PermissionsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Permissions/PermissionsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The set of permissions for the item. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The set of permissions for the item. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Workbooks/Item/Preview/PreviewRequestBuilder.cs index 455f477c3e2..dbe2b4f0e96 100644 --- a/src/generated/Workbooks/Item/Preview/PreviewRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Preview/PreviewRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action preview"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Restore/RestoreRequestBuilder.cs b/src/generated/Workbooks/Item/Restore/RestoreRequestBuilder.cs index 0f50e10342e..7d0c3962dbc 100644 --- a/src/generated/Workbooks/Item/Restore/RestoreRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Restore/RestoreRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restore"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/SearchWithQ/SearchWithQRequestBuilder.cs b/src/generated/Workbooks/Item/SearchWithQ/SearchWithQRequestBuilder.cs index fe2a502dbe4..2c909bfc551 100644 --- a/src/generated/Workbooks/Item/SearchWithQ/SearchWithQRequestBuilder.cs +++ b/src/generated/Workbooks/Item/SearchWithQ/SearchWithQRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function search"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("-q", description: "Usage: q={q}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var qOption = new Option("-q", description: "Usage: q={q}"); + qOption.IsRequired = true; + command.AddOption(qOption); command.Handler = CommandHandler.Create(async (driveItemId, q) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(q)) requestInfo.PathParameters.Add("q", q); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendCollectionAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Subscriptions/Item/SubscriptionRequestBuilder.cs b/src/generated/Workbooks/Item/Subscriptions/Item/SubscriptionRequestBuilder.cs index f0528501775..59a2b2f59a4 100644 --- a/src/generated/Workbooks/Item/Subscriptions/Item/SubscriptionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Subscriptions/Item/SubscriptionRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The set of subscriptions on the item. Only supported on the root of a drive."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); command.Handler = CommandHandler.Create(async (driveItemId, subscriptionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The set of subscriptions on the item. Only supported on the root of a drive."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, subscriptionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, subscriptionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The set of subscriptions on the item. Only supported on the root of a drive."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--subscription-id", description: "key: id of subscription")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "key: id of subscription"); + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, subscriptionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(subscriptionId)) requestInfo.PathParameters.Add("subscription_id", subscriptionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Subscriptions/SubscriptionsRequestBuilder.cs b/src/generated/Workbooks/Item/Subscriptions/SubscriptionsRequestBuilder.cs index 49eb31c0440..d5b19382a99 100644 --- a/src/generated/Workbooks/Item/Subscriptions/SubscriptionsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Subscriptions/SubscriptionsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The set of subscriptions on the item. Only supported on the root of a drive."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The set of subscriptions on the item. Only supported on the root of a drive."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Thumbnails/Item/ThumbnailSetRequestBuilder.cs b/src/generated/Workbooks/Item/Thumbnails/Item/ThumbnailSetRequestBuilder.cs index d3caea740a4..a49a60fd381 100644 --- a/src/generated/Workbooks/Item/Thumbnails/Item/ThumbnailSetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Thumbnails/Item/ThumbnailSetRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection containing [ThumbnailSet][] objects associated with the item. For more info, see [getting thumbnails][]. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--thumbnailset-id", description: "key: id of thumbnailSet")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var thumbnailSetIdOption = new Option("--thumbnailset-id", description: "key: id of thumbnailSet"); + thumbnailSetIdOption.IsRequired = true; + command.AddOption(thumbnailSetIdOption); command.Handler = CommandHandler.Create(async (driveItemId, thumbnailSetId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(thumbnailSetId)) requestInfo.PathParameters.Add("thumbnailSet_id", thumbnailSetId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -45,16 +48,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection containing [ThumbnailSet][] objects associated with the item. For more info, see [getting thumbnails][]. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--thumbnailset-id", description: "key: id of thumbnailSet")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, thumbnailSetId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(thumbnailSetId)) requestInfo.PathParameters.Add("thumbnailSet_id", thumbnailSetId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var thumbnailSetIdOption = new Option("--thumbnailset-id", description: "key: id of thumbnailSet"); + thumbnailSetIdOption.IsRequired = true; + command.AddOption(thumbnailSetIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, thumbnailSetId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,16 +85,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection containing [ThumbnailSet][] objects associated with the item. For more info, see [getting thumbnails][]. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--thumbnailset-id", description: "key: id of thumbnailSet")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var thumbnailSetIdOption = new Option("--thumbnailset-id", description: "key: id of thumbnailSet"); + thumbnailSetIdOption.IsRequired = true; + command.AddOption(thumbnailSetIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, thumbnailSetId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(thumbnailSetId)) requestInfo.PathParameters.Add("thumbnailSet_id", thumbnailSetId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Thumbnails/ThumbnailsRequestBuilder.cs b/src/generated/Workbooks/Item/Thumbnails/ThumbnailsRequestBuilder.cs index bb4eaf75e29..ba50c39f3c2 100644 --- a/src/generated/Workbooks/Item/Thumbnails/ThumbnailsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Thumbnails/ThumbnailsRequestBuilder.cs @@ -36,14 +36,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection containing [ThumbnailSet][] objects associated with the item. For more info, see [getting thumbnails][]. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -62,26 +66,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection containing [ThumbnailSet][] objects associated with the item. For more info, see [getting thumbnails][]. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Unfollow/UnfollowRequestBuilder.cs b/src/generated/Workbooks/Item/Unfollow/UnfollowRequestBuilder.cs index 12704d9b302..db2759ad350 100644 --- a/src/generated/Workbooks/Item/Unfollow/UnfollowRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Unfollow/UnfollowRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unfollow"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/ValidatePermission/ValidatePermissionRequestBuilder.cs b/src/generated/Workbooks/Item/ValidatePermission/ValidatePermissionRequestBuilder.cs index 0fe5cd1effc..21f93124857 100644 --- a/src/generated/Workbooks/Item/ValidatePermission/ValidatePermissionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/ValidatePermission/ValidatePermissionRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action validatePermission"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Versions/Item/Content/ContentRequestBuilder.cs b/src/generated/Workbooks/Item/Versions/Item/Content/ContentRequestBuilder.cs index 346ea85b06d..2723cb725a1 100644 --- a/src/generated/Workbooks/Item/Versions/Item/Content/ContentRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Versions/Item/Content/ContentRequestBuilder.cs @@ -25,13 +25,16 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The content stream, if the item represents a file."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--driveitemversion-id", description: "key: id of driveItemVersion")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemVersionIdOption = new Option("--driveitemversion-id", description: "key: id of driveItemVersion"); + driveItemVersionIdOption.IsRequired = true; + command.AddOption(driveItemVersionIdOption); command.AddOption(new Option("--output")); command.Handler = CommandHandler.Create(async (driveItemId, driveItemVersionId, output) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(driveItemVersionId)) requestInfo.PathParameters.Add("driveItemVersion_id", driveItemVersionId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? if (output == null) { @@ -54,14 +57,19 @@ public Command BuildPutCommand() { var command = new Command("put"); command.Description = "The content stream, if the item represents a file."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--driveitemversion-id", description: "key: id of driveItemVersion")); - command.AddOption(new Option("--file", description: "Binary request body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemVersionIdOption = new Option("--driveitemversion-id", description: "key: id of driveItemVersion"); + driveItemVersionIdOption.IsRequired = true; + command.AddOption(driveItemVersionIdOption); + var fileOption = new Option("--file", description: "Binary request body"); + fileOption.IsRequired = true; + command.AddOption(fileOption); command.Handler = CommandHandler.Create(async (driveItemId, driveItemVersionId, file) => { using var stream = file.OpenRead(); - var requestInfo = CreatePutRequestInformation(stream); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(driveItemVersionId)) requestInfo.PathParameters.Add("driveItemVersion_id", driveItemVersionId); + var requestInfo = CreatePutRequestInformation(stream, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Versions/Item/DriveItemVersionRequestBuilder.cs b/src/generated/Workbooks/Item/Versions/Item/DriveItemVersionRequestBuilder.cs index 4d2a3c23f1f..e00aa4bf3cd 100644 --- a/src/generated/Workbooks/Item/Versions/Item/DriveItemVersionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Versions/Item/DriveItemVersionRequestBuilder.cs @@ -35,12 +35,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The list of previous versions of the item. For more info, see [getting previous versions][]. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--driveitemversion-id", description: "key: id of driveItemVersion")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemVersionIdOption = new Option("--driveitemversion-id", description: "key: id of driveItemVersion"); + driveItemVersionIdOption.IsRequired = true; + command.AddOption(driveItemVersionIdOption); command.Handler = CommandHandler.Create(async (driveItemId, driveItemVersionId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(driveItemVersionId)) requestInfo.PathParameters.Add("driveItemVersion_id", driveItemVersionId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,16 +57,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The list of previous versions of the item. For more info, see [getting previous versions][]. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--driveitemversion-id", description: "key: id of driveItemVersion")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, driveItemVersionId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(driveItemVersionId)) requestInfo.PathParameters.Add("driveItemVersion_id", driveItemVersionId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemVersionIdOption = new Option("--driveitemversion-id", description: "key: id of driveItemVersion"); + driveItemVersionIdOption.IsRequired = true; + command.AddOption(driveItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, driveItemVersionId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,16 +94,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The list of previous versions of the item. For more info, see [getting previous versions][]. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--driveitemversion-id", description: "key: id of driveItemVersion")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemVersionIdOption = new Option("--driveitemversion-id", description: "key: id of driveItemVersion"); + driveItemVersionIdOption.IsRequired = true; + command.AddOption(driveItemVersionIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, driveItemVersionId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(driveItemVersionId)) requestInfo.PathParameters.Add("driveItemVersion_id", driveItemVersionId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs b/src/generated/Workbooks/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs index 8411af64691..d1f977ee241 100644 --- a/src/generated/Workbooks/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action restoreVersion"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--driveitemversion-id", description: "key: id of driveItemVersion")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemVersionIdOption = new Option("--driveitemversion-id", description: "key: id of driveItemVersion"); + driveItemVersionIdOption.IsRequired = true; + command.AddOption(driveItemVersionIdOption); command.Handler = CommandHandler.Create(async (driveItemId, driveItemVersionId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(driveItemVersionId)) requestInfo.PathParameters.Add("driveItemVersion_id", driveItemVersionId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Versions/VersionsRequestBuilder.cs b/src/generated/Workbooks/Item/Versions/VersionsRequestBuilder.cs index 52e7a0bf477..4a0893096a6 100644 --- a/src/generated/Workbooks/Item/Versions/VersionsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Versions/VersionsRequestBuilder.cs @@ -38,14 +38,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "The list of previous versions of the item. For more info, see [getting previous versions][]. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,26 +68,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "The list of previous versions of the item. For more info, see [getting previous versions][]. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Application/ApplicationRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Application/ApplicationRequestBuilder.cs index 5b653e9443b..8cd6c8237f5 100644 --- a/src/generated/Workbooks/Item/Workbook/Application/ApplicationRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Application/ApplicationRequestBuilder.cs @@ -33,10 +33,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property application for workbooks"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,14 +52,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get application from workbooks"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,14 +86,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property application in workbooks"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Application/Calculate/CalculateRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Application/Calculate/CalculateRequestBuilder.cs index bf7e8908087..647e3bd9fda 100644 --- a/src/generated/Workbooks/Item/Workbook/Application/Calculate/CalculateRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Application/Calculate/CalculateRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action calculate"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/CloseSession/CloseSessionRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/CloseSession/CloseSessionRequestBuilder.cs index 4d13385d661..70b2eca4faa 100644 --- a/src/generated/Workbooks/Item/Workbook/CloseSession/CloseSessionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/CloseSession/CloseSessionRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action closeSession"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Comments/CommentsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Comments/CommentsRequestBuilder.cs index 488598bdb5e..ce4bba9f020 100644 --- a/src/generated/Workbooks/Item/Workbook/Comments/CommentsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Comments/CommentsRequestBuilder.cs @@ -37,14 +37,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Create new navigation property to comments for workbooks"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -63,26 +67,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get comments from workbooks"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Comments/Item/Replies/Item/WorkbookCommentReplyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Comments/Item/Replies/Item/WorkbookCommentReplyRequestBuilder.cs index e11e3803c39..a70e028ad40 100644 --- a/src/generated/Workbooks/Item/Workbook/Comments/Item/Replies/Item/WorkbookCommentReplyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Comments/Item/Replies/Item/WorkbookCommentReplyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookcomment-id", description: "key: id of workbookComment")); - command.AddOption(new Option("--workbookcommentreply-id", description: "key: id of workbookCommentReply")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbookcomment-id", description: "key: id of workbookComment"); + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var workbookCommentReplyIdOption = new Option("--workbookcommentreply-id", description: "key: id of workbookCommentReply"); + workbookCommentReplyIdOption.IsRequired = true; + command.AddOption(workbookCommentReplyIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookCommentId, workbookCommentReplyId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookCommentId)) requestInfo.PathParameters.Add("workbookComment_id", workbookCommentId); - if (!String.IsNullOrEmpty(workbookCommentReplyId)) requestInfo.PathParameters.Add("workbookCommentReply_id", workbookCommentReplyId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookcomment-id", description: "key: id of workbookComment")); - command.AddOption(new Option("--workbookcommentreply-id", description: "key: id of workbookCommentReply")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookCommentId, workbookCommentReplyId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookCommentId)) requestInfo.PathParameters.Add("workbookComment_id", workbookCommentId); - if (!String.IsNullOrEmpty(workbookCommentReplyId)) requestInfo.PathParameters.Add("workbookCommentReply_id", workbookCommentReplyId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbookcomment-id", description: "key: id of workbookComment"); + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var workbookCommentReplyIdOption = new Option("--workbookcommentreply-id", description: "key: id of workbookCommentReply"); + workbookCommentReplyIdOption.IsRequired = true; + command.AddOption(workbookCommentReplyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookCommentId, workbookCommentReplyId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookcomment-id", description: "key: id of workbookComment")); - command.AddOption(new Option("--workbookcommentreply-id", description: "key: id of workbookCommentReply")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbookcomment-id", description: "key: id of workbookComment"); + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var workbookCommentReplyIdOption = new Option("--workbookcommentreply-id", description: "key: id of workbookCommentReply"); + workbookCommentReplyIdOption.IsRequired = true; + command.AddOption(workbookCommentReplyIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookCommentId, workbookCommentReplyId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookCommentId)) requestInfo.PathParameters.Add("workbookComment_id", workbookCommentId); - if (!String.IsNullOrEmpty(workbookCommentReplyId)) requestInfo.PathParameters.Add("workbookCommentReply_id", workbookCommentReplyId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Comments/Item/Replies/RepliesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Comments/Item/Replies/RepliesRequestBuilder.cs index 4518162aa79..98548aa12eb 100644 --- a/src/generated/Workbooks/Item/Workbook/Comments/Item/Replies/RepliesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Comments/Item/Replies/RepliesRequestBuilder.cs @@ -36,16 +36,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookcomment-id", description: "key: id of workbookComment")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbookcomment-id", description: "key: id of workbookComment"); + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookCommentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookCommentId)) requestInfo.PathParameters.Add("workbookComment_id", workbookCommentId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -64,28 +69,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookcomment-id", description: "key: id of workbookComment")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookCommentId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookCommentId)) requestInfo.PathParameters.Add("workbookComment_id", workbookCommentId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbookcomment-id", description: "key: id of workbookComment"); + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookCommentId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Comments/Item/WorkbookCommentRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Comments/Item/WorkbookCommentRequestBuilder.cs index ae03db66e74..ec91525a63a 100644 --- a/src/generated/Workbooks/Item/Workbook/Comments/Item/WorkbookCommentRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Comments/Item/WorkbookCommentRequestBuilder.cs @@ -27,12 +27,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property comments for workbooks"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookcomment-id", description: "key: id of workbookComment")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbookcomment-id", description: "key: id of workbookComment"); + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookCommentId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookCommentId)) requestInfo.PathParameters.Add("workbookComment_id", workbookCommentId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -46,16 +49,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get comments from workbooks"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookcomment-id", description: "key: id of workbookComment")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookCommentId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookCommentId)) requestInfo.PathParameters.Add("workbookComment_id", workbookCommentId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbookcomment-id", description: "key: id of workbookComment"); + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookCommentId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,16 +86,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property comments in workbooks"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookcomment-id", description: "key: id of workbookComment")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbookcomment-id", description: "key: id of workbookComment"); + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookCommentId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookCommentId)) requestInfo.PathParameters.Add("workbookComment_id", workbookCommentId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/CreateSession/CreateSessionRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/CreateSession/CreateSessionRequestBuilder.cs index 1d69b5ac2d7..c84a332868d 100644 --- a/src/generated/Workbooks/Item/Workbook/CreateSession/CreateSessionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/CreateSession/CreateSessionRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action createSession"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/@And/AndRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/@And/AndRequestBuilder.cs index 410d5ad387f..baf79c0a139 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/@And/AndRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/@And/AndRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action and"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/@Base/BaseRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/@Base/BaseRequestBuilder.cs index 2e989e6dc5f..63b42e752bd 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/@Base/BaseRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/@Base/BaseRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action base"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/@Char/CharRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/@Char/CharRequestBuilder.cs index 05773b27b83..5fb3326ca9b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/@Char/CharRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/@Char/CharRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action char"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/@Decimal/DecimalRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/@Decimal/DecimalRequestBuilder.cs index cf1aeafe75e..cb6216cbfad 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/@Decimal/DecimalRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/@Decimal/DecimalRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action decimal"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/@False/FalseRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/@False/FalseRequestBuilder.cs index 0be40a49e35..d53717051b3 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/@False/FalseRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/@False/FalseRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action false"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/@Fixed/FixedRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/@Fixed/FixedRequestBuilder.cs index f2edf154cff..9a1dc79517c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/@Fixed/FixedRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/@Fixed/FixedRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action fixed"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/@If/IfRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/@If/IfRequestBuilder.cs index b924ed64ceb..74c47059eba 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/@If/IfRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/@If/IfRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action if"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/@Int/IntRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/@Int/IntRequestBuilder.cs index 39d697a12fe..095d42bcb78 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/@Int/IntRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/@Int/IntRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action int"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/@Not/NotRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/@Not/NotRequestBuilder.cs index 81e842ae935..1bce40c8e3d 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/@Not/NotRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/@Not/NotRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action not"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/@Or/OrRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/@Or/OrRequestBuilder.cs index c75525eafbc..2ac1b258eb3 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/@Or/OrRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/@Or/OrRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action or"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/@True/TrueRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/@True/TrueRequestBuilder.cs index b5eed61973a..96714b6945c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/@True/TrueRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/@True/TrueRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action true"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/@Yield/YieldRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/@Yield/YieldRequestBuilder.cs index d6f43ecb64c..a5738250053 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/@Yield/YieldRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/@Yield/YieldRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action yield"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Abs/AbsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Abs/AbsRequestBuilder.cs index c62aa87d8d8..0c9ac7f9a5c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Abs/AbsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Abs/AbsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action abs"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/AccrInt/AccrIntRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/AccrInt/AccrIntRequestBuilder.cs index 44dc5cd3605..4242eddc3bc 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/AccrInt/AccrIntRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/AccrInt/AccrIntRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accrInt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/AccrIntM/AccrIntMRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/AccrIntM/AccrIntMRequestBuilder.cs index a6b281372e4..dcfef283352 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/AccrIntM/AccrIntMRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/AccrIntM/AccrIntMRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action accrIntM"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Acos/AcosRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Acos/AcosRequestBuilder.cs index 211d267e9a6..0e2d08904b2 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Acos/AcosRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Acos/AcosRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action acos"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Acosh/AcoshRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Acosh/AcoshRequestBuilder.cs index a5193bc7787..044cb6aaa9e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Acosh/AcoshRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Acosh/AcoshRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action acosh"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Acot/AcotRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Acot/AcotRequestBuilder.cs index 25afb41c9ed..ba05b2b3d66 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Acot/AcotRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Acot/AcotRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action acot"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Acoth/AcothRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Acoth/AcothRequestBuilder.cs index d89b50af832..a41f6b546b2 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Acoth/AcothRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Acoth/AcothRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action acoth"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/AmorDegrc/AmorDegrcRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/AmorDegrc/AmorDegrcRequestBuilder.cs index 21e2291f48e..6aacd1c8bf0 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/AmorDegrc/AmorDegrcRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/AmorDegrc/AmorDegrcRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action amorDegrc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/AmorLinc/AmorLincRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/AmorLinc/AmorLincRequestBuilder.cs index 1740a502150..850ab66f660 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/AmorLinc/AmorLincRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/AmorLinc/AmorLincRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action amorLinc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Arabic/ArabicRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Arabic/ArabicRequestBuilder.cs index f3264127d65..c1ea0129ff8 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Arabic/ArabicRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Arabic/ArabicRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action arabic"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Areas/AreasRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Areas/AreasRequestBuilder.cs index 3bc8e908082..3fa5150c1e5 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Areas/AreasRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Areas/AreasRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action areas"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Asc/AscRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Asc/AscRequestBuilder.cs index be78fd05abb..32ab4df606d 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Asc/AscRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Asc/AscRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action asc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Asin/AsinRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Asin/AsinRequestBuilder.cs index 8633cdc2abe..7be62c881b3 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Asin/AsinRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Asin/AsinRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action asin"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Asinh/AsinhRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Asinh/AsinhRequestBuilder.cs index 0a58d3a37ab..baa0e39c085 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Asinh/AsinhRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Asinh/AsinhRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action asinh"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Atan/AtanRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Atan/AtanRequestBuilder.cs index 9086bd32baf..2528a7b9ba0 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Atan/AtanRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Atan/AtanRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action atan"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Atan2/Atan2RequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Atan2/Atan2RequestBuilder.cs index 1e1b0f63b55..17532e20d21 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Atan2/Atan2RequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Atan2/Atan2RequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action atan2"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Atanh/AtanhRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Atanh/AtanhRequestBuilder.cs index e1d0692a0da..0375f581e8f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Atanh/AtanhRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Atanh/AtanhRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action atanh"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/AveDev/AveDevRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/AveDev/AveDevRequestBuilder.cs index f54b2037a75..745cdad88db 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/AveDev/AveDevRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/AveDev/AveDevRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action aveDev"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Average/AverageRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Average/AverageRequestBuilder.cs index f963c854b03..fa1e5d5e4cb 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Average/AverageRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Average/AverageRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action average"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/AverageA/AverageARequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/AverageA/AverageARequestBuilder.cs index 2aab3717225..63f39846021 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/AverageA/AverageARequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/AverageA/AverageARequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action averageA"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/AverageIf/AverageIfRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/AverageIf/AverageIfRequestBuilder.cs index 1a544697d64..12dfb1cfa8c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/AverageIf/AverageIfRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/AverageIf/AverageIfRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action averageIf"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/AverageIfs/AverageIfsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/AverageIfs/AverageIfsRequestBuilder.cs index 284bb7db615..11930ea45b2 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/AverageIfs/AverageIfsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/AverageIfs/AverageIfsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action averageIfs"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/BahtText/BahtTextRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/BahtText/BahtTextRequestBuilder.cs index cf42996131e..9d226ce921b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/BahtText/BahtTextRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/BahtText/BahtTextRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action bahtText"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/BesselI/BesselIRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/BesselI/BesselIRequestBuilder.cs index 7343cf5af55..f92c434710f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/BesselI/BesselIRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/BesselI/BesselIRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action besselI"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/BesselJ/BesselJRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/BesselJ/BesselJRequestBuilder.cs index 002c3fb1de3..ef3d067baab 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/BesselJ/BesselJRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/BesselJ/BesselJRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action besselJ"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/BesselK/BesselKRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/BesselK/BesselKRequestBuilder.cs index 85015e3fde7..d2be356af4d 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/BesselK/BesselKRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/BesselK/BesselKRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action besselK"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/BesselY/BesselYRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/BesselY/BesselYRequestBuilder.cs index d3c33105762..1a1d6a1eb36 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/BesselY/BesselYRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/BesselY/BesselYRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action besselY"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Beta_Dist/Beta_DistRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Beta_Dist/Beta_DistRequestBuilder.cs index 424e5410cbb..5cd97acf44f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Beta_Dist/Beta_DistRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Beta_Dist/Beta_DistRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action beta_Dist"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Beta_Inv/Beta_InvRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Beta_Inv/Beta_InvRequestBuilder.cs index 6ed57171fcb..1a985ab7aca 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Beta_Inv/Beta_InvRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Beta_Inv/Beta_InvRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action beta_Inv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Bin2Dec/Bin2DecRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Bin2Dec/Bin2DecRequestBuilder.cs index f1e21b4c67b..8e5e85f9976 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Bin2Dec/Bin2DecRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Bin2Dec/Bin2DecRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action bin2Dec"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Bin2Hex/Bin2HexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Bin2Hex/Bin2HexRequestBuilder.cs index f9c1cb854f6..62ecfcbd495 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Bin2Hex/Bin2HexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Bin2Hex/Bin2HexRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action bin2Hex"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Bin2Oct/Bin2OctRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Bin2Oct/Bin2OctRequestBuilder.cs index 3ab623f184e..378d8f926a4 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Bin2Oct/Bin2OctRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Bin2Oct/Bin2OctRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action bin2Oct"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Binom_Dist/Binom_DistRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Binom_Dist/Binom_DistRequestBuilder.cs index 10d2f194e2e..d9b211899ed 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Binom_Dist/Binom_DistRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Binom_Dist/Binom_DistRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action binom_Dist"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Binom_Dist_Range/Binom_Dist_RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Binom_Dist_Range/Binom_Dist_RangeRequestBuilder.cs index d7ef661a7e6..af2b81d528c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Binom_Dist_Range/Binom_Dist_RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Binom_Dist_Range/Binom_Dist_RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action binom_Dist_Range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Binom_Inv/Binom_InvRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Binom_Inv/Binom_InvRequestBuilder.cs index 3b28dd3595c..7ce29c72534 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Binom_Inv/Binom_InvRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Binom_Inv/Binom_InvRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action binom_Inv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Bitand/BitandRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Bitand/BitandRequestBuilder.cs index 2a8a7719ef5..dfd4e0e434f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Bitand/BitandRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Bitand/BitandRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action bitand"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Bitlshift/BitlshiftRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Bitlshift/BitlshiftRequestBuilder.cs index fd1975e5d69..38bffc4f1c2 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Bitlshift/BitlshiftRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Bitlshift/BitlshiftRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action bitlshift"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Bitor/BitorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Bitor/BitorRequestBuilder.cs index 21d7c91850c..ddbfc2de4cb 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Bitor/BitorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Bitor/BitorRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action bitor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Bitrshift/BitrshiftRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Bitrshift/BitrshiftRequestBuilder.cs index 156ed5c2d73..708e6c020f4 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Bitrshift/BitrshiftRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Bitrshift/BitrshiftRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action bitrshift"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Bitxor/BitxorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Bitxor/BitxorRequestBuilder.cs index ce29eb51fe8..e06ce853261 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Bitxor/BitxorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Bitxor/BitxorRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action bitxor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Ceiling_Math/Ceiling_MathRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Ceiling_Math/Ceiling_MathRequestBuilder.cs index cbffd632ef5..da4175c4014 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Ceiling_Math/Ceiling_MathRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Ceiling_Math/Ceiling_MathRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action ceiling_Math"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Ceiling_Precise/Ceiling_PreciseRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Ceiling_Precise/Ceiling_PreciseRequestBuilder.cs index 1499c95e5e8..103aaef45db 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Ceiling_Precise/Ceiling_PreciseRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Ceiling_Precise/Ceiling_PreciseRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action ceiling_Precise"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Dist/ChiSq_DistRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Dist/ChiSq_DistRequestBuilder.cs index 761ccbfe0eb..c70f884660c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Dist/ChiSq_DistRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Dist/ChiSq_DistRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action chiSq_Dist"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Dist_RT/ChiSq_Dist_RTRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Dist_RT/ChiSq_Dist_RTRequestBuilder.cs index 1dd85fbe90e..1034adfa358 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Dist_RT/ChiSq_Dist_RTRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Dist_RT/ChiSq_Dist_RTRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action chiSq_Dist_RT"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Inv/ChiSq_InvRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Inv/ChiSq_InvRequestBuilder.cs index a4171989050..85643afdcee 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Inv/ChiSq_InvRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Inv/ChiSq_InvRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action chiSq_Inv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Inv_RT/ChiSq_Inv_RTRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Inv_RT/ChiSq_Inv_RTRequestBuilder.cs index 6a3ad778165..2b70cba956a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Inv_RT/ChiSq_Inv_RTRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ChiSq_Inv_RT/ChiSq_Inv_RTRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action chiSq_Inv_RT"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Choose/ChooseRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Choose/ChooseRequestBuilder.cs index e0313f6e2a1..824a64a8878 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Choose/ChooseRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Choose/ChooseRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action choose"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Clean/CleanRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Clean/CleanRequestBuilder.cs index 52d845ac78c..625e50e908a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Clean/CleanRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Clean/CleanRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clean"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Code/CodeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Code/CodeRequestBuilder.cs index 71a5d84efb7..7ed466b0c8b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Code/CodeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Code/CodeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action code"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Columns/ColumnsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Columns/ColumnsRequestBuilder.cs index 134fc9a67ab..6b8c119c5b2 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Columns/ColumnsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Columns/ColumnsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action columns"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Combin/CombinRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Combin/CombinRequestBuilder.cs index d7f7265765d..9e57b292cea 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Combin/CombinRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Combin/CombinRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action combin"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Combina/CombinaRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Combina/CombinaRequestBuilder.cs index 2cd75fab2ed..9268d109064 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Combina/CombinaRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Combina/CombinaRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action combina"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Complex/ComplexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Complex/ComplexRequestBuilder.cs index bb2888bc92f..24ae906dc7f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Complex/ComplexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Complex/ComplexRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action complex"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Concatenate/ConcatenateRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Concatenate/ConcatenateRequestBuilder.cs index f6b0f686d7b..dd383be12de 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Concatenate/ConcatenateRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Concatenate/ConcatenateRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action concatenate"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Confidence_Norm/Confidence_NormRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Confidence_Norm/Confidence_NormRequestBuilder.cs index 747ab1d2321..fecc3debd25 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Confidence_Norm/Confidence_NormRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Confidence_Norm/Confidence_NormRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action confidence_Norm"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Confidence_T/Confidence_TRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Confidence_T/Confidence_TRequestBuilder.cs index ee008e1dbf7..824f15b2e76 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Confidence_T/Confidence_TRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Confidence_T/Confidence_TRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action confidence_T"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Convert/ConvertRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Convert/ConvertRequestBuilder.cs index 12e9d315716..8353c3b86fa 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Convert/ConvertRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Convert/ConvertRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action convert"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Cos/CosRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Cos/CosRequestBuilder.cs index 0d24981ca66..b0cad94ee98 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Cos/CosRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Cos/CosRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cos"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Cosh/CoshRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Cosh/CoshRequestBuilder.cs index 9025a3439ce..a3d61402466 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Cosh/CoshRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Cosh/CoshRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cosh"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Cot/CotRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Cot/CotRequestBuilder.cs index c0ce437faaf..fd83a618828 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Cot/CotRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Cot/CotRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cot"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Coth/CothRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Coth/CothRequestBuilder.cs index 0b43bc5d04a..4bd216914ee 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Coth/CothRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Coth/CothRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action coth"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Count/CountRequestBuilder.cs index 4872efb2541..c74c8148cb5 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Count/CountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/CountA/CountARequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/CountA/CountARequestBuilder.cs index 14ed5a817dd..babec68a618 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/CountA/CountARequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/CountA/CountARequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action countA"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/CountBlank/CountBlankRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/CountBlank/CountBlankRequestBuilder.cs index 24fb9770aa9..80a0661ef73 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/CountBlank/CountBlankRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/CountBlank/CountBlankRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action countBlank"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/CountIf/CountIfRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/CountIf/CountIfRequestBuilder.cs index 55b119ff695..aa3e33dd9b7 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/CountIf/CountIfRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/CountIf/CountIfRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action countIf"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/CountIfs/CountIfsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/CountIfs/CountIfsRequestBuilder.cs index 51bd97665df..6f661fdf53c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/CountIfs/CountIfsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/CountIfs/CountIfsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action countIfs"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/CoupDayBs/CoupDayBsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/CoupDayBs/CoupDayBsRequestBuilder.cs index a6293af4f5f..0ebac30aeae 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/CoupDayBs/CoupDayBsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/CoupDayBs/CoupDayBsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action coupDayBs"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/CoupDays/CoupDaysRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/CoupDays/CoupDaysRequestBuilder.cs index 95c28589ae1..d48a3ad8979 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/CoupDays/CoupDaysRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/CoupDays/CoupDaysRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action coupDays"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/CoupDaysNc/CoupDaysNcRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/CoupDaysNc/CoupDaysNcRequestBuilder.cs index 8cf47954315..69797354abf 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/CoupDaysNc/CoupDaysNcRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/CoupDaysNc/CoupDaysNcRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action coupDaysNc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/CoupNcd/CoupNcdRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/CoupNcd/CoupNcdRequestBuilder.cs index 5dad2bb0684..392144abbd2 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/CoupNcd/CoupNcdRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/CoupNcd/CoupNcdRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action coupNcd"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/CoupNum/CoupNumRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/CoupNum/CoupNumRequestBuilder.cs index 63e87595076..76c334600d3 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/CoupNum/CoupNumRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/CoupNum/CoupNumRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action coupNum"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/CoupPcd/CoupPcdRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/CoupPcd/CoupPcdRequestBuilder.cs index 7f0226cd66f..d6a312b3492 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/CoupPcd/CoupPcdRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/CoupPcd/CoupPcdRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action coupPcd"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Csc/CscRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Csc/CscRequestBuilder.cs index d16690078b7..6cbdd51dc67 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Csc/CscRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Csc/CscRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action csc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Csch/CschRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Csch/CschRequestBuilder.cs index d729bbba425..065b4cb4d65 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Csch/CschRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Csch/CschRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action csch"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/CumIPmt/CumIPmtRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/CumIPmt/CumIPmtRequestBuilder.cs index d9c1e0474f3..4c3b78ea72c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/CumIPmt/CumIPmtRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/CumIPmt/CumIPmtRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cumIPmt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/CumPrinc/CumPrincRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/CumPrinc/CumPrincRequestBuilder.cs index 0205a990a77..7ac65c9e6c0 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/CumPrinc/CumPrincRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/CumPrinc/CumPrincRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action cumPrinc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Date/DateRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Date/DateRequestBuilder.cs index f51f2e0ca48..2f41531de41 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Date/DateRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Date/DateRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action date"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Datevalue/DatevalueRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Datevalue/DatevalueRequestBuilder.cs index 467e05e9632..d058587748f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Datevalue/DatevalueRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Datevalue/DatevalueRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action datevalue"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Daverage/DaverageRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Daverage/DaverageRequestBuilder.cs index c393a418801..60f00b93811 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Daverage/DaverageRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Daverage/DaverageRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action daverage"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Day/DayRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Day/DayRequestBuilder.cs index 6bfebaec8eb..66ff33d56cb 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Day/DayRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Day/DayRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action day"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Days/DaysRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Days/DaysRequestBuilder.cs index 7d10b2479b2..87491469046 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Days/DaysRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Days/DaysRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action days"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Days360/Days360RequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Days360/Days360RequestBuilder.cs index 1c8e4dab371..ac43b91a369 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Days360/Days360RequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Days360/Days360RequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action days360"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Db/DbRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Db/DbRequestBuilder.cs index c67ba7230dc..bdcceec34c8 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Db/DbRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Db/DbRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action db"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Dbcs/DbcsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Dbcs/DbcsRequestBuilder.cs index 4c758e08cdc..31e45e3350b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Dbcs/DbcsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Dbcs/DbcsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dbcs"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Dcount/DcountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Dcount/DcountRequestBuilder.cs index b0f0a7ea093..52ff65dd836 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Dcount/DcountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Dcount/DcountRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dcount"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/DcountA/DcountARequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/DcountA/DcountARequestBuilder.cs index 2900fcb9fa2..b6c261b7fec 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/DcountA/DcountARequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/DcountA/DcountARequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dcountA"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Ddb/DdbRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Ddb/DdbRequestBuilder.cs index 24b2a46f7ae..8b5ab2b86f3 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Ddb/DdbRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Ddb/DdbRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action ddb"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Dec2Bin/Dec2BinRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Dec2Bin/Dec2BinRequestBuilder.cs index 57306185c8d..3b2ee4db2c6 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Dec2Bin/Dec2BinRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Dec2Bin/Dec2BinRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dec2Bin"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Dec2Hex/Dec2HexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Dec2Hex/Dec2HexRequestBuilder.cs index 2a3ff052e6f..423099c4a2e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Dec2Hex/Dec2HexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Dec2Hex/Dec2HexRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dec2Hex"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Dec2Oct/Dec2OctRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Dec2Oct/Dec2OctRequestBuilder.cs index fef48064faa..7f9df380e9f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Dec2Oct/Dec2OctRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Dec2Oct/Dec2OctRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dec2Oct"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Degrees/DegreesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Degrees/DegreesRequestBuilder.cs index 80c4dcda601..21dd2ce69ec 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Degrees/DegreesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Degrees/DegreesRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action degrees"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Delta/DeltaRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Delta/DeltaRequestBuilder.cs index 2a4f6aa1f0f..b1aa7dd8b09 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Delta/DeltaRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Delta/DeltaRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action delta"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/DevSq/DevSqRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/DevSq/DevSqRequestBuilder.cs index 5b7b8cfa47d..60874ae641f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/DevSq/DevSqRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/DevSq/DevSqRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action devSq"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Dget/DgetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Dget/DgetRequestBuilder.cs index 1b15e5354cb..46ab4dd23fa 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Dget/DgetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Dget/DgetRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dget"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Disc/DiscRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Disc/DiscRequestBuilder.cs index 0d8939378cc..4fb7561d70d 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Disc/DiscRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Disc/DiscRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action disc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Dmax/DmaxRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Dmax/DmaxRequestBuilder.cs index 37ee852376f..46c469c6cee 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Dmax/DmaxRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Dmax/DmaxRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dmax"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Dmin/DminRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Dmin/DminRequestBuilder.cs index 37fc1cfbd46..5fb277e7f15 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Dmin/DminRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Dmin/DminRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dmin"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Dollar/DollarRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Dollar/DollarRequestBuilder.cs index 87ea3eea6f6..6a591f7b81b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Dollar/DollarRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Dollar/DollarRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dollar"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/DollarDe/DollarDeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/DollarDe/DollarDeRequestBuilder.cs index 122ebba3e2d..924e2c9ed3c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/DollarDe/DollarDeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/DollarDe/DollarDeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dollarDe"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/DollarFr/DollarFrRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/DollarFr/DollarFrRequestBuilder.cs index cd40e4250ec..44c13972521 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/DollarFr/DollarFrRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/DollarFr/DollarFrRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dollarFr"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Dproduct/DproductRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Dproduct/DproductRequestBuilder.cs index 0c99905b2b7..eeefaee5795 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Dproduct/DproductRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Dproduct/DproductRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dproduct"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/DstDev/DstDevRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/DstDev/DstDevRequestBuilder.cs index 138373afbd8..629eec45dcb 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/DstDev/DstDevRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/DstDev/DstDevRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dstDev"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/DstDevP/DstDevPRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/DstDevP/DstDevPRequestBuilder.cs index 69267254814..d62cd710ef2 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/DstDevP/DstDevPRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/DstDevP/DstDevPRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dstDevP"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Dsum/DsumRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Dsum/DsumRequestBuilder.cs index 2b7477277b1..9b9b0200c6b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Dsum/DsumRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Dsum/DsumRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dsum"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Duration/DurationRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Duration/DurationRequestBuilder.cs index 6f3f389f17d..ad14917aaf6 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Duration/DurationRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Duration/DurationRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action duration"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Dvar/DvarRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Dvar/DvarRequestBuilder.cs index 63eef812e33..a8f97932ef2 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Dvar/DvarRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Dvar/DvarRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dvar"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/DvarP/DvarPRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/DvarP/DvarPRequestBuilder.cs index 22f2106d55a..1f778cb8122 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/DvarP/DvarPRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/DvarP/DvarPRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action dvarP"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Ecma_Ceiling/Ecma_CeilingRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Ecma_Ceiling/Ecma_CeilingRequestBuilder.cs index d8adcffe6de..a957ce7bd0b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Ecma_Ceiling/Ecma_CeilingRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Ecma_Ceiling/Ecma_CeilingRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action ecma_Ceiling"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Edate/EdateRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Edate/EdateRequestBuilder.cs index 632b02513ae..03790f29102 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Edate/EdateRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Edate/EdateRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action edate"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Effect/EffectRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Effect/EffectRequestBuilder.cs index d0e4734185f..2211a03bdf6 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Effect/EffectRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Effect/EffectRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action effect"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/EoMonth/EoMonthRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/EoMonth/EoMonthRequestBuilder.cs index 04d7ab384c0..e7a83ea1d6c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/EoMonth/EoMonthRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/EoMonth/EoMonthRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action eoMonth"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Erf/ErfRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Erf/ErfRequestBuilder.cs index 5471fbbff90..2a84d8a487b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Erf/ErfRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Erf/ErfRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action erf"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ErfC/ErfCRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ErfC/ErfCRequestBuilder.cs index 25c0b75e577..89a5eca8657 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ErfC/ErfCRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ErfC/ErfCRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action erfC"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ErfC_Precise/ErfC_PreciseRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ErfC_Precise/ErfC_PreciseRequestBuilder.cs index 6e8624cc0b0..de07951d736 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ErfC_Precise/ErfC_PreciseRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ErfC_Precise/ErfC_PreciseRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action erfC_Precise"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Erf_Precise/Erf_PreciseRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Erf_Precise/Erf_PreciseRequestBuilder.cs index fd6f207269b..9632d071d59 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Erf_Precise/Erf_PreciseRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Erf_Precise/Erf_PreciseRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action erf_Precise"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Error_Type/Error_TypeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Error_Type/Error_TypeRequestBuilder.cs index 4e2e3d6c01e..8791323ea23 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Error_Type/Error_TypeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Error_Type/Error_TypeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action error_Type"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Even/EvenRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Even/EvenRequestBuilder.cs index 463f1942614..e81091cdf6c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Even/EvenRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Even/EvenRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action even"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Exact/ExactRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Exact/ExactRequestBuilder.cs index 055e0fda3f9..86ef2bc904a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Exact/ExactRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Exact/ExactRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action exact"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Exp/ExpRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Exp/ExpRequestBuilder.cs index c88e952edc5..7f8d2067934 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Exp/ExpRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Exp/ExpRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action exp"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Expon_Dist/Expon_DistRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Expon_Dist/Expon_DistRequestBuilder.cs index 53355d82444..de859933ae8 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Expon_Dist/Expon_DistRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Expon_Dist/Expon_DistRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action expon_Dist"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/F_Dist/F_DistRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/F_Dist/F_DistRequestBuilder.cs index 2047141322e..bd263a5de25 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/F_Dist/F_DistRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/F_Dist/F_DistRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action f_Dist"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/F_Dist_RT/F_Dist_RTRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/F_Dist_RT/F_Dist_RTRequestBuilder.cs index 7e1a1dc5250..71e27614579 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/F_Dist_RT/F_Dist_RTRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/F_Dist_RT/F_Dist_RTRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action f_Dist_RT"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/F_Inv/F_InvRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/F_Inv/F_InvRequestBuilder.cs index ce227a29c4c..47a04a35ae9 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/F_Inv/F_InvRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/F_Inv/F_InvRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action f_Inv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/F_Inv_RT/F_Inv_RTRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/F_Inv_RT/F_Inv_RTRequestBuilder.cs index 9413f0cb559..a72ae28d14e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/F_Inv_RT/F_Inv_RTRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/F_Inv_RT/F_Inv_RTRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action f_Inv_RT"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Fact/FactRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Fact/FactRequestBuilder.cs index f7370e1cfe9..08e8bf7a940 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Fact/FactRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Fact/FactRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action fact"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/FactDouble/FactDoubleRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/FactDouble/FactDoubleRequestBuilder.cs index 58bf2c17e7d..8a52349ee63 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/FactDouble/FactDoubleRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/FactDouble/FactDoubleRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action factDouble"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Find/FindRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Find/FindRequestBuilder.cs index f12a09d411d..fa0807cf2b5 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Find/FindRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Find/FindRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action find"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/FindB/FindBRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/FindB/FindBRequestBuilder.cs index 91e02ce0740..7ec391f2f46 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/FindB/FindBRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/FindB/FindBRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action findB"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Fisher/FisherRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Fisher/FisherRequestBuilder.cs index f4d026336ea..ce6254ac5d2 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Fisher/FisherRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Fisher/FisherRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action fisher"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/FisherInv/FisherInvRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/FisherInv/FisherInvRequestBuilder.cs index fd11263e228..c373b48be82 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/FisherInv/FisherInvRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/FisherInv/FisherInvRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action fisherInv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Floor_Math/Floor_MathRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Floor_Math/Floor_MathRequestBuilder.cs index fd08a58debb..bbe2fa03ce7 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Floor_Math/Floor_MathRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Floor_Math/Floor_MathRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action floor_Math"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Floor_Precise/Floor_PreciseRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Floor_Precise/Floor_PreciseRequestBuilder.cs index fa5d6b7c9f8..682c4d69fc2 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Floor_Precise/Floor_PreciseRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Floor_Precise/Floor_PreciseRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action floor_Precise"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/FunctionsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/FunctionsRequestBuilder.cs index d1f8eba5371..e9a71bdd22a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/FunctionsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/FunctionsRequestBuilder.cs @@ -962,10 +962,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Delete navigation property functions for workbooks"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -1303,14 +1305,22 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get functions from workbooks"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -1959,14 +1969,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Update the navigation property functions in workbooks"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Fv/FvRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Fv/FvRequestBuilder.cs index 798d67fae37..c26fe0a17dd 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Fv/FvRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Fv/FvRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action fv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Fvschedule/FvscheduleRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Fvschedule/FvscheduleRequestBuilder.cs index 0cf2c51e4a6..1922556e76e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Fvschedule/FvscheduleRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Fvschedule/FvscheduleRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action fvschedule"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Gamma/GammaRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Gamma/GammaRequestBuilder.cs index fbf6be095ad..a3b9b01fddd 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Gamma/GammaRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Gamma/GammaRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action gamma"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/GammaLn/GammaLnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/GammaLn/GammaLnRequestBuilder.cs index deca065b407..d682b9334ba 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/GammaLn/GammaLnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/GammaLn/GammaLnRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action gammaLn"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/GammaLn_Precise/GammaLn_PreciseRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/GammaLn_Precise/GammaLn_PreciseRequestBuilder.cs index 262ac19900b..084ded1efdf 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/GammaLn_Precise/GammaLn_PreciseRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/GammaLn_Precise/GammaLn_PreciseRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action gammaLn_Precise"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Gamma_Dist/Gamma_DistRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Gamma_Dist/Gamma_DistRequestBuilder.cs index c34b7ac7659..9e866e83408 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Gamma_Dist/Gamma_DistRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Gamma_Dist/Gamma_DistRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action gamma_Dist"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Gamma_Inv/Gamma_InvRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Gamma_Inv/Gamma_InvRequestBuilder.cs index c773417c957..8a3fd05bb73 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Gamma_Inv/Gamma_InvRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Gamma_Inv/Gamma_InvRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action gamma_Inv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Gauss/GaussRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Gauss/GaussRequestBuilder.cs index 7f212ce59eb..e70154518e0 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Gauss/GaussRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Gauss/GaussRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action gauss"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Gcd/GcdRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Gcd/GcdRequestBuilder.cs index 5be1ad98221..71fd1d2fe0b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Gcd/GcdRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Gcd/GcdRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action gcd"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/GeStep/GeStepRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/GeStep/GeStepRequestBuilder.cs index e293ebfb326..d0be9e9dea5 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/GeStep/GeStepRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/GeStep/GeStepRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action geStep"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/GeoMean/GeoMeanRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/GeoMean/GeoMeanRequestBuilder.cs index f52f675e505..e7b2fc169ec 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/GeoMean/GeoMeanRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/GeoMean/GeoMeanRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action geoMean"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/HarMean/HarMeanRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/HarMean/HarMeanRequestBuilder.cs index 900da499306..0ef31b348dc 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/HarMean/HarMeanRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/HarMean/HarMeanRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action harMean"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Hex2Bin/Hex2BinRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Hex2Bin/Hex2BinRequestBuilder.cs index 4ee45f8c37b..b751c5d951b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Hex2Bin/Hex2BinRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Hex2Bin/Hex2BinRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action hex2Bin"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Hex2Dec/Hex2DecRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Hex2Dec/Hex2DecRequestBuilder.cs index 8cd41feaf13..d8cb074b0ff 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Hex2Dec/Hex2DecRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Hex2Dec/Hex2DecRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action hex2Dec"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Hex2Oct/Hex2OctRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Hex2Oct/Hex2OctRequestBuilder.cs index 622551db8b4..70b12ed818f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Hex2Oct/Hex2OctRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Hex2Oct/Hex2OctRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action hex2Oct"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Hlookup/HlookupRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Hlookup/HlookupRequestBuilder.cs index 67b1c49ec98..0c62801eae8 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Hlookup/HlookupRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Hlookup/HlookupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action hlookup"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Hour/HourRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Hour/HourRequestBuilder.cs index 76b2fde3730..abefd49a865 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Hour/HourRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Hour/HourRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action hour"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/HypGeom_Dist/HypGeom_DistRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/HypGeom_Dist/HypGeom_DistRequestBuilder.cs index 8e9354e263a..4fa2b9b3b03 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/HypGeom_Dist/HypGeom_DistRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/HypGeom_Dist/HypGeom_DistRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action hypGeom_Dist"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Hyperlink/HyperlinkRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Hyperlink/HyperlinkRequestBuilder.cs index d13389fa664..d10ecdd4b4a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Hyperlink/HyperlinkRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Hyperlink/HyperlinkRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action hyperlink"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImAbs/ImAbsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImAbs/ImAbsRequestBuilder.cs index 2bfc2ef415f..490a708d22f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImAbs/ImAbsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImAbs/ImAbsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imAbs"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImArgument/ImArgumentRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImArgument/ImArgumentRequestBuilder.cs index c4b67ef4f62..933103bf77e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImArgument/ImArgumentRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImArgument/ImArgumentRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imArgument"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImConjugate/ImConjugateRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImConjugate/ImConjugateRequestBuilder.cs index 778625a9880..b076fece2a5 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImConjugate/ImConjugateRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImConjugate/ImConjugateRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imConjugate"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImCos/ImCosRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImCos/ImCosRequestBuilder.cs index 523579edcc3..d2b77892e00 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImCos/ImCosRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImCos/ImCosRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imCos"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImCosh/ImCoshRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImCosh/ImCoshRequestBuilder.cs index 6ffa287e171..1d2edd5bff9 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImCosh/ImCoshRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImCosh/ImCoshRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imCosh"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImCot/ImCotRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImCot/ImCotRequestBuilder.cs index 3e14d552bbc..70f170549ee 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImCot/ImCotRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImCot/ImCotRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imCot"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImCsc/ImCscRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImCsc/ImCscRequestBuilder.cs index ea7d7b8aa39..2cda3359088 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImCsc/ImCscRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImCsc/ImCscRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imCsc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImCsch/ImCschRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImCsch/ImCschRequestBuilder.cs index fdcc911488d..103d92bd641 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImCsch/ImCschRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImCsch/ImCschRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imCsch"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImDiv/ImDivRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImDiv/ImDivRequestBuilder.cs index 09da4290bd9..edf73f3ea9b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImDiv/ImDivRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImDiv/ImDivRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imDiv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImExp/ImExpRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImExp/ImExpRequestBuilder.cs index 92b514b1261..966ae02944c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImExp/ImExpRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImExp/ImExpRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imExp"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImLn/ImLnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImLn/ImLnRequestBuilder.cs index 3ffb1ed0f2f..d23170800b3 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImLn/ImLnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImLn/ImLnRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imLn"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImLog10/ImLog10RequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImLog10/ImLog10RequestBuilder.cs index 56e4fcf5608..ca84fc72378 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImLog10/ImLog10RequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImLog10/ImLog10RequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imLog10"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImLog2/ImLog2RequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImLog2/ImLog2RequestBuilder.cs index 172dd8b6b34..4210c097141 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImLog2/ImLog2RequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImLog2/ImLog2RequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imLog2"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImPower/ImPowerRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImPower/ImPowerRequestBuilder.cs index a888229db7b..64841e67a44 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImPower/ImPowerRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImPower/ImPowerRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imPower"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImProduct/ImProductRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImProduct/ImProductRequestBuilder.cs index 656671ca352..684a3199a53 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImProduct/ImProductRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImProduct/ImProductRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imProduct"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImReal/ImRealRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImReal/ImRealRequestBuilder.cs index aae5d381a40..5e50c56f83a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImReal/ImRealRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImReal/ImRealRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imReal"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImSec/ImSecRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImSec/ImSecRequestBuilder.cs index 342d5278b40..781ba8b4996 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImSec/ImSecRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImSec/ImSecRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imSec"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImSech/ImSechRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImSech/ImSechRequestBuilder.cs index 9da2d97621a..1c384eb5f00 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImSech/ImSechRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImSech/ImSechRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imSech"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImSin/ImSinRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImSin/ImSinRequestBuilder.cs index 80d5a414cd8..c1d641f41b7 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImSin/ImSinRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImSin/ImSinRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imSin"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImSinh/ImSinhRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImSinh/ImSinhRequestBuilder.cs index 2797bf41401..ea96151a368 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImSinh/ImSinhRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImSinh/ImSinhRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imSinh"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImSqrt/ImSqrtRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImSqrt/ImSqrtRequestBuilder.cs index e75be95bd7c..6f720e44550 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImSqrt/ImSqrtRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImSqrt/ImSqrtRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imSqrt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImSub/ImSubRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImSub/ImSubRequestBuilder.cs index a8783c2e0e2..a981fc126cc 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImSub/ImSubRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImSub/ImSubRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imSub"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImSum/ImSumRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImSum/ImSumRequestBuilder.cs index f392e93f351..cc3510f7f53 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImSum/ImSumRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImSum/ImSumRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imSum"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ImTan/ImTanRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ImTan/ImTanRequestBuilder.cs index 5c0db07ccb7..e5ba3ff1890 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ImTan/ImTanRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ImTan/ImTanRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imTan"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Imaginary/ImaginaryRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Imaginary/ImaginaryRequestBuilder.cs index 484487c2c88..f0be8c553bb 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Imaginary/ImaginaryRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Imaginary/ImaginaryRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action imaginary"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/IntRate/IntRateRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/IntRate/IntRateRequestBuilder.cs index 8d8d2436990..a7e504f1eaa 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/IntRate/IntRateRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/IntRate/IntRateRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action intRate"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Ipmt/IpmtRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Ipmt/IpmtRequestBuilder.cs index 3e52f4562f4..1adda6f1313 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Ipmt/IpmtRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Ipmt/IpmtRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action ipmt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Irr/IrrRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Irr/IrrRequestBuilder.cs index b032df990d3..f22defe7bb6 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Irr/IrrRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Irr/IrrRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action irr"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/IsErr/IsErrRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/IsErr/IsErrRequestBuilder.cs index 0111810ca8c..948730261eb 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/IsErr/IsErrRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/IsErr/IsErrRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action isErr"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/IsError/IsErrorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/IsError/IsErrorRequestBuilder.cs index 9b098be2d34..da1a24fce13 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/IsError/IsErrorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/IsError/IsErrorRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action isError"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/IsEven/IsEvenRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/IsEven/IsEvenRequestBuilder.cs index cd42d4da588..908e08f925e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/IsEven/IsEvenRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/IsEven/IsEvenRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action isEven"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/IsFormula/IsFormulaRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/IsFormula/IsFormulaRequestBuilder.cs index de2609b4052..b10daa299fb 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/IsFormula/IsFormulaRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/IsFormula/IsFormulaRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action isFormula"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/IsLogical/IsLogicalRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/IsLogical/IsLogicalRequestBuilder.cs index 2352d467024..c2428336eac 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/IsLogical/IsLogicalRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/IsLogical/IsLogicalRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action isLogical"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/IsNA/IsNARequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/IsNA/IsNARequestBuilder.cs index 0b0db437c6a..cc7e92cd7bc 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/IsNA/IsNARequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/IsNA/IsNARequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action isNA"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/IsNonText/IsNonTextRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/IsNonText/IsNonTextRequestBuilder.cs index 6db3abd78fd..2aa7ef13b55 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/IsNonText/IsNonTextRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/IsNonText/IsNonTextRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action isNonText"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/IsNumber/IsNumberRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/IsNumber/IsNumberRequestBuilder.cs index 9626c651269..c19b2a0b968 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/IsNumber/IsNumberRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/IsNumber/IsNumberRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action isNumber"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/IsOdd/IsOddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/IsOdd/IsOddRequestBuilder.cs index f9969809ab8..00193c0ff26 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/IsOdd/IsOddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/IsOdd/IsOddRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action isOdd"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/IsText/IsTextRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/IsText/IsTextRequestBuilder.cs index 32e7cf188ed..63d4312d4ed 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/IsText/IsTextRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/IsText/IsTextRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action isText"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/IsoWeekNum/IsoWeekNumRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/IsoWeekNum/IsoWeekNumRequestBuilder.cs index 82681668432..b1ab5ed36b7 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/IsoWeekNum/IsoWeekNumRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/IsoWeekNum/IsoWeekNumRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action isoWeekNum"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Iso_Ceiling/Iso_CeilingRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Iso_Ceiling/Iso_CeilingRequestBuilder.cs index e212847feb5..bfe33262971 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Iso_Ceiling/Iso_CeilingRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Iso_Ceiling/Iso_CeilingRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action iso_Ceiling"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Ispmt/IspmtRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Ispmt/IspmtRequestBuilder.cs index 177d266a0b2..51c7f34de91 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Ispmt/IspmtRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Ispmt/IspmtRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action ispmt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Isref/IsrefRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Isref/IsrefRequestBuilder.cs index 90ef210ab04..422c0110f12 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Isref/IsrefRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Isref/IsrefRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action isref"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Kurt/KurtRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Kurt/KurtRequestBuilder.cs index 50fb0814567..1ef75b377f4 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Kurt/KurtRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Kurt/KurtRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action kurt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Large/LargeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Large/LargeRequestBuilder.cs index 04f1a77e8e2..bdc1a158bd3 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Large/LargeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Large/LargeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action large"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Lcm/LcmRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Lcm/LcmRequestBuilder.cs index 3def25417a7..9fe4365539d 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Lcm/LcmRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Lcm/LcmRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action lcm"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Left/LeftRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Left/LeftRequestBuilder.cs index 25669cea64a..10d076ec961 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Left/LeftRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Left/LeftRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action left"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Leftb/LeftbRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Leftb/LeftbRequestBuilder.cs index deb99ade702..032bdde8fe5 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Leftb/LeftbRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Leftb/LeftbRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action leftb"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Len/LenRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Len/LenRequestBuilder.cs index 08fddb65b87..bbaec086d37 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Len/LenRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Len/LenRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action len"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Lenb/LenbRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Lenb/LenbRequestBuilder.cs index 7bb14ab9f17..78db195670a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Lenb/LenbRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Lenb/LenbRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action lenb"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Ln/LnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Ln/LnRequestBuilder.cs index 5bc78070d48..61e20aff367 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Ln/LnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Ln/LnRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action ln"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Log/LogRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Log/LogRequestBuilder.cs index 893c1a462d4..90064b31a81 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Log/LogRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Log/LogRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action log"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Log10/Log10RequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Log10/Log10RequestBuilder.cs index 2cfceb3b9bf..f16f22b5468 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Log10/Log10RequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Log10/Log10RequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action log10"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/LogNorm_Dist/LogNorm_DistRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/LogNorm_Dist/LogNorm_DistRequestBuilder.cs index e75f97fd6a0..7b8d7060abd 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/LogNorm_Dist/LogNorm_DistRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/LogNorm_Dist/LogNorm_DistRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action logNorm_Dist"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/LogNorm_Inv/LogNorm_InvRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/LogNorm_Inv/LogNorm_InvRequestBuilder.cs index 51a845d29f6..e8a2fede62b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/LogNorm_Inv/LogNorm_InvRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/LogNorm_Inv/LogNorm_InvRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action logNorm_Inv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Lookup/LookupRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Lookup/LookupRequestBuilder.cs index eb116613750..8647ca86f0a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Lookup/LookupRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Lookup/LookupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action lookup"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Lower/LowerRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Lower/LowerRequestBuilder.cs index c80c211781e..f21607d9295 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Lower/LowerRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Lower/LowerRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action lower"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Match/MatchRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Match/MatchRequestBuilder.cs index 07057a4039a..b487edd86b4 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Match/MatchRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Match/MatchRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action match"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Max/MaxRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Max/MaxRequestBuilder.cs index 8d10ba39613..f5cc13e691d 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Max/MaxRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Max/MaxRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action max"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/MaxA/MaxARequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/MaxA/MaxARequestBuilder.cs index a67e61f6660..4b85abdbb76 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/MaxA/MaxARequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/MaxA/MaxARequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action maxA"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Mduration/MdurationRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Mduration/MdurationRequestBuilder.cs index dbedfd23788..f3158671d26 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Mduration/MdurationRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Mduration/MdurationRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action mduration"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Median/MedianRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Median/MedianRequestBuilder.cs index c80399e6304..35d9b75631b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Median/MedianRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Median/MedianRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action median"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Mid/MidRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Mid/MidRequestBuilder.cs index c35f83e3d26..aa107baaadf 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Mid/MidRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Mid/MidRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action mid"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Midb/MidbRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Midb/MidbRequestBuilder.cs index a65e36b408b..3c0b377f259 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Midb/MidbRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Midb/MidbRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action midb"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Min/MinRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Min/MinRequestBuilder.cs index c34f0ecc703..e2112b5eedf 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Min/MinRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Min/MinRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action min"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/MinA/MinARequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/MinA/MinARequestBuilder.cs index 6f225161984..0dec1d1b0f7 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/MinA/MinARequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/MinA/MinARequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action minA"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Minute/MinuteRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Minute/MinuteRequestBuilder.cs index a64fef8f0ef..1ed4b5c7c0e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Minute/MinuteRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Minute/MinuteRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action minute"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Mirr/MirrRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Mirr/MirrRequestBuilder.cs index 14faaa5e6cb..e0b0e3adf6a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Mirr/MirrRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Mirr/MirrRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action mirr"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Mod/ModRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Mod/ModRequestBuilder.cs index 936171d6e46..85bf68a6f8a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Mod/ModRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Mod/ModRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action mod"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Month/MonthRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Month/MonthRequestBuilder.cs index 1cb1e0385c0..78ba57240a7 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Month/MonthRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Month/MonthRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action month"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Mround/MroundRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Mround/MroundRequestBuilder.cs index b1cb66f4b9b..33fbdf44f6a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Mround/MroundRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Mround/MroundRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action mround"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/MultiNomial/MultiNomialRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/MultiNomial/MultiNomialRequestBuilder.cs index fdb6d8baf51..5a6c43f80f6 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/MultiNomial/MultiNomialRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/MultiNomial/MultiNomialRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action multiNomial"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/N/NRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/N/NRequestBuilder.cs index 2a6aea29b3e..0bb7fae2894 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/N/NRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/N/NRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action n"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Na/NaRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Na/NaRequestBuilder.cs index 3b85114d57f..a608fb9204d 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Na/NaRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Na/NaRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action na"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/NegBinom_Dist/NegBinom_DistRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/NegBinom_Dist/NegBinom_DistRequestBuilder.cs index 6853bc78b59..8a5572d3bbc 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/NegBinom_Dist/NegBinom_DistRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/NegBinom_Dist/NegBinom_DistRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action negBinom_Dist"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/NetworkDays/NetworkDaysRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/NetworkDays/NetworkDaysRequestBuilder.cs index 79977812627..b9bd83dcd33 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/NetworkDays/NetworkDaysRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/NetworkDays/NetworkDaysRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action networkDays"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/NetworkDays_Intl/NetworkDays_IntlRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/NetworkDays_Intl/NetworkDays_IntlRequestBuilder.cs index 5297e3c07bd..c7c363f1c28 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/NetworkDays_Intl/NetworkDays_IntlRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/NetworkDays_Intl/NetworkDays_IntlRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action networkDays_Intl"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Nominal/NominalRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Nominal/NominalRequestBuilder.cs index 00db5190973..7ad6bcf085e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Nominal/NominalRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Nominal/NominalRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action nominal"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Norm_Dist/Norm_DistRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Norm_Dist/Norm_DistRequestBuilder.cs index 6ac363d6ea1..ed17c214bac 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Norm_Dist/Norm_DistRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Norm_Dist/Norm_DistRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action norm_Dist"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Norm_Inv/Norm_InvRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Norm_Inv/Norm_InvRequestBuilder.cs index 5ea6f4ad2ca..68ef260e71b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Norm_Inv/Norm_InvRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Norm_Inv/Norm_InvRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action norm_Inv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Norm_S_Dist/Norm_S_DistRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Norm_S_Dist/Norm_S_DistRequestBuilder.cs index efccc44b126..e602abab7de 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Norm_S_Dist/Norm_S_DistRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Norm_S_Dist/Norm_S_DistRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action norm_S_Dist"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Norm_S_Inv/Norm_S_InvRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Norm_S_Inv/Norm_S_InvRequestBuilder.cs index b0cc1826984..e224441c82f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Norm_S_Inv/Norm_S_InvRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Norm_S_Inv/Norm_S_InvRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action norm_S_Inv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Now/NowRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Now/NowRequestBuilder.cs index 2ce77d716e7..8944f76ec0f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Now/NowRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Now/NowRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action now"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Nper/NperRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Nper/NperRequestBuilder.cs index 997cbaad13a..f6abb8e52f6 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Nper/NperRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Nper/NperRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action nper"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Npv/NpvRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Npv/NpvRequestBuilder.cs index 62164f86cb0..8a6b29e4b40 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Npv/NpvRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Npv/NpvRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action npv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/NumberValue/NumberValueRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/NumberValue/NumberValueRequestBuilder.cs index c212e9c75fd..3f5782ab00f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/NumberValue/NumberValueRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/NumberValue/NumberValueRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action numberValue"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Oct2Bin/Oct2BinRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Oct2Bin/Oct2BinRequestBuilder.cs index a6e87e8895b..c15a3343541 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Oct2Bin/Oct2BinRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Oct2Bin/Oct2BinRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action oct2Bin"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Oct2Dec/Oct2DecRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Oct2Dec/Oct2DecRequestBuilder.cs index f2cdc6377e3..28d5c72e4da 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Oct2Dec/Oct2DecRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Oct2Dec/Oct2DecRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action oct2Dec"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Oct2Hex/Oct2HexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Oct2Hex/Oct2HexRequestBuilder.cs index 4739e53d990..484693a7b45 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Oct2Hex/Oct2HexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Oct2Hex/Oct2HexRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action oct2Hex"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Odd/OddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Odd/OddRequestBuilder.cs index 68470712e4d..81ca1e67a96 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Odd/OddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Odd/OddRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action odd"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/OddFPrice/OddFPriceRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/OddFPrice/OddFPriceRequestBuilder.cs index e74c8b1ae9c..b1a62719e0f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/OddFPrice/OddFPriceRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/OddFPrice/OddFPriceRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action oddFPrice"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/OddFYield/OddFYieldRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/OddFYield/OddFYieldRequestBuilder.cs index d5706485a6c..be6de6df62c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/OddFYield/OddFYieldRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/OddFYield/OddFYieldRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action oddFYield"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/OddLPrice/OddLPriceRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/OddLPrice/OddLPriceRequestBuilder.cs index aa963ff2dcc..618e4269307 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/OddLPrice/OddLPriceRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/OddLPrice/OddLPriceRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action oddLPrice"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/OddLYield/OddLYieldRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/OddLYield/OddLYieldRequestBuilder.cs index 1a3b97f246c..b309e6a2518 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/OddLYield/OddLYieldRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/OddLYield/OddLYieldRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action oddLYield"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Pduration/PdurationRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Pduration/PdurationRequestBuilder.cs index 31fd3f42ca3..176d7c4562e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Pduration/PdurationRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Pduration/PdurationRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action pduration"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/PercentRank_Exc/PercentRank_ExcRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/PercentRank_Exc/PercentRank_ExcRequestBuilder.cs index 41671368da9..71fb11e2808 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/PercentRank_Exc/PercentRank_ExcRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/PercentRank_Exc/PercentRank_ExcRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action percentRank_Exc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/PercentRank_Inc/PercentRank_IncRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/PercentRank_Inc/PercentRank_IncRequestBuilder.cs index e1500809a19..33597ca0ca6 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/PercentRank_Inc/PercentRank_IncRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/PercentRank_Inc/PercentRank_IncRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action percentRank_Inc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Percentile_Exc/Percentile_ExcRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Percentile_Exc/Percentile_ExcRequestBuilder.cs index b30573b6021..9ed3554a30e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Percentile_Exc/Percentile_ExcRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Percentile_Exc/Percentile_ExcRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action percentile_Exc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Percentile_Inc/Percentile_IncRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Percentile_Inc/Percentile_IncRequestBuilder.cs index 82b08a42e5c..5f63c8a8638 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Percentile_Inc/Percentile_IncRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Percentile_Inc/Percentile_IncRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action percentile_Inc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Permut/PermutRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Permut/PermutRequestBuilder.cs index b8d75a80336..1eb7f24cb82 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Permut/PermutRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Permut/PermutRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action permut"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Permutationa/PermutationaRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Permutationa/PermutationaRequestBuilder.cs index f986f0b620c..c194e8e5179 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Permutationa/PermutationaRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Permutationa/PermutationaRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action permutationa"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Phi/PhiRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Phi/PhiRequestBuilder.cs index 158357d005f..18cb9f3883b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Phi/PhiRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Phi/PhiRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action phi"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Pi/PiRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Pi/PiRequestBuilder.cs index 3825291ae9d..11671d5f511 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Pi/PiRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Pi/PiRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action pi"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Pmt/PmtRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Pmt/PmtRequestBuilder.cs index deac20d7284..bd83c0b407a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Pmt/PmtRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Pmt/PmtRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action pmt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Poisson_Dist/Poisson_DistRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Poisson_Dist/Poisson_DistRequestBuilder.cs index a52df6cd25f..7f0db6ff457 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Poisson_Dist/Poisson_DistRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Poisson_Dist/Poisson_DistRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action poisson_Dist"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Power/PowerRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Power/PowerRequestBuilder.cs index 40452195ea1..46f1238a391 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Power/PowerRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Power/PowerRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action power"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Ppmt/PpmtRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Ppmt/PpmtRequestBuilder.cs index 52e9b8a4124..897e81cff0f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Ppmt/PpmtRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Ppmt/PpmtRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action ppmt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Price/PriceRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Price/PriceRequestBuilder.cs index 00781250969..bc98af16d85 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Price/PriceRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Price/PriceRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action price"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/PriceDisc/PriceDiscRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/PriceDisc/PriceDiscRequestBuilder.cs index 9326767717d..0ecf2a917a0 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/PriceDisc/PriceDiscRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/PriceDisc/PriceDiscRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action priceDisc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/PriceMat/PriceMatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/PriceMat/PriceMatRequestBuilder.cs index f025502354b..ebf76ba5df3 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/PriceMat/PriceMatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/PriceMat/PriceMatRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action priceMat"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Product/ProductRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Product/ProductRequestBuilder.cs index 3d9481f47d7..ca5265f9ae7 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Product/ProductRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Product/ProductRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action product"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Proper/ProperRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Proper/ProperRequestBuilder.cs index a60e04404ce..fe2d85a9333 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Proper/ProperRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Proper/ProperRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action proper"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Pv/PvRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Pv/PvRequestBuilder.cs index ef882f958ae..b22034ffd44 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Pv/PvRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Pv/PvRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action pv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Quartile_Exc/Quartile_ExcRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Quartile_Exc/Quartile_ExcRequestBuilder.cs index bf6c7f421b6..c216562c839 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Quartile_Exc/Quartile_ExcRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Quartile_Exc/Quartile_ExcRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action quartile_Exc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Quartile_Inc/Quartile_IncRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Quartile_Inc/Quartile_IncRequestBuilder.cs index 98f89b86be5..8873cf78969 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Quartile_Inc/Quartile_IncRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Quartile_Inc/Quartile_IncRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action quartile_Inc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Quotient/QuotientRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Quotient/QuotientRequestBuilder.cs index 45a82f9117c..c29eaf53ceb 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Quotient/QuotientRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Quotient/QuotientRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action quotient"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Radians/RadiansRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Radians/RadiansRequestBuilder.cs index cdc2d483a56..64f01810070 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Radians/RadiansRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Radians/RadiansRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action radians"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Rand/RandRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Rand/RandRequestBuilder.cs index a22d55c62ba..a6a191a088c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Rand/RandRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Rand/RandRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action rand"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/RandBetween/RandBetweenRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/RandBetween/RandBetweenRequestBuilder.cs index 78bfc1db877..2034b2bc49e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/RandBetween/RandBetweenRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/RandBetween/RandBetweenRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action randBetween"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Rank_Avg/Rank_AvgRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Rank_Avg/Rank_AvgRequestBuilder.cs index e59885d6fb0..59cb3b76095 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Rank_Avg/Rank_AvgRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Rank_Avg/Rank_AvgRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action rank_Avg"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Rank_Eq/Rank_EqRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Rank_Eq/Rank_EqRequestBuilder.cs index c66604cdbdb..c06025cd166 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Rank_Eq/Rank_EqRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Rank_Eq/Rank_EqRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action rank_Eq"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Rate/RateRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Rate/RateRequestBuilder.cs index 40002676195..cadcf3a7a85 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Rate/RateRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Rate/RateRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action rate"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Received/ReceivedRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Received/ReceivedRequestBuilder.cs index db27842a36a..abadf469cd8 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Received/ReceivedRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Received/ReceivedRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action received"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Replace/ReplaceRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Replace/ReplaceRequestBuilder.cs index f05dd0d2022..769fdc4dae7 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Replace/ReplaceRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Replace/ReplaceRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action replace"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/ReplaceB/ReplaceBRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/ReplaceB/ReplaceBRequestBuilder.cs index 12cbfcc06b2..ac8c9b04765 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/ReplaceB/ReplaceBRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/ReplaceB/ReplaceBRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action replaceB"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Rept/ReptRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Rept/ReptRequestBuilder.cs index 6fdd2426d3b..3eced48ea7e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Rept/ReptRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Rept/ReptRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action rept"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Right/RightRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Right/RightRequestBuilder.cs index 103828476a4..384e3fc27e1 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Right/RightRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Right/RightRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action right"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Rightb/RightbRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Rightb/RightbRequestBuilder.cs index c93df1d2c78..de469c6777c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Rightb/RightbRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Rightb/RightbRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action rightb"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Roman/RomanRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Roman/RomanRequestBuilder.cs index bf65c685299..a6a7edc7759 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Roman/RomanRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Roman/RomanRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action roman"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Round/RoundRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Round/RoundRequestBuilder.cs index 5eba9b15cc0..cbff44fef7c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Round/RoundRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Round/RoundRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action round"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/RoundDown/RoundDownRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/RoundDown/RoundDownRequestBuilder.cs index 4cc18ce935f..9fe4404d726 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/RoundDown/RoundDownRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/RoundDown/RoundDownRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action roundDown"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/RoundUp/RoundUpRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/RoundUp/RoundUpRequestBuilder.cs index 265e33ae302..55f42afac3e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/RoundUp/RoundUpRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/RoundUp/RoundUpRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action roundUp"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Rows/RowsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Rows/RowsRequestBuilder.cs index a60cbf5b58b..258078560c8 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Rows/RowsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Rows/RowsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action rows"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Rri/RriRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Rri/RriRequestBuilder.cs index 07094b1a884..6e989a05f18 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Rri/RriRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Rri/RriRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action rri"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Sec/SecRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Sec/SecRequestBuilder.cs index 9ddc4f6df30..d8d66699dac 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Sec/SecRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Sec/SecRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sec"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Sech/SechRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Sech/SechRequestBuilder.cs index 3ee9fbd561c..98ceb5d33cb 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Sech/SechRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Sech/SechRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sech"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Second/SecondRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Second/SecondRequestBuilder.cs index 33c249f58ca..aac5d078aa6 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Second/SecondRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Second/SecondRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action second"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/SeriesSum/SeriesSumRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/SeriesSum/SeriesSumRequestBuilder.cs index 98b29edf4e3..8f7376dbb5e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/SeriesSum/SeriesSumRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/SeriesSum/SeriesSumRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action seriesSum"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Sheet/SheetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Sheet/SheetRequestBuilder.cs index a516e3bc923..bab07130978 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Sheet/SheetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Sheet/SheetRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sheet"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Sheets/SheetsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Sheets/SheetsRequestBuilder.cs index 0747d7cad1a..47e282896c2 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Sheets/SheetsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Sheets/SheetsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sheets"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Sign/SignRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Sign/SignRequestBuilder.cs index cda2def2bee..9d85f7e2886 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Sign/SignRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Sign/SignRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sign"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Sin/SinRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Sin/SinRequestBuilder.cs index f186301fdb0..b2e7bf3580d 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Sin/SinRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Sin/SinRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sin"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Sinh/SinhRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Sinh/SinhRequestBuilder.cs index f50b8502f9c..d34a2df981b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Sinh/SinhRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Sinh/SinhRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sinh"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Skew/SkewRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Skew/SkewRequestBuilder.cs index 2efbb8c8f45..de74feb29d0 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Skew/SkewRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Skew/SkewRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action skew"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Skew_p/Skew_pRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Skew_p/Skew_pRequestBuilder.cs index 8f54aaf368c..f4bbeac8463 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Skew_p/Skew_pRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Skew_p/Skew_pRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action skew_p"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Sln/SlnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Sln/SlnRequestBuilder.cs index d1c79642dfc..5b29dd15735 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Sln/SlnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Sln/SlnRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sln"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Small/SmallRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Small/SmallRequestBuilder.cs index 18a61614ca6..c5ea5128ded 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Small/SmallRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Small/SmallRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action small"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Sqrt/SqrtRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Sqrt/SqrtRequestBuilder.cs index e1b8577d9f6..c8c43b5ae86 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Sqrt/SqrtRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Sqrt/SqrtRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sqrt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/SqrtPi/SqrtPiRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/SqrtPi/SqrtPiRequestBuilder.cs index 1ed6d18dffb..a869c4ee89c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/SqrtPi/SqrtPiRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/SqrtPi/SqrtPiRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sqrtPi"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/StDevA/StDevARequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/StDevA/StDevARequestBuilder.cs index 91c1798db60..4e3d4936959 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/StDevA/StDevARequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/StDevA/StDevARequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action stDevA"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/StDevPA/StDevPARequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/StDevPA/StDevPARequestBuilder.cs index b227f0378e8..d08ba6f6070 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/StDevPA/StDevPARequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/StDevPA/StDevPARequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action stDevPA"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/StDev_P/StDev_PRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/StDev_P/StDev_PRequestBuilder.cs index 4dc55a3391c..cd8ce6bdc24 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/StDev_P/StDev_PRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/StDev_P/StDev_PRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action stDev_P"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/StDev_S/StDev_SRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/StDev_S/StDev_SRequestBuilder.cs index 85804c70f38..844eee4a24e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/StDev_S/StDev_SRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/StDev_S/StDev_SRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action stDev_S"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Standardize/StandardizeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Standardize/StandardizeRequestBuilder.cs index bc96480ba14..bcf90d4529d 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Standardize/StandardizeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Standardize/StandardizeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action standardize"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Substitute/SubstituteRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Substitute/SubstituteRequestBuilder.cs index 578ac25c628..d81d42e8315 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Substitute/SubstituteRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Substitute/SubstituteRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action substitute"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Subtotal/SubtotalRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Subtotal/SubtotalRequestBuilder.cs index cd2ec7d3013..8b795862b8f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Subtotal/SubtotalRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Subtotal/SubtotalRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action subtotal"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Sum/SumRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Sum/SumRequestBuilder.cs index 95186ce1110..87c00821ff9 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Sum/SumRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Sum/SumRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sum"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/SumIf/SumIfRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/SumIf/SumIfRequestBuilder.cs index 4a9cf37af6c..3f78652fc4a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/SumIf/SumIfRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/SumIf/SumIfRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sumIf"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/SumIfs/SumIfsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/SumIfs/SumIfsRequestBuilder.cs index 797de0d6135..8b883be54bc 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/SumIfs/SumIfsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/SumIfs/SumIfsRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sumIfs"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/SumSq/SumSqRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/SumSq/SumSqRequestBuilder.cs index 62e372b2f53..d77587d9318 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/SumSq/SumSqRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/SumSq/SumSqRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action sumSq"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Syd/SydRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Syd/SydRequestBuilder.cs index 682bc076d98..0f220a17bfb 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Syd/SydRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Syd/SydRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action syd"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/T/TRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/T/TRequestBuilder.cs index c4520e49e74..03af517ae9b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/T/TRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/T/TRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action t"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/T_Dist/T_DistRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/T_Dist/T_DistRequestBuilder.cs index 2fff529839b..7a9f7f36e3c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/T_Dist/T_DistRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/T_Dist/T_DistRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action t_Dist"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/T_Dist_2T/T_Dist_2TRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/T_Dist_2T/T_Dist_2TRequestBuilder.cs index ca07c368139..490d39958a9 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/T_Dist_2T/T_Dist_2TRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/T_Dist_2T/T_Dist_2TRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action t_Dist_2T"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/T_Dist_RT/T_Dist_RTRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/T_Dist_RT/T_Dist_RTRequestBuilder.cs index d4c77f31e59..e07136ffbc7 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/T_Dist_RT/T_Dist_RTRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/T_Dist_RT/T_Dist_RTRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action t_Dist_RT"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/T_Inv/T_InvRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/T_Inv/T_InvRequestBuilder.cs index 9b414298172..a6d34d915cf 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/T_Inv/T_InvRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/T_Inv/T_InvRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action t_Inv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/T_Inv_2T/T_Inv_2TRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/T_Inv_2T/T_Inv_2TRequestBuilder.cs index 94dbd882eae..a743d3accab 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/T_Inv_2T/T_Inv_2TRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/T_Inv_2T/T_Inv_2TRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action t_Inv_2T"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Tan/TanRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Tan/TanRequestBuilder.cs index 7f00e1380e4..12b0ed1f09b 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Tan/TanRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Tan/TanRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tan"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Tanh/TanhRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Tanh/TanhRequestBuilder.cs index 24cd6872b4a..e237765e951 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Tanh/TanhRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Tanh/TanhRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tanh"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/TbillEq/TbillEqRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/TbillEq/TbillEqRequestBuilder.cs index 5f32c2bc37c..042a5f1355f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/TbillEq/TbillEqRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/TbillEq/TbillEqRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tbillEq"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/TbillPrice/TbillPriceRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/TbillPrice/TbillPriceRequestBuilder.cs index f438daff589..b0363e199cf 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/TbillPrice/TbillPriceRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/TbillPrice/TbillPriceRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tbillPrice"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/TbillYield/TbillYieldRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/TbillYield/TbillYieldRequestBuilder.cs index bf75dfd3f36..4c5a2df125c 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/TbillYield/TbillYieldRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/TbillYield/TbillYieldRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action tbillYield"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Text/TextRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Text/TextRequestBuilder.cs index 8bf42fba85a..3014c309c99 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Text/TextRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Text/TextRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action text"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Time/TimeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Time/TimeRequestBuilder.cs index e71fd49b88e..5e2072b75ad 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Time/TimeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Time/TimeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action time"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Timevalue/TimevalueRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Timevalue/TimevalueRequestBuilder.cs index 95b8b8b9315..bfce08a7966 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Timevalue/TimevalueRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Timevalue/TimevalueRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action timevalue"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Today/TodayRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Today/TodayRequestBuilder.cs index aaa3212fc12..b9a4a1d5f2f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Today/TodayRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Today/TodayRequestBuilder.cs @@ -26,10 +26,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action today"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Trim/TrimRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Trim/TrimRequestBuilder.cs index a1b94246806..19874d63c43 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Trim/TrimRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Trim/TrimRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action trim"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/TrimMean/TrimMeanRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/TrimMean/TrimMeanRequestBuilder.cs index a013139673a..0272858e7b4 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/TrimMean/TrimMeanRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/TrimMean/TrimMeanRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action trimMean"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Trunc/TruncRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Trunc/TruncRequestBuilder.cs index aa0234b3c39..cc03bfdd6ae 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Trunc/TruncRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Trunc/TruncRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action trunc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Type/TypeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Type/TypeRequestBuilder.cs index 74e28e3276c..3ffc97e144d 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Type/TypeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Type/TypeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action type"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Unichar/UnicharRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Unichar/UnicharRequestBuilder.cs index 1212cfab226..24c81e83a75 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Unichar/UnicharRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Unichar/UnicharRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unichar"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Unicode/UnicodeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Unicode/UnicodeRequestBuilder.cs index 81dca1b58ed..25c823c39c1 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Unicode/UnicodeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Unicode/UnicodeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unicode"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Upper/UpperRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Upper/UpperRequestBuilder.cs index ed23d43d5f8..cd964ec5310 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Upper/UpperRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Upper/UpperRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action upper"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Usdollar/UsdollarRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Usdollar/UsdollarRequestBuilder.cs index bbba1e9789e..eb4f030da46 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Usdollar/UsdollarRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Usdollar/UsdollarRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action usdollar"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Value/ValueRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Value/ValueRequestBuilder.cs index 50f4abf4bc8..0ceeb424966 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Value/ValueRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Value/ValueRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action value"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/VarA/VarARequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/VarA/VarARequestBuilder.cs index 57fe3460c4f..4753db8030a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/VarA/VarARequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/VarA/VarARequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action varA"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/VarPA/VarPARequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/VarPA/VarPARequestBuilder.cs index 2369e5591f8..5d95859e882 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/VarPA/VarPARequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/VarPA/VarPARequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action varPA"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Var_P/Var_PRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Var_P/Var_PRequestBuilder.cs index 39b24b50da0..97bd35254f0 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Var_P/Var_PRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Var_P/Var_PRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action var_P"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Var_S/Var_SRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Var_S/Var_SRequestBuilder.cs index 221539943b4..7b9e21d3d4e 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Var_S/Var_SRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Var_S/Var_SRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action var_S"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Vdb/VdbRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Vdb/VdbRequestBuilder.cs index 98ca09afaff..d79158a236a 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Vdb/VdbRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Vdb/VdbRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action vdb"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Vlookup/VlookupRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Vlookup/VlookupRequestBuilder.cs index b0bbe513f16..baf5657354d 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Vlookup/VlookupRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Vlookup/VlookupRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action vlookup"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/WeekNum/WeekNumRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/WeekNum/WeekNumRequestBuilder.cs index 29a06826881..ad9203585c6 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/WeekNum/WeekNumRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/WeekNum/WeekNumRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action weekNum"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Weekday/WeekdayRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Weekday/WeekdayRequestBuilder.cs index 0ca6b123366..e4ff75e0d4f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Weekday/WeekdayRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Weekday/WeekdayRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action weekday"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Weibull_Dist/Weibull_DistRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Weibull_Dist/Weibull_DistRequestBuilder.cs index ad58068fe8d..f5340ce8d0f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Weibull_Dist/Weibull_DistRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Weibull_Dist/Weibull_DistRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action weibull_Dist"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/WorkDay/WorkDayRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/WorkDay/WorkDayRequestBuilder.cs index e3b0598f8ab..1bb906133d1 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/WorkDay/WorkDayRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/WorkDay/WorkDayRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action workDay"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/WorkDay_Intl/WorkDay_IntlRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/WorkDay_Intl/WorkDay_IntlRequestBuilder.cs index 4db691df257..74cc5d9a1cc 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/WorkDay_Intl/WorkDay_IntlRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/WorkDay_Intl/WorkDay_IntlRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action workDay_Intl"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Xirr/XirrRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Xirr/XirrRequestBuilder.cs index fb16cc5fb8b..df93d7be46f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Xirr/XirrRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Xirr/XirrRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action xirr"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Xnpv/XnpvRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Xnpv/XnpvRequestBuilder.cs index d8f8fb331cf..d7bbc0d400f 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Xnpv/XnpvRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Xnpv/XnpvRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action xnpv"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Xor/XorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Xor/XorRequestBuilder.cs index 65b2d317624..4f6e7301c67 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Xor/XorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Xor/XorRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action xor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Year/YearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Year/YearRequestBuilder.cs index 3882e53648e..6a765f73bf5 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Year/YearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Year/YearRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action year"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/YearFrac/YearFracRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/YearFrac/YearFracRequestBuilder.cs index 711e730583c..f1f7dbf6f12 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/YearFrac/YearFracRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/YearFrac/YearFracRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action yearFrac"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/YieldDisc/YieldDiscRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/YieldDisc/YieldDiscRequestBuilder.cs index 0c7b9d1586e..1135e1c0816 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/YieldDisc/YieldDiscRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/YieldDisc/YieldDiscRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action yieldDisc"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/YieldMat/YieldMatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/YieldMat/YieldMatRequestBuilder.cs index 99a73a75a44..ce56c6927ad 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/YieldMat/YieldMatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/YieldMat/YieldMatRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action yieldMat"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Functions/Z_Test/Z_TestRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Functions/Z_Test/Z_TestRequestBuilder.cs index 93c032c0dcb..8688b99a820 100644 --- a/src/generated/Workbooks/Item/Workbook/Functions/Z_Test/Z_TestRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Functions/Z_Test/Z_TestRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action z_Test"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/@Add/AddRequestBuilder.cs index 5d6eba605c9..601f26e21ba 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/@Add/AddRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs index be81204b1f5..95247bbaec1 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addFormulaLocal"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Range/RangeRequestBuilder.cs index 6ea0ceb1448..34850483f6d 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Range/RangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/WorkbookNamedItemRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/WorkbookNamedItemRequestBuilder.cs index 576c4ca10cb..0fa94fe3b93 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/WorkbookNamedItemRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/WorkbookNamedItemRequestBuilder.cs @@ -28,12 +28,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents a collection of workbooks scoped named items (named ranges and constants). Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,16 +50,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents a collection of workbooks scoped named items (named ranges and constants). Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,16 +87,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents a collection of workbooks scoped named items (named ranges and constants). Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index cfd61e35b05..b0c912f1a4d 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/@Add/AddRequestBuilder.cs index aa1d6a3da04..70e85fbfa91 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/@Add/AddRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/ChartsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/ChartsRequestBuilder.cs index b6bc6e5d2f9..a3d8aec6a75 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/ChartsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/ChartsRequestBuilder.cs @@ -55,16 +55,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,28 +88,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Count/CountRequestBuilder.cs index eb59e984b4b..d08172cccb9 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Count/CountRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/AxesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/AxesRequestBuilder.cs index 95829f8ee3e..76c9c8f24a1 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/AxesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/AxesRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart axes. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,18 +66,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart axes. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,18 +106,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart axes. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs index ff3a3eb1fe8..b246c2a80ea 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the category axis in a chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the category axis in a chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the category axis in a chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs index 88987d7b456..2771b32ed99 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs index c39f4e01fa3..23260185c85 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,18 +110,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs index 3937a0a3768..40865e135e1 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs index f3d31d36953..38b5af4b8cf 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs index 714289a2e2b..25ead109059 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index faee61c09de..fafb02ae9fe 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs index 72e3d478b8f..40a8e7e6974 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs index 79d863edc95..29500892399 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs index 65323eea050..d3d0a432be4 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index 66066d4bec9..a49a81c0f1a 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs index fd73fba3940..0ec9a1432cc 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs index 73fc4cf532f..0334f455ddb 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs index dd90bb89e43..057aa152170 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs index 2de7a339aef..4786e9ebe28 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs index a3625a4b1cf..72c7de8d007 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs index 9a3b48d17a1..ed6ee78e585 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs index 1c36274e4ae..4819ca3d073 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,18 +110,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs index b091206ead1..9ebe6756bda 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs index d4b87b320f4..12fe97da53e 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs index 70f78d84315..b853ad9e0d7 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index 8b7e29d2e26..1d49045b2ad 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs index b8fffd6039e..bdf2149618d 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs index 4c6629d8d1f..6bb5efb9cce 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs index 3a1b487139c..75e07f0651a 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index 6c01b1eea6e..9f46974ca05 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs index 7d5f882a407..3590a874259 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs index 7a8c6bcb2b9..aba8b4e2f67 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs index 537ee544582..2ccc5a6148b 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the series axis of a 3-dimensional chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the series axis of a 3-dimensional chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the series axis of a 3-dimensional chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs index 012d3f8d1af..3cb58b6e7a1 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs index 59a7adb0dcb..f2f84a52230 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs index f6fbf882f75..767873aec97 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs index 4fdb7099bd4..6a3fedd49b2 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs index 07ee4aea1ae..e8e7327867e 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,18 +110,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs index 3c5e34063b4..a42b3dc0ed8 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs index 07c9148b669..5f26c889dc7 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs index 0eda1b98bd4..dc2b0ef1a5f 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index 10f4d7c030a..1b487787e5e 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs index 635dd201df1..1ae94c08fed 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs index 5723232596f..76cd6ed57c9 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs index 8c2484f7541..19e62914e59 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index 2d02b4749d1..6af0ac94cb3 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs index e487b8814e4..b6b01247f8c 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs index de8a87d5144..4fcce9774be 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs index 1f281cb4d7c..1dbb82410e6 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs index 1e3bf478191..3b3524ce11a 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs index 957c652c312..4473a5a2723 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs index dc07455170f..98d09e69ad1 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the value axis in an axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the value axis in an axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the value axis in an axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs index 9e352f2ba83..8a40fc4ea3b 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the datalabels on the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,18 +62,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the datalabels on the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,18 +102,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the datalabels on the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs index 26e862756dc..4977c620272 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs index daeb60c6440..a39516b16d4 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of the current chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of the current chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of the current chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index 103be07dd00..7875e5575f2 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs index 16a3728679f..01c54b25b5b 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs index ad701df6118..a25907bdf0b 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the format of chart data labels, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,18 +71,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the format of chart data labels, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,18 +111,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the format of chart data labels, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs index 7895477dcb3..c3ae227bdba 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Fill/FillRequestBuilder.cs index b69512ef0a0..c67791f140d 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Fill/FillRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index 2e984999e23..0c1bff21dd2 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Font/FontRequestBuilder.cs index 1c0dad7c92e..298a100d096 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/FormatRequestBuilder.cs index 13fcfc431da..53e14e944c0 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Encapsulates the format properties for the chart area. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,18 +71,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Encapsulates the format properties for the chart area. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,18 +111,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Encapsulates the format properties for the chart area. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Image/ImageRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Image/ImageRequestBuilder.cs index 58afb76671c..f133c4d9e64 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Image/ImageRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Image/ImageRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function image"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs index 152d7079133..b7b9c0a69ad 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function image"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--width", description: "Usage: width={width}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var widthOption = new Option("--width", description: "Usage: width={width}"); + widthOption.IsRequired = true; + command.AddOption(widthOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, width) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("width", width); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs index d5c00069838..57e106aa2db 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function image"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--width", description: "Usage: width={width}")); - command.AddOption(new Option("--height", description: "Usage: height={height}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var widthOption = new Option("--width", description: "Usage: width={width}"); + widthOption.IsRequired = true; + command.AddOption(widthOption); + var heightOption = new Option("--height", description: "Usage: height={height}"); + heightOption.IsRequired = true; + command.AddOption(heightOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, width, height) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("width", width); - requestInfo.PathParameters.Add("height", height); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs index c26068c8c41..40c25d94437 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function image"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--width", description: "Usage: width={width}")); - command.AddOption(new Option("--height", description: "Usage: height={height}")); - command.AddOption(new Option("--fittingmode", description: "Usage: fittingMode={fittingMode}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var widthOption = new Option("--width", description: "Usage: width={width}"); + widthOption.IsRequired = true; + command.AddOption(widthOption); + var heightOption = new Option("--height", description: "Usage: height={height}"); + heightOption.IsRequired = true; + command.AddOption(heightOption); + var fittingModeOption = new Option("--fittingmode", description: "Usage: fittingMode={fittingMode}"); + fittingModeOption.IsRequired = true; + command.AddOption(fittingModeOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, width, height, fittingMode) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("width", width); - requestInfo.PathParameters.Add("height", height); - if (!String.IsNullOrEmpty(fittingMode)) requestInfo.PathParameters.Add("fittingMode", fittingMode); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs index 18bff1ab57c..eeab448f096 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs index 092a06a686d..901de10075b 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of an object, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of an object, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of an object, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index ac9494aa5e8..bab4d4350e4 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs index 9f46a138854..6b93a59a9c5 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/FormatRequestBuilder.cs index 8745230d303..6de5308f9e2 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart legend, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,18 +71,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart legend, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,18 +111,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart legend, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/LegendRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/LegendRequestBuilder.cs index 1f72ed33721..c7c10b14433 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/LegendRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Legend/LegendRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the legend for the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,18 +62,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the legend for the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,18 +102,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the legend for the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Count/CountRequestBuilder.cs index 08fe5757af8..851559d9cc0 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Count/CountRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs index 49c37c73366..3939900e0e9 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs index 37232043fe1..71cc3d87246 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs @@ -34,16 +34,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of a chart series, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,20 +62,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of a chart series, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -89,20 +105,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of a chart series, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index 27e4307f0ca..4a30c08dfac 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs index 6eb59339ff8..551deb68f71 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs @@ -28,16 +28,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart series, which includes fill and line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,20 +66,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart series, which includes fill and line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -102,20 +118,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart series, which includes fill and line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs index 3e7ee9d8307..47b0f63124a 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs index f5683bad3ed..69a9adbafde 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs index 90ef335e3d3..2f85ad75433 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs index edf57be7d49..77875266e6c 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, workbookChartPointId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs index a7d91680a1b..1fbf5f6c40e 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs @@ -34,18 +34,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of a chart, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, workbookChartPointId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,22 +65,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of a chart, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -93,22 +111,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of a chart, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, workbookChartPointId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index 1d2c5288c2e..0aceae1e50a 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, workbookChartPointId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs index f352b0f0c9f..c24826d8f88 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs @@ -27,18 +27,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Encapsulates the format properties chart point. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, workbookChartPointId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,22 +68,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Encapsulates the format properties chart point. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,22 +114,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Encapsulates the format properties chart point. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, workbookChartPointId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/WorkbookChartPointRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/WorkbookChartPointRequestBuilder.cs index 75f3b5f2829..9751fe6274a 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/WorkbookChartPointRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/Item/WorkbookChartPointRequestBuilder.cs @@ -27,18 +27,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, workbookChartPointId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,22 +67,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,22 +113,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, workbookChartPointId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index f18f8a49b44..a86a1c9340c 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs index 92cfea9d7f0..c16cfcd893b 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs @@ -39,20 +39,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,32 +78,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/WorkbookChartSeriesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/WorkbookChartSeriesRequestBuilder.cs index a3c9ff8f6a9..026291e8599 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/WorkbookChartSeriesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/Item/WorkbookChartSeriesRequestBuilder.cs @@ -28,16 +28,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,20 +66,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -93,20 +109,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index a3cc855185e..c91fa8df85f 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/SeriesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/SeriesRequestBuilder.cs index 26f64bd94b6..8934d794ada 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/SeriesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Series/SeriesRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,30 +76,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/SetData/SetDataRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/SetData/SetDataRequestBuilder.cs index e98cfb79ec3..9b080d26b06 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/SetData/SetDataRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/SetData/SetDataRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setData"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/SetPosition/SetPositionRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/SetPosition/SetPositionRequestBuilder.cs index 45e826f1425..11fc740050f 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/SetPosition/SetPositionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/SetPosition/SetPositionRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setPosition"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs index 34cf827fbac..024d4e832aa 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs index 16cd547b65c..9bf1c55cacd 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index 71b6604982b..6c2ef274b2b 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Font/FontRequestBuilder.cs index 39bfcce8022..e8f25053056 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/FormatRequestBuilder.cs index a4d68347eed..ca97425a501 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart title, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,18 +71,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart title, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,18 +111,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart title, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/TitleRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/TitleRequestBuilder.cs index 1f39d1504f0..01f0560e9a7 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/TitleRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Title/TitleRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the title of the specified chart, including the text, visibility, position and formating of the title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,18 +62,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the title of the specified chart, including the text, visibility, position and formating of the title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,18 +102,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the title of the specified chart, including the text, visibility, position and formating of the title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/WorkbookChartRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/WorkbookChartRequestBuilder.cs index b8d53334332..f12d69d8c7b 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/WorkbookChartRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/WorkbookChartRequestBuilder.cs @@ -59,14 +59,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -90,18 +94,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -129,18 +143,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index f0d2f784e0e..9ceffefd9e4 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/Range/RangeRequestBuilder.cs index c18d07cf4ed..f7eb3d594a4 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs index b77be6d67ac..224f6b11d51 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--address", description: "Usage: address={address}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var addressOption = new Option("--address", description: "Usage: address={address}"); + addressOption.IsRequired = true; + command.AddOption(addressOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, address) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(address)) requestInfo.PathParameters.Add("address", address); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs index aeb455a9f4f..51a03e072f6 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index c0e45d36a7d..c336d5b5ad5 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/WorksheetRequestBuilder.cs index 3a7514f57a0..4b6b89c6027 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/WorksheetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/Item/Worksheet/WorksheetRequestBuilder.cs @@ -31,14 +31,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The worksheet containing the current chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,18 +56,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The worksheet containing the current chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,18 +96,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The worksheet containing the current chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index 1803f728e8c..0ddfa637267 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/ItemWithName/ItemWithNameRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/ItemWithName/ItemWithNameRequestBuilder.cs index 15e5bff7e49..5a9bf933f3e 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/ItemWithName/ItemWithNameRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Charts/ItemWithName/ItemWithNameRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function item"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--name", description: "Usage: name={name}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var nameOption = new Option("--name", description: "Usage: name={name}"); + nameOption.IsRequired = true; + command.AddOption(nameOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, name) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(name)) requestInfo.PathParameters.Add("name", name); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/@Add/AddRequestBuilder.cs index bb87bca8d3c..fbdaffd9f70 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/@Add/AddRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs index 9856c17881d..8712f25f969 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addFormulaLocal"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/Item/Range/RangeRequestBuilder.cs index afa9dddb2e0..916f914d7f4 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/Item/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooknameditem-id1", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookNamedItemId1Option = new Option("--workbooknameditem-id1", description: "key: id of workbookNamedItem"); + workbookNamedItemId1Option.IsRequired = true; + command.AddOption(workbookNamedItemId1Option); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookNamedItemId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId1)) requestInfo.PathParameters.Add("workbookNamedItem_id1", workbookNamedItemId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/Item/WorkbookNamedItemRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/Item/WorkbookNamedItemRequestBuilder.cs index c10660cc3d6..99f8314bc83 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/Item/WorkbookNamedItemRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/Item/WorkbookNamedItemRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooknameditem-id1", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookNamedItemId1Option = new Option("--workbooknameditem-id1", description: "key: id of workbookNamedItem"); + workbookNamedItemId1Option.IsRequired = true; + command.AddOption(workbookNamedItemId1Option); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookNamedItemId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId1)) requestInfo.PathParameters.Add("workbookNamedItem_id1", workbookNamedItemId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooknameditem-id1", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookNamedItemId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId1)) requestInfo.PathParameters.Add("workbookNamedItem_id1", workbookNamedItemId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookNamedItemId1Option = new Option("--workbooknameditem-id1", description: "key: id of workbookNamedItem"); + workbookNamedItemId1Option.IsRequired = true; + command.AddOption(workbookNamedItemId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookNamedItemId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,18 +92,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooknameditem-id1", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookNamedItemId1Option = new Option("--workbooknameditem-id1", description: "key: id of workbookNamedItem"); + workbookNamedItemId1Option.IsRequired = true; + command.AddOption(workbookNamedItemId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookNamedItemId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId1)) requestInfo.PathParameters.Add("workbookNamedItem_id1", workbookNamedItemId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/NamesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/NamesRequestBuilder.cs index 6d6e2766c51..2c60c641777 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/NamesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Names/NamesRequestBuilder.cs @@ -50,16 +50,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,28 +83,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Refresh/RefreshRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Refresh/RefreshRequestBuilder.cs index e548fe3b24f..090a52638bd 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Refresh/RefreshRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Refresh/RefreshRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action refresh"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookPivotTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/WorkbookPivotTableRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/WorkbookPivotTableRequestBuilder.cs index 403f5f6eec2..43624d96ced 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/WorkbookPivotTableRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/WorkbookPivotTableRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookPivotTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,18 +53,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookPivotTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookPivotTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,18 +93,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookPivotTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index a11e16d8ca8..d9ea619d9f6 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookPivotTableId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/Range/RangeRequestBuilder.cs index 00e6b8a8c8c..d3e84f02070 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookPivotTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs index 128a9171bb1..df697b4cc5e 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--address", description: "Usage: address={address}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var addressOption = new Option("--address", description: "Usage: address={address}"); + addressOption.IsRequired = true; + command.AddOption(addressOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookPivotTableId, address) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - if (!String.IsNullOrEmpty(address)) requestInfo.PathParameters.Add("address", address); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs index 3ead439dd66..86320db9a67 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookPivotTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index d0cb4967990..dd48e68e36d 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookPivotTableId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs index d915afaa4ca..e3c51bdeecf 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs @@ -31,14 +31,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The worksheet containing the current PivotTable. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookPivotTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,18 +56,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The worksheet containing the current PivotTable. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookPivotTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookPivotTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,18 +96,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The worksheet containing the current PivotTable. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookPivotTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/PivotTablesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/PivotTablesRequestBuilder.cs index d522a216837..8f8948d70a0 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/PivotTablesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/PivotTablesRequestBuilder.cs @@ -39,16 +39,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,28 +72,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs index 3d90a843073..91ff1806c94 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action refreshAll"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Protection/Protect/ProtectRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Protection/Protect/ProtectRequestBuilder.cs index 1ae0371d9e9..ad97188e164 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Protection/Protect/ProtectRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Protection/Protect/ProtectRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action protect"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Protection/ProtectionRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Protection/ProtectionRequestBuilder.cs index 239c852b35b..2a22b9cbcfb 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Protection/ProtectionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Protection/ProtectionRequestBuilder.cs @@ -28,12 +28,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns sheet protection object for a worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,16 +50,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns sheet protection object for a worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,16 +87,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns sheet protection object for a worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Protection/Unprotect/UnprotectRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Protection/Unprotect/UnprotectRequestBuilder.cs index 488d4aaa064..c41fa569bfc 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Protection/Unprotect/UnprotectRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Protection/Unprotect/UnprotectRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unprotect"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Range/RangeRequestBuilder.cs index 63bee6ed814..860d820cd97 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Range/RangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs index ed549762ced..c20cdd6033a 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--address", description: "Usage: address={address}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var addressOption = new Option("--address", description: "Usage: address={address}"); + addressOption.IsRequired = true; + command.AddOption(addressOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, address) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(address)) requestInfo.PathParameters.Add("address", address); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/@Add/AddRequestBuilder.cs index eaed216e232..0c2cb36ce1d 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/@Add/AddRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Count/CountRequestBuilder.cs index f3dc4058d44..48f4d0e0fc2 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Count/CountRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs index 12e14dbe307..72b891669d5 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clearFilters"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/@Add/AddRequestBuilder.cs index 92ba3895b1c..332abcfbea7 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/@Add/AddRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/ColumnsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/ColumnsRequestBuilder.cs index 9ac7e0874bd..96d46d238a4 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/ColumnsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/ColumnsRequestBuilder.cs @@ -46,18 +46,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,30 +82,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Count/CountRequestBuilder.cs index 119e504fae6..781b28bad76 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Count/CountRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs index 70cfe52a025..a1656d1f113 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function dataBodyRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs index 3c7864cfd31..86ebd9c7748 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action apply"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs index 121c371d02d..b3b92c20458 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyBottomItemsFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs index a7a8ffb39cd..744e1891a8a 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyBottomPercentFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs index c9d1ca1e6fb..30b8820c93b 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyCellColorFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs index 4e495b3d796..b78ea246591 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyCustomFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs index 90356bb11f8..31cad25f5ef 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyDynamicFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs index 2ffbe0967e3..f9ad9d822d1 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyFontColorFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs index 3731ffb1b9d..84bc4824567 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyIconFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs index 42adce2a027..6f607957681 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyTopItemsFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs index 88bce11a699..cd885770789 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyTopPercentFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs index 5f244932aec..d6bcebd1421 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyValuesFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs index ccb3b8656a5..31e02694000 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs index 4bb1fbdfca3..723eb1f2737 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs @@ -110,16 +110,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Retrieve the filter applied to the column. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -133,20 +138,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Retrieve the filter applied to the column. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -165,20 +181,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Retrieve the filter applied to the column. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs index 2ef02d06fa2..1c64154c5c0 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function headerRowRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Range/RangeRequestBuilder.cs index f0e511fecb4..e9bb755969a 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/Range/RangeRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs index 1186a602da1..c6c740e6fd2 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function totalRowRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/WorkbookTableColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/WorkbookTableColumnRequestBuilder.cs index 69f86ea3549..02b3672dc2f 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/WorkbookTableColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/Item/WorkbookTableColumnRequestBuilder.cs @@ -31,16 +31,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -74,20 +79,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -106,20 +122,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index 9be4b91278d..a18fdcddb12 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs index 535320126c0..395ff006497 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action convertToRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs index a4cf5891ee7..0006287ca33 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function dataBodyRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs index 587507e5a1a..2fd95c0c831 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function headerRowRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Range/RangeRequestBuilder.cs index 3058a569a8d..caa46be481a 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs index 1a3341634b2..a82edb033c8 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reapplyFilters"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/@Add/AddRequestBuilder.cs index 069655222ae..132984a2337 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/@Add/AddRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/Count/CountRequestBuilder.cs index 5259d0656ee..1cbeaa6b751 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/Count/CountRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/Item/Range/RangeRequestBuilder.cs index 3ba4f034fea..1d175ca2d47 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/Item/Range/RangeRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablerow-id", description: "key: id of workbookTableRow")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbooktablerow-id", description: "key: id of workbookTableRow"); + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableRowId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableRowId)) requestInfo.PathParameters.Add("workbookTableRow_id", workbookTableRowId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/Item/WorkbookTableRowRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/Item/WorkbookTableRowRequestBuilder.cs index 73121fdad4e..c1f9172f86f 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/Item/WorkbookTableRowRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/Item/WorkbookTableRowRequestBuilder.cs @@ -27,16 +27,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablerow-id", description: "key: id of workbookTableRow")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbooktablerow-id", description: "key: id of workbookTableRow"); + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableRowId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableRowId)) requestInfo.PathParameters.Add("workbookTableRow_id", workbookTableRowId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,20 +55,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablerow-id", description: "key: id of workbookTableRow")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableRowId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableRowId)) requestInfo.PathParameters.Add("workbookTableRow_id", workbookTableRowId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbooktablerow-id", description: "key: id of workbookTableRow"); + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableRowId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,20 +98,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablerow-id", description: "key: id of workbookTableRow")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbooktablerow-id", description: "key: id of workbookTableRow"); + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, workbookTableRowId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableRowId)) requestInfo.PathParameters.Add("workbookTableRow_id", workbookTableRowId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index 37421f4077e..bd208f93392 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/RowsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/RowsRequestBuilder.cs index 388244d31c4..ef56b910c3f 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/RowsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Rows/RowsRequestBuilder.cs @@ -45,18 +45,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,30 +81,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs index 6153b8cc977..e9a0bf0a8ca 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action apply"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/Clear/ClearRequestBuilder.cs index 1a80ca109d9..8afddc1d23e 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs index acb1ea906d2..eb7406522bf 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reapply"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/SortRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/SortRequestBuilder.cs index ee9f35c9d9d..d000580653e 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/SortRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Sort/SortRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the sorting for the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,18 +66,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the sorting for the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,18 +106,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the sorting for the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs index 6da85dbc054..7566ec1de07 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function totalRowRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/WorkbookTableRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/WorkbookTableRequestBuilder.cs index 72555ec3776..2fe41efc040 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/WorkbookTableRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/WorkbookTableRequestBuilder.cs @@ -57,14 +57,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -78,18 +82,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,18 +122,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index 72d6368e6e7..cef1f1ba4a3 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/Range/RangeRequestBuilder.cs index b47d1add55b..8c829b1f4fa 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs index e7b2c006bc8..ba39226b01a 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--address", description: "Usage: address={address}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var addressOption = new Option("--address", description: "Usage: address={address}"); + addressOption.IsRequired = true; + command.AddOption(addressOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, address) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(address)) requestInfo.PathParameters.Add("address", address); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs index f2cc4b5ccf6..e83d8d97d56 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 9195b3ac7aa..3ee80fa14b9 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/WorksheetRequestBuilder.cs index 2ceda475bf9..8f20cd4fffb 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/WorksheetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/Item/Worksheet/WorksheetRequestBuilder.cs @@ -31,14 +31,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The worksheet containing the current table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,18 +56,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The worksheet containing the current table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,18 +96,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The worksheet containing the current table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index 009701bcc84..4db9bab0508 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/TablesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/TablesRequestBuilder.cs index 6fb52f0aa67..a43f0465488 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/TablesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/Tables/TablesRequestBuilder.cs @@ -52,16 +52,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,28 +85,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs index 803b49ce157..58480fa101d 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 39011a45054..845c15a8d9f 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/WorksheetRequestBuilder.cs index 342e548085c..795672d1c93 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/WorksheetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/Item/Worksheet/WorksheetRequestBuilder.cs @@ -44,12 +44,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,16 +66,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -100,16 +112,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Names/NamesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Names/NamesRequestBuilder.cs index 48d7ea8dcce..2c7205caa57 100644 --- a/src/generated/Workbooks/Item/Workbook/Names/NamesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Names/NamesRequestBuilder.cs @@ -51,14 +51,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents a collection of workbooks scoped named items (named ranges and constants). Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,26 +81,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents a collection of workbooks scoped named items (named ranges and constants). Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Operations/Item/WorkbookOperationRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Operations/Item/WorkbookOperationRequestBuilder.cs index 53833cf87b2..fb0559495a2 100644 --- a/src/generated/Workbooks/Item/Workbook/Operations/Item/WorkbookOperationRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Operations/Item/WorkbookOperationRequestBuilder.cs @@ -20,18 +20,21 @@ public class WorkbookOperationRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only."; + command.Description = "The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookoperation-id", description: "key: id of workbookOperation")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookOperationIdOption = new Option("--workbookoperation-id", description: "key: id of workbookOperation"); + workbookOperationIdOption.IsRequired = true; + command.AddOption(workbookOperationIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookOperationId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookOperationId)) requestInfo.PathParameters.Add("workbookOperation_id", workbookOperationId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -39,22 +42,31 @@ public Command BuildDeleteCommand() { return command; } /// - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only."; + command.Description = "The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookoperation-id", description: "key: id of workbookOperation")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookOperationId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookOperationId)) requestInfo.PathParameters.Add("workbookOperation_id", workbookOperationId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookOperationIdOption = new Option("--workbookoperation-id", description: "key: id of workbookOperation"); + workbookOperationIdOption.IsRequired = true; + command.AddOption(workbookOperationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookOperationId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,22 +79,27 @@ public Command BuildGetCommand() { return command; } /// - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only."; + command.Description = "The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookoperation-id", description: "key: id of workbookOperation")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookOperationIdOption = new Option("--workbookoperation-id", description: "key: id of workbookOperation"); + workbookOperationIdOption.IsRequired = true; + command.AddOption(workbookOperationIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookOperationId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookOperationId)) requestInfo.PathParameters.Add("workbookOperation_id", workbookOperationId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -103,7 +120,7 @@ public WorkbookOperationRequestBuilder(Dictionary pathParameters RequestAdapter = requestAdapter; } /// - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// Request headers /// Request options /// @@ -118,7 +135,7 @@ public RequestInformation CreateDeleteRequestInformation(Action - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -139,7 +156,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// /// Request headers /// Request options @@ -157,7 +174,7 @@ public RequestInformation CreatePatchRequestInformation(WorkbookOperation body, return requestInfo; } /// - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -168,7 +185,7 @@ public async Task DeleteAsync(Action> h = default, I await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -180,7 +197,7 @@ public async Task GetAsync(Action q = def return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -192,7 +209,7 @@ public async Task PatchAsync(WorkbookOperation model, ActionThe status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Workbooks/Item/Workbook/Operations/OperationsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Operations/OperationsRequestBuilder.cs index 800377aedcc..cd0ae7e957c 100644 --- a/src/generated/Workbooks/Item/Workbook/Operations/OperationsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Operations/OperationsRequestBuilder.cs @@ -30,20 +30,24 @@ public List BuildCommand() { return commands; } /// - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only."; + command.Description = "The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -56,24 +60,37 @@ public Command BuildCreateCommand() { return command; } /// - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only."; + command.Description = "The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, search, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, search, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + if (!String.IsNullOrEmpty(search)) q.Search = search; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -99,7 +116,7 @@ public OperationsRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// Request headers /// Request options /// Request query parameters @@ -120,7 +137,7 @@ public RequestInformation CreateGetRequestInformation(Action return requestInfo; } /// - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// /// Request headers /// Request options @@ -138,7 +155,7 @@ public RequestInformation CreatePostRequestInformation(WorkbookOperation body, A return requestInfo; } /// - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// Request options @@ -150,7 +167,7 @@ public async Task GetAsync(Action q = de return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); } /// - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. /// Cancellation token to use when cancelling requests /// Request headers /// @@ -162,7 +179,7 @@ public async Task PostAsync(WorkbookOperation model, Action(requestInfo, responseHandler, cancellationToken); } - /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// The status of Workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { /// Expand related entities public string[] Expand { get; set; } diff --git a/src/generated/Workbooks/Item/Workbook/RefreshSession/RefreshSessionRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/RefreshSession/RefreshSessionRequestBuilder.cs index 1d049c4fcab..7792ac87efa 100644 --- a/src/generated/Workbooks/Item/Workbook/RefreshSession/RefreshSessionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/RefreshSession/RefreshSessionRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action refreshSession"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/SessionInfoResourceWithKey/SessionInfoResourceWithKeyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/SessionInfoResourceWithKey/SessionInfoResourceWithKeyRequestBuilder.cs index 5f79e459511..8e4ee755ee5 100644 --- a/src/generated/Workbooks/Item/Workbook/SessionInfoResourceWithKey/SessionInfoResourceWithKeyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/SessionInfoResourceWithKey/SessionInfoResourceWithKeyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function sessionInfoResource"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--key", description: "Usage: key={key}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var keyOption = new Option("--key", description: "Usage: key={key}"); + keyOption.IsRequired = true; + command.AddOption(keyOption); command.Handler = CommandHandler.Create(async (driveItemId, key) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(key)) requestInfo.PathParameters.Add("key", key); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/TableRowOperationResultWithKey/TableRowOperationResultWithKeyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/TableRowOperationResultWithKey/TableRowOperationResultWithKeyRequestBuilder.cs index 4e7d0f241eb..9d994899d43 100644 --- a/src/generated/Workbooks/Item/Workbook/TableRowOperationResultWithKey/TableRowOperationResultWithKeyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/TableRowOperationResultWithKey/TableRowOperationResultWithKeyRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function tableRowOperationResult"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--key", description: "Usage: key={key}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var keyOption = new Option("--key", description: "Usage: key={key}"); + keyOption.IsRequired = true; + command.AddOption(keyOption); command.Handler = CommandHandler.Create(async (driveItemId, key) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(key)) requestInfo.PathParameters.Add("key", key); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/@Add/AddRequestBuilder.cs index 63738e556ef..11a1f8e3274 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/@Add/AddRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Count/CountRequestBuilder.cs index 56e780a42a6..bd530e85415 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Count/CountRequestBuilder.cs @@ -25,10 +25,12 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs index 3edd55f8873..a424966176a 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clearFilters"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/@Add/AddRequestBuilder.cs index 3cbd2a64964..52a0b3cc905 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/@Add/AddRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/ColumnsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/ColumnsRequestBuilder.cs index e9d698d0f00..91ef1e7466f 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/ColumnsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/ColumnsRequestBuilder.cs @@ -46,16 +46,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,28 +79,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Count/CountRequestBuilder.cs index bfa69d4d4bb..3747e6c9f5f 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Count/CountRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs index c0dc3194796..54cfd6301f7 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function dataBodyRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs index cfe2855c8d2..4c22d887b9c 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action apply"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs index 4b073b98bee..37fa62ab6a9 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyBottomItemsFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs index e0026761099..4251dc4fde8 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyBottomPercentFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs index 92a22daf972..8b78f99ab10 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyCellColorFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs index 4b31214a80b..77f981c9c76 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyCustomFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs index 621b604d64a..c3a83bd2192 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyDynamicFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs index 7b16d4cf1ba..4423e7820d2 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyFontColorFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs index e7b34e78849..2eaf22205b5 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyIconFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs index cb0606cdd85..49e04d0df77 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyTopItemsFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs index 4e351a4bdee..200b4e7ef78 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyTopPercentFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs index 9b5cc865704..14970454ed2 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyValuesFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs index 0e7fbf2892f..9b7edbbc0a8 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs index c5c2d8c0cd9..8eb1aeb978c 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs @@ -110,14 +110,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Retrieve the filter applied to the column. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -131,18 +135,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Retrieve the filter applied to the column. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -161,18 +175,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Retrieve the filter applied to the column. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs index f0d01347135..2d8abc725bc 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function headerRowRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Range/RangeRequestBuilder.cs index fd3c364cdcb..ac9f5314b86 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs index e696057c8ee..8ab431f2fd6 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function totalRowRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/WorkbookTableColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/WorkbookTableColumnRequestBuilder.cs index 1114c7fb17d..0106088f980 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/WorkbookTableColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/Item/WorkbookTableColumnRequestBuilder.cs @@ -31,14 +31,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -72,18 +76,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -102,18 +116,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index a7c2f6e46d1..f08ddac0d6b 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs index a4814299f4a..71cc20f773c 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action convertToRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs index 97226d6dbb7..8f4693d2bb7 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function dataBodyRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs index 72bf3af8de0..798a521ec5b 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function headerRowRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Range/RangeRequestBuilder.cs index 9a3f7eaa488..831f52bf852 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Range/RangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs index 9951307ca59..43c285a5f28 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reapplyFilters"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/@Add/AddRequestBuilder.cs index 332580efb30..7666f76459d 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/@Add/AddRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/Count/CountRequestBuilder.cs index bab31054000..3edc1917b81 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/Count/CountRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/Item/Range/RangeRequestBuilder.cs index 061f5361ac5..10b3dd71fa7 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/Item/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablerow-id", description: "key: id of workbookTableRow")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbooktablerow-id", description: "key: id of workbookTableRow"); + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableRowId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableRowId)) requestInfo.PathParameters.Add("workbookTableRow_id", workbookTableRowId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/Item/WorkbookTableRowRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/Item/WorkbookTableRowRequestBuilder.cs index d2a21168b56..4833181e4ea 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/Item/WorkbookTableRowRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/Item/WorkbookTableRowRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablerow-id", description: "key: id of workbookTableRow")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbooktablerow-id", description: "key: id of workbookTableRow"); + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableRowId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableRowId)) requestInfo.PathParameters.Add("workbookTableRow_id", workbookTableRowId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablerow-id", description: "key: id of workbookTableRow")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableRowId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableRowId)) requestInfo.PathParameters.Add("workbookTableRow_id", workbookTableRowId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbooktablerow-id", description: "key: id of workbookTableRow"); + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableRowId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,18 +92,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablerow-id", description: "key: id of workbookTableRow")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbooktablerow-id", description: "key: id of workbookTableRow"); + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableRowId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableRowId)) requestInfo.PathParameters.Add("workbookTableRow_id", workbookTableRowId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index b49deb10fe0..4811e229e2d 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/RowsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/RowsRequestBuilder.cs index 9f4551d0683..7e64983aaa0 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/RowsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Rows/RowsRequestBuilder.cs @@ -45,16 +45,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -73,28 +78,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs index 40780053ada..9505f6deaea 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action apply"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/Clear/ClearRequestBuilder.cs index 19e4e10c717..2c38db9359c 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/Clear/ClearRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs index d94b1311cb6..706bb3bf0bd 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reapply"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/SortRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/SortRequestBuilder.cs index 34b48ec92df..347eeacaa54 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/SortRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Sort/SortRequestBuilder.cs @@ -41,12 +41,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the sorting for the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -60,16 +63,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the sorting for the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,16 +100,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the sorting for the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs index d1fe40f9030..665ebe67691 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function totalRowRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/WorkbookTableRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/WorkbookTableRequestBuilder.cs index 1624c4a7f0e..4588823d88f 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/WorkbookTableRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/WorkbookTableRequestBuilder.cs @@ -57,12 +57,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents a collection of tables associated with the workbook. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -76,16 +79,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents a collection of tables associated with the workbook. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -104,16 +116,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents a collection of tables associated with the workbook. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index 348f0c6812a..ec2edb9cecd 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/@Add/AddRequestBuilder.cs index acf14556633..6af3c34fc00 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/@Add/AddRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/ChartsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/ChartsRequestBuilder.cs index e1efb9b2c5c..32ba18642fd 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/ChartsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/ChartsRequestBuilder.cs @@ -55,16 +55,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,28 +88,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Count/CountRequestBuilder.cs index 557bc1b0956..f9db6dc1353 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Count/CountRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/AxesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/AxesRequestBuilder.cs index 7becddfbda7..951c7806770 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/AxesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/AxesRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart axes. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,18 +66,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart axes. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,18 +106,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart axes. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs index 5a97e6f3f9b..687b36aa14b 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the category axis in a chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the category axis in a chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the category axis in a chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs index efef56bfcef..2364b30bfaf 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs index 70810b3c6b2..247314e8860 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,18 +110,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs index c61e30f6f23..9aacf664ea2 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs index 18079fdba8e..df58334e2cd 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs index d8fad4cdec7..8dd865a4a1a 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index a9f050207cc..d5f069c1ade 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs index 9e6d8e94bac..98b3cce92db 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs index 919a48e3904..e233e7cc6bc 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs index 5f088bc348a..71e667992f4 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index 079e21d4b97..cfde8bb7e01 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs index c4680025662..7be907f1ee7 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs index 1e92fd9656b..f97c85ccc63 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs index 940e303e78c..e263d620913 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs index f7b983a908b..37b6c99c136 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs index 8ec606012b3..38f53c51f2d 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs index 8afbb910599..8d845e022c9 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs index d1208b12ca2..dce5d76c87c 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,18 +110,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs index 347faae77f0..7ed90894ce7 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs index e21990f5108..8793bb65b92 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs index 7a5d995c71b..5c916946d87 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index c1b1b1fa2b0..707ffa6dddd 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs index 197a6cdaa41..b5be6ad3d26 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs index 9d3af2c334f..02e39b8ec2e 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs index 25b39ab262d..f2b4f4726c9 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index f63a849b28f..0378caf7226 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs index 0aec5eed943..e2855743f8e 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs index 4e0f4af7f77..55041209d40 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs index 97a5169f079..2587a41aa26 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the series axis of a 3-dimensional chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the series axis of a 3-dimensional chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the series axis of a 3-dimensional chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs index 14df497ac8a..4df0338cc10 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs index 0d0f883aba2..8a93d836e9b 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs index b9e41304b3a..c05f96b693a 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs index 19a40f87682..0ff099daf81 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs index 9e58b565b88..11611fb0658 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,18 +110,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs index 16de0bc9efc..f56d054ba99 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs index 098bc2df8d1..b0c61976fe5 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs index aecfc775d3f..46b2c8efadc 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index fe894b333f2..d1bc715f615 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs index ae18e7948e0..2f008d3e3b0 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs index 9d97b7c64e6..186fb6df0dc 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs index d0fd97ee57c..c93302e5760 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index c5d2f2f21fd..194729e86ce 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs index 027f38ba851..54d296f4316 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs index 1b92f5ee408..fda43714e4d 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs index 622d001f0a3..42aa6005768 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs index fd0a7f78c08..ebcf3227be0 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs index c7b9e7a040c..e6f11a15ee0 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs index 7c6a743870e..d28a72fb25a 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the value axis in an axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the value axis in an axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the value axis in an axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs index 1902192f0f5..e0a6c652536 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the datalabels on the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,18 +62,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the datalabels on the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,18 +102,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the datalabels on the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs index 03245c2c419..d63b8f859b9 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs index 26f4a753936..976153cad14 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of the current chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of the current chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of the current chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index 84fcdd82a27..b515b19d868 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs index 6cf3bbb973c..3e230c010cc 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs index 99accfcb912..e2424b6bf8a 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the format of chart data labels, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,18 +71,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the format of chart data labels, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,18 +111,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the format of chart data labels, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs index b209dca2b0e..0138ddb7e8d 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Fill/FillRequestBuilder.cs index 8d28f1ad1c4..59e93f4bc0a 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Fill/FillRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index f015100a7ca..e0725968bbe 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Font/FontRequestBuilder.cs index 9ee82ff44c0..2671ebe9fec 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/FormatRequestBuilder.cs index a36e2ab74b9..44b7f8fe428 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Encapsulates the format properties for the chart area. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,18 +71,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Encapsulates the format properties for the chart area. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,18 +111,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Encapsulates the format properties for the chart area. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Image/ImageRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Image/ImageRequestBuilder.cs index 9cdac02d500..de667aed883 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Image/ImageRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Image/ImageRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function image"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs index e1916204f6a..c3c8b485948 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function image"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--width", description: "Usage: width={width}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var widthOption = new Option("--width", description: "Usage: width={width}"); + widthOption.IsRequired = true; + command.AddOption(widthOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, width) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("width", width); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs index 75c1b74af7b..b7aabd58ed5 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function image"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--width", description: "Usage: width={width}")); - command.AddOption(new Option("--height", description: "Usage: height={height}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var widthOption = new Option("--width", description: "Usage: width={width}"); + widthOption.IsRequired = true; + command.AddOption(widthOption); + var heightOption = new Option("--height", description: "Usage: height={height}"); + heightOption.IsRequired = true; + command.AddOption(heightOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, width, height) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("width", width); - requestInfo.PathParameters.Add("height", height); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs index 3514d3a2bd1..43b6621fc95 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function image"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--width", description: "Usage: width={width}")); - command.AddOption(new Option("--height", description: "Usage: height={height}")); - command.AddOption(new Option("--fittingmode", description: "Usage: fittingMode={fittingMode}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var widthOption = new Option("--width", description: "Usage: width={width}"); + widthOption.IsRequired = true; + command.AddOption(widthOption); + var heightOption = new Option("--height", description: "Usage: height={height}"); + heightOption.IsRequired = true; + command.AddOption(heightOption); + var fittingModeOption = new Option("--fittingmode", description: "Usage: fittingMode={fittingMode}"); + fittingModeOption.IsRequired = true; + command.AddOption(fittingModeOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, width, height, fittingMode) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("width", width); - requestInfo.PathParameters.Add("height", height); - if (!String.IsNullOrEmpty(fittingMode)) requestInfo.PathParameters.Add("fittingMode", fittingMode); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs index d80875555c9..de069ff05b6 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs index 33139e1ce20..04e81078f7c 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of an object, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of an object, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of an object, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index d572390893d..2b7de97d452 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs index 28a95d40ebd..beb67b043a5 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/FormatRequestBuilder.cs index 6354cd4ba42..a03de291a4e 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart legend, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,18 +71,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart legend, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,18 +111,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart legend, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/LegendRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/LegendRequestBuilder.cs index c3d5f3955a0..3f510331ca4 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/LegendRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Legend/LegendRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the legend for the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,18 +62,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the legend for the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,18 +102,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the legend for the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Count/CountRequestBuilder.cs index db5bbd55e74..177f4e9f58d 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Count/CountRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs index caaa36a9b03..b643ec582d4 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs index 6bf274306c8..34d67c81d16 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs @@ -34,16 +34,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of a chart series, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,20 +62,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of a chart series, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -89,20 +105,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of a chart series, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index a18943dfc3f..1c4b80f2860 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs index b72e940a027..78d79679116 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs @@ -28,16 +28,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart series, which includes fill and line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,20 +66,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart series, which includes fill and line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -102,20 +118,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart series, which includes fill and line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs index 9a8b7505dd0..39ddd28285a 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs index 70b68e4cbe4..48c99ae6647 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs index 6473b16a82e..2eaaa5b6233 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs index c95cf60b678..5a8049e6000 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, workbookChartPointId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs index f8b1a5021e4..c4b5298c965 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs @@ -34,18 +34,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of a chart, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, workbookChartPointId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,22 +65,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of a chart, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -93,22 +111,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of a chart, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, workbookChartPointId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index 8cb12af94cd..f471d5e5d2f 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, workbookChartPointId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs index 3eec3e5de2e..95f9c020df0 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs @@ -27,18 +27,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Encapsulates the format properties chart point. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, workbookChartPointId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,22 +68,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Encapsulates the format properties chart point. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,22 +114,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Encapsulates the format properties chart point. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, workbookChartPointId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/WorkbookChartPointRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/WorkbookChartPointRequestBuilder.cs index 145feed76d0..b29e37f6feb 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/WorkbookChartPointRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/Item/WorkbookChartPointRequestBuilder.cs @@ -27,18 +27,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, workbookChartPointId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,22 +67,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,22 +113,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, workbookChartPointId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index e2552deafb2..7d2c8d782ad 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs index 0bf089f6afa..0f1bb0294f8 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs @@ -39,20 +39,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,32 +78,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/WorkbookChartSeriesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/WorkbookChartSeriesRequestBuilder.cs index 12d6f5b11c5..fabb66de61b 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/WorkbookChartSeriesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/Item/WorkbookChartSeriesRequestBuilder.cs @@ -28,16 +28,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,20 +66,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -93,20 +109,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index e49f9236761..19508138dc2 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/SeriesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/SeriesRequestBuilder.cs index 83eff087953..b0b7606118f 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/SeriesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Series/SeriesRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,30 +76,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/SetData/SetDataRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/SetData/SetDataRequestBuilder.cs index 06a12061e16..a338334f91e 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/SetData/SetDataRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/SetData/SetDataRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setData"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/SetPosition/SetPositionRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/SetPosition/SetPositionRequestBuilder.cs index a7b52a2fdcb..2fb5fda96c8 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/SetPosition/SetPositionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/SetPosition/SetPositionRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setPosition"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs index 90bfd043294..85d8fc25cb5 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs index 3108eb9099e..3d7cc1a3ba7 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index 636cefbedeb..3bb73001e5d 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Font/FontRequestBuilder.cs index 04b086735f2..fff0577d3d5 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/FormatRequestBuilder.cs index 4aff900bcb2..fcb719f4a82 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart title, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,18 +71,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart title, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,18 +111,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart title, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/TitleRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/TitleRequestBuilder.cs index a04985d2094..b3cd9908187 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/TitleRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Title/TitleRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the title of the specified chart, including the text, visibility, position and formating of the title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,18 +62,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the title of the specified chart, including the text, visibility, position and formating of the title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,18 +102,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the title of the specified chart, including the text, visibility, position and formating of the title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/WorkbookChartRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/WorkbookChartRequestBuilder.cs index 4d7a313b66b..83de7c85d9f 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/WorkbookChartRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/WorkbookChartRequestBuilder.cs @@ -59,14 +59,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -90,18 +94,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -129,18 +143,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index 506bdf5ad0c..a2a12f40216 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/Range/RangeRequestBuilder.cs index 153b35f8754..5c2d1b2375e 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs index 5770d83742f..cbba608622d 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--address", description: "Usage: address={address}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var addressOption = new Option("--address", description: "Usage: address={address}"); + addressOption.IsRequired = true; + command.AddOption(addressOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, address) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(address)) requestInfo.PathParameters.Add("address", address); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs index d430869bfdc..f66dcf65866 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 3b5f9c785c0..11e1b98bc7d 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/WorksheetRequestBuilder.cs index d5a68a7804e..66e390e8aab 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/WorksheetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/Item/Worksheet/WorksheetRequestBuilder.cs @@ -31,14 +31,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The worksheet containing the current chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,18 +56,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The worksheet containing the current chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,18 +96,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The worksheet containing the current chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index 0d82687f200..af90a8299e4 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/ItemWithName/ItemWithNameRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/ItemWithName/ItemWithNameRequestBuilder.cs index d9bea587986..5a9ef027d12 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/ItemWithName/ItemWithNameRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Charts/ItemWithName/ItemWithNameRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function item"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--name", description: "Usage: name={name}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var nameOption = new Option("--name", description: "Usage: name={name}"); + nameOption.IsRequired = true; + command.AddOption(nameOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, name) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(name)) requestInfo.PathParameters.Add("name", name); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/@Add/AddRequestBuilder.cs index fcbd32d1a68..526db338ce3 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/@Add/AddRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs index 684d7b39943..79e45a5fbe8 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addFormulaLocal"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Range/RangeRequestBuilder.cs index b81d31db6a3..27721d3d1b0 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookNamedItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/WorkbookNamedItemRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/WorkbookNamedItemRequestBuilder.cs index 59e7b98911b..3f3016350e3 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/WorkbookNamedItemRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/WorkbookNamedItemRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookNamedItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,18 +53,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookNamedItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookNamedItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,18 +93,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index 126fba6f952..74d860d9b82 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookNamedItemId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/Range/RangeRequestBuilder.cs index bc4f495ecc4..9d7101460c8 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookNamedItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs index a99604b9646..25423d848e9 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--address", description: "Usage: address={address}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var addressOption = new Option("--address", description: "Usage: address={address}"); + addressOption.IsRequired = true; + command.AddOption(addressOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookNamedItemId, address) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(address)) requestInfo.PathParameters.Add("address", address); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs index c906ec6e9a3..bc582fedcb4 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookNamedItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 70c67de5e89..17a1c8f7ff3 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookNamedItemId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/WorksheetRequestBuilder.cs index 40d57e1e96c..b077d0ca71c 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/WorksheetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/Item/Worksheet/WorksheetRequestBuilder.cs @@ -31,14 +31,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookNamedItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,18 +56,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookNamedItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookNamedItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,18 +96,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/NamesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/NamesRequestBuilder.cs index 06ffd2477a5..d637b4adf38 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/NamesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Names/NamesRequestBuilder.cs @@ -51,16 +51,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,28 +84,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Refresh/RefreshRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Refresh/RefreshRequestBuilder.cs index ae9b041834b..5cdb257d1b4 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Refresh/RefreshRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Refresh/RefreshRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action refresh"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookPivotTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/WorkbookPivotTableRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/WorkbookPivotTableRequestBuilder.cs index abd637479c7..6f7216ff83e 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/WorkbookPivotTableRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/WorkbookPivotTableRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookPivotTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,18 +53,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookPivotTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookPivotTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,18 +93,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookPivotTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index 8d9762b70ca..0b7e41488f8 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookPivotTableId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/Range/RangeRequestBuilder.cs index bddafd781d5..077f62fb876 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookPivotTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs index 4af6bdc6826..3b40419c84f 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--address", description: "Usage: address={address}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var addressOption = new Option("--address", description: "Usage: address={address}"); + addressOption.IsRequired = true; + command.AddOption(addressOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookPivotTableId, address) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - if (!String.IsNullOrEmpty(address)) requestInfo.PathParameters.Add("address", address); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs index b1ed294f8f3..90eb91850b1 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookPivotTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 4d5613a9d34..a6f619c7c6b 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookPivotTableId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs index 67c1a9b575b..80a5e4c3edc 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs @@ -31,14 +31,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The worksheet containing the current PivotTable. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookPivotTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,18 +56,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The worksheet containing the current PivotTable. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookPivotTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookPivotTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,18 +96,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The worksheet containing the current PivotTable. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookPivotTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/PivotTablesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/PivotTablesRequestBuilder.cs index cd0de2bf57b..2e720cebeed 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/PivotTablesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/PivotTablesRequestBuilder.cs @@ -39,16 +39,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,28 +72,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs index ffd6226dc92..a963bb94708 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action refreshAll"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Protection/Protect/ProtectRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Protection/Protect/ProtectRequestBuilder.cs index c23a30fcba3..0537ccf90ac 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Protection/Protect/ProtectRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Protection/Protect/ProtectRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action protect"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Protection/ProtectionRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Protection/ProtectionRequestBuilder.cs index 5908f7eda47..9a7f37a3913 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Protection/ProtectionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Protection/ProtectionRequestBuilder.cs @@ -28,12 +28,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns sheet protection object for a worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,16 +50,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns sheet protection object for a worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,16 +87,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns sheet protection object for a worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Protection/Unprotect/UnprotectRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Protection/Unprotect/UnprotectRequestBuilder.cs index 433c368e6bc..f60f1c96d72 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Protection/Unprotect/UnprotectRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Protection/Unprotect/UnprotectRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unprotect"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Range/RangeRequestBuilder.cs index b3ea5cc500e..843a98090a1 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Range/RangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs index 2f6eab2b001..27166ac4f2b 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--address", description: "Usage: address={address}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var addressOption = new Option("--address", description: "Usage: address={address}"); + addressOption.IsRequired = true; + command.AddOption(addressOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, address) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(address)) requestInfo.PathParameters.Add("address", address); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/@Add/AddRequestBuilder.cs index ad6b139ce39..b1f89fc2bb4 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/@Add/AddRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Count/CountRequestBuilder.cs index 5d64b82c71f..676f936e579 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Count/CountRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs index 8dbcd6ab695..d62a4a165d2 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clearFilters"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktable-id1", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableId1Option = new Option("--workbooktable-id1", description: "key: id of workbookTable"); + workbookTableId1Option.IsRequired = true; + command.AddOption(workbookTableId1Option); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableId1)) requestInfo.PathParameters.Add("workbookTable_id1", workbookTableId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs index 865ba6da996..035500405fd 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action convertToRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktable-id1", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableId1Option = new Option("--workbooktable-id1", description: "key: id of workbookTable"); + workbookTableId1Option.IsRequired = true; + command.AddOption(workbookTableId1Option); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableId1)) requestInfo.PathParameters.Add("workbookTable_id1", workbookTableId1); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs index 5d372794444..860b9b81069 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function dataBodyRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktable-id1", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableId1Option = new Option("--workbooktable-id1", description: "key: id of workbookTable"); + workbookTableId1Option.IsRequired = true; + command.AddOption(workbookTableId1Option); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableId1)) requestInfo.PathParameters.Add("workbookTable_id1", workbookTableId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs index 49456a7e444..136dd633ac4 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function headerRowRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktable-id1", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableId1Option = new Option("--workbooktable-id1", description: "key: id of workbookTable"); + workbookTableId1Option.IsRequired = true; + command.AddOption(workbookTableId1Option); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableId1)) requestInfo.PathParameters.Add("workbookTable_id1", workbookTableId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/Range/RangeRequestBuilder.cs index e7cd3d215d3..10b6cb03b2b 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktable-id1", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableId1Option = new Option("--workbooktable-id1", description: "key: id of workbookTable"); + workbookTableId1Option.IsRequired = true; + command.AddOption(workbookTableId1Option); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableId1)) requestInfo.PathParameters.Add("workbookTable_id1", workbookTableId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs index 80c28ce0706..c1394824491 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reapplyFilters"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktable-id1", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableId1Option = new Option("--workbooktable-id1", description: "key: id of workbookTable"); + workbookTableId1Option.IsRequired = true; + command.AddOption(workbookTableId1Option); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableId1) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableId1)) requestInfo.PathParameters.Add("workbookTable_id1", workbookTableId1); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs index 8fa1d9a7d51..8239e75e17f 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function totalRowRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktable-id1", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableId1Option = new Option("--workbooktable-id1", description: "key: id of workbookTable"); + workbookTableId1Option.IsRequired = true; + command.AddOption(workbookTableId1Option); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableId1) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableId1)) requestInfo.PathParameters.Add("workbookTable_id1", workbookTableId1); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/WorkbookTableRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/WorkbookTableRequestBuilder.cs index 504868595a4..735592a3ee2 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/WorkbookTableRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/Item/WorkbookTableRequestBuilder.cs @@ -45,14 +45,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktable-id1", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableId1Option = new Option("--workbooktable-id1", description: "key: id of workbookTable"); + workbookTableId1Option.IsRequired = true; + command.AddOption(workbookTableId1Option); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableId1) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableId1)) requestInfo.PathParameters.Add("workbookTable_id1", workbookTableId1); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -66,18 +70,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktable-id1", description: "key: id of workbookTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableId1, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableId1)) requestInfo.PathParameters.Add("workbookTable_id1", workbookTableId1); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableId1Option = new Option("--workbooktable-id1", description: "key: id of workbookTable"); + workbookTableId1Option.IsRequired = true; + command.AddOption(workbookTableId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableId1, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,18 +110,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktable-id1", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableId1Option = new Option("--workbooktable-id1", description: "key: id of workbookTable"); + workbookTableId1Option.IsRequired = true; + command.AddOption(workbookTableId1Option); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, workbookTableId1, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableId1)) requestInfo.PathParameters.Add("workbookTable_id1", workbookTableId1); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index 1dfb7c09750..57145df52c5 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/TablesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/TablesRequestBuilder.cs index e75966603dd..0a0698d85ef 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/TablesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/Tables/TablesRequestBuilder.cs @@ -48,16 +48,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,28 +81,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs index d448fa3e530..61cf65d38df 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 148e276e707..f60adb348a7 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/WorksheetRequestBuilder.cs index c3df4d36c1d..64d889bbe5d 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/WorksheetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/Item/Worksheet/WorksheetRequestBuilder.cs @@ -44,12 +44,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The worksheet containing the current table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,16 +66,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The worksheet containing the current table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -100,16 +112,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The worksheet containing the current table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index 240e5169e53..8135be1b3c2 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Tables/TablesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Tables/TablesRequestBuilder.cs index d45566cb4eb..3d61dc6f0e0 100644 --- a/src/generated/Workbooks/Item/Workbook/Tables/TablesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Tables/TablesRequestBuilder.cs @@ -52,14 +52,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents a collection of tables associated with the workbook. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -78,26 +82,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents a collection of tables associated with the workbook. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/WorkbookRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/WorkbookRequestBuilder.cs index f9ca8d7df20..1cd55256ea6 100644 --- a/src/generated/Workbooks/Item/Workbook/WorkbookRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/WorkbookRequestBuilder.cs @@ -66,10 +66,12 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "For files that are Excel spreadsheets, accesses the workbook API to work with the spreadsheet's contents. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -457,12 +459,17 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "For files that are Excel spreadsheets, accesses the workbook API to work with the spreadsheet's contents. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -497,14 +504,18 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "For files that are Excel spreadsheets, accesses the workbook API to work with the spreadsheet's contents. Nullable."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/@Add/AddRequestBuilder.cs index 2d06607169d..fdf70ca72c8 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/@Add/AddRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index 78229466dda..854304831d0 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/@Add/AddRequestBuilder.cs index ffc08414cef..7a2e5790424 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/@Add/AddRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/ChartsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/ChartsRequestBuilder.cs index 82639681137..b65a91bf2ac 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/ChartsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/ChartsRequestBuilder.cs @@ -55,16 +55,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -83,28 +88,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Count/CountRequestBuilder.cs index a7d82701e9f..31465a0b22f 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Count/CountRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/AxesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/AxesRequestBuilder.cs index f798df0741c..80b3c650ece 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/AxesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/AxesRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart axes. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,18 +66,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart axes. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,18 +106,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart axes. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs index bb851e15c7a..ef9c054384a 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the category axis in a chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the category axis in a chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the category axis in a chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs index 5841791936a..9c4533b6c1a 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs index 6f5f81d51c6..bad12623e05 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,18 +110,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs index 869d53594b2..b7bab879c10 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs index 10a36dc0dbc..4e764b08362 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs index 8c888ff0d6e..6da764a642a 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index d72445afeb5..eabf1e25b62 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs index 26339581bad..4f3a22ba98d 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs index 1f2fc9c1a25..c746155300f 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs index 4afc8d4c917..f0feb77dfa3 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index ba6d964463e..3a39c934a9b 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs index f425d118434..7611d2002d0 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs index abc4cf159d6..cd39a66cb2a 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs index 447012d187a..7a6cbd4d628 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs index 9c7b1a4f04d..6b1c47803c6 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs index e3d1655b53d..8bbf1ae496c 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs index 678a8ed6b9c..6abb72fe04d 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs index 59522f3123f..2d6d4bfbc12 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,18 +110,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs index aff8a21cf5e..47226c0a8c2 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs index 6551eb30379..aebd22688a2 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs index bdc24186809..fd4ef7cd06b 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index 5260200eefc..a294ad4c094 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs index d26f08bf2b5..4dab2168110 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs index 6bf387d3ad6..19f50cad12c 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs index 0b1de75cc08..3ca5514219b 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index 6053e356b5f..fb4dfc023d6 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs index e26fc97f683..c146c34f76f 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs index 74326323669..0c19560c4e2 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs index 08226564ab1..69d5cadcb9e 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the series axis of a 3-dimensional chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the series axis of a 3-dimensional chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the series axis of a 3-dimensional chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs index d51f887c5ed..737638e514c 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs index 6954b7b283c..7f60b824b4e 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs index b9926584f1d..75c69e6762a 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs index 42c6e36c1da..5c284efb461 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs index 8fbf2c8c6e4..8490fdf8237 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,18 +110,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs index a2ba6a625c2..550cbafa16f 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs index 46335e8535e..f6c0cfb810b 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs index 4c68d9df7f5..fa15efc9b00 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index cdaf9501626..ec12e8f4f82 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs index 65c89e6c429..95ccde21f87 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs index 838809fba42..a32cad16589 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs index 361fb4b9f3d..90ab16639c7 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -48,18 +52,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart gridlines. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs index 7a6934d0566..d23a737733b 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs index 8c1bed29c6e..0d5b90e6f6d 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs @@ -33,14 +33,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -54,18 +58,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -84,18 +98,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents chart line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs index a36f0096958..25deec80d2b 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs index 6be44e271f1..f0149011c4c 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs index af490373720..2e412f24274 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,18 +60,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -86,18 +100,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of chart axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs index 516444725fb..c9ac492c40a 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,18 +61,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -87,18 +101,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the axis title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs index 96a996342dd..bec538b3ae0 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs @@ -30,14 +30,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the value axis in an axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,18 +65,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the value axis in an axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -109,18 +123,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the value axis in an axis. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs index 10c026b792e..d75d64f9aae 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the datalabels on the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,18 +62,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the datalabels on the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,18 +102,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the datalabels on the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs index baa3cdfff78..23bc8dd6cba 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs index de53dc411d4..6fe915e7e59 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of the current chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of the current chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of the current chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index 28c41ecfd2d..0ca29aa7ed5 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs index d434628e937..f24148416d7 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs index ffd7920ddf3..55c88f547f2 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the format of chart data labels, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,18 +71,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the format of chart data labels, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,18 +111,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the format of chart data labels, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs index 0dd8fdd30fd..ad4591b7b88 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/FillRequestBuilder.cs index 331edacbc10..63ae5ca1a3e 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/FillRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index 1962004c694..901c7f8271d 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Font/FontRequestBuilder.cs index 4497e0e2085..53007c7fe3e 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/FormatRequestBuilder.cs index 2797c65f55e..f3d3723fbd2 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Encapsulates the format properties for the chart area. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,18 +71,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Encapsulates the format properties for the chart area. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,18 +111,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Encapsulates the format properties for the chart area. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Image/ImageRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Image/ImageRequestBuilder.cs index 0ad7c693190..26422ce1db7 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Image/ImageRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Image/ImageRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function image"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs index 1d07ea05d45..6946b0fe1e3 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function image"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--width", description: "Usage: width={width}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var widthOption = new Option("--width", description: "Usage: width={width}"); + widthOption.IsRequired = true; + command.AddOption(widthOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, width) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("width", width); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs index e95a9c92686..27512e4ec79 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function image"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--width", description: "Usage: width={width}")); - command.AddOption(new Option("--height", description: "Usage: height={height}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var widthOption = new Option("--width", description: "Usage: width={width}"); + widthOption.IsRequired = true; + command.AddOption(widthOption); + var heightOption = new Option("--height", description: "Usage: height={height}"); + heightOption.IsRequired = true; + command.AddOption(heightOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, width, height) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("width", width); - requestInfo.PathParameters.Add("height", height); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs index 16d450b250d..b5e96b621f5 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function image"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--width", description: "Usage: width={width}")); - command.AddOption(new Option("--height", description: "Usage: height={height}")); - command.AddOption(new Option("--fittingmode", description: "Usage: fittingMode={fittingMode}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var widthOption = new Option("--width", description: "Usage: width={width}"); + widthOption.IsRequired = true; + command.AddOption(widthOption); + var heightOption = new Option("--height", description: "Usage: height={height}"); + heightOption.IsRequired = true; + command.AddOption(heightOption); + var fittingModeOption = new Option("--fittingmode", description: "Usage: fittingMode={fittingMode}"); + fittingModeOption.IsRequired = true; + command.AddOption(fittingModeOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, width, height, fittingMode) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("width", width); - requestInfo.PathParameters.Add("height", height); - if (!String.IsNullOrEmpty(fittingMode)) requestInfo.PathParameters.Add("fittingMode", fittingMode); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs index 26b49e2659a..934ad37c294 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs index f9ad2f370fe..fb97e707d10 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of an object, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of an object, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of an object, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index dc752d89b57..3f420b0113c 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs index 2774f1a6cee..8d42811bf38 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/FormatRequestBuilder.cs index 8ba6357abb5..242005b85fe 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart legend, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,18 +71,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart legend, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,18 +111,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart legend, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/LegendRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/LegendRequestBuilder.cs index b8fdaf7bbc4..36fe4c19d74 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/LegendRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Legend/LegendRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the legend for the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,18 +62,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the legend for the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,18 +102,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the legend for the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Count/CountRequestBuilder.cs index 1887c6b6c26..4d222ce41e0 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Count/CountRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs index 56143c538aa..eea7807cb88 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs index 713ca108cf0..602a7162b5f 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs @@ -34,16 +34,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of a chart series, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -57,20 +62,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of a chart series, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -89,20 +105,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of a chart series, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index 587711f6d70..087f85e30bf 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs index 9ea874902d4..1f0847e648a 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs @@ -28,16 +28,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart series, which includes fill and line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,20 +66,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart series, which includes fill and line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -102,20 +118,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart series, which includes fill and line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs index 65e42697d36..ae1316fa824 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs index 3f6a7b6658b..c3f4d49b3f2 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs @@ -33,16 +33,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -56,20 +61,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,20 +104,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents line formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs index fd2d1204f49..55695336e5a 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs index 9a2ce233364..0669a247981 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, workbookChartPointId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs index 196d3f77f42..8a6be0c1ced 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs @@ -34,18 +34,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of a chart, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, workbookChartPointId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -59,22 +65,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of a chart, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -93,22 +111,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of a chart, which includes background formating information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, workbookChartPointId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index 706926701e4..c27baee0510 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,22 +25,30 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, workbookChartPointId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs index 033630aed2a..14084f684ce 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs @@ -27,18 +27,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Encapsulates the format properties chart point. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, workbookChartPointId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,22 +68,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Encapsulates the format properties chart point. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -96,22 +114,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Encapsulates the format properties chart point. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, workbookChartPointId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/WorkbookChartPointRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/WorkbookChartPointRequestBuilder.cs index b2eeff756c5..844a79d23d0 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/WorkbookChartPointRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/WorkbookChartPointRequestBuilder.cs @@ -27,18 +27,24 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, workbookChartPointId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,22 +67,34 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, workbookChartPointId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -95,22 +113,30 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbookchartpoint-id", description: "key: id of workbookChartPoint"); + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, workbookChartPointId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - if (!String.IsNullOrEmpty(workbookChartPointId)) requestInfo.PathParameters.Add("workbookChartPoint_id", workbookChartPointId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index 58216b0c0df..a7efc102f1d 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs index 7543ee61aa7..ebdef5c4c3a 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs @@ -39,20 +39,27 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -71,32 +78,56 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents a collection of all points in the series. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/WorkbookChartSeriesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/WorkbookChartSeriesRequestBuilder.cs index e4d48c5f571..43cf7bb6dca 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/WorkbookChartSeriesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/WorkbookChartSeriesRequestBuilder.cs @@ -28,16 +28,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -61,20 +66,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -93,20 +109,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbookchartseries-id", description: "key: id of workbookChartSeries"); + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, workbookChartSeriesId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(workbookChartSeriesId)) requestInfo.PathParameters.Add("workbookChartSeries_id", workbookChartSeriesId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index a8b5b6b0f10..6d36b2da097 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/SeriesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/SeriesRequestBuilder.cs index b2bd8a2fc37..31877c32c3f 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/SeriesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Series/SeriesRequestBuilder.cs @@ -40,18 +40,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -70,30 +76,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents either a single series or collection of series in the chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/SetData/SetDataRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/SetData/SetDataRequestBuilder.cs index 728d306e0f8..156f53a78de 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/SetData/SetDataRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/SetData/SetDataRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setData"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/SetPosition/SetPositionRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/SetPosition/SetPositionRequestBuilder.cs index e91a7246888..c95200ae886 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/SetPosition/SetPositionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/SetPosition/SetPositionRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setPosition"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs index 029b58aa0e1..25b0dbe4307 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs index 44241d784c0..88fb7c6e43d 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs @@ -34,14 +34,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -55,18 +59,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -85,18 +99,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs index 90d6b665da3..5435e1c3232 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action setSolidColor"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Font/FontRequestBuilder.cs index f5d806a5eec..c9d61070393 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Font/FontRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Font/FontRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,18 +51,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -77,18 +91,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/FormatRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/FormatRequestBuilder.cs index 5def9686258..14ec5ab98e4 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/FormatRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/FormatRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the formatting of a chart title, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -67,18 +71,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the formatting of a chart title, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -97,18 +111,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the formatting of a chart title, which includes fill and font formatting. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/TitleRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/TitleRequestBuilder.cs index 9da3c3a65bb..2ba8817574b 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/TitleRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Title/TitleRequestBuilder.cs @@ -27,14 +27,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the title of the specified chart, including the text, visibility, position and formating of the title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -58,18 +62,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the title of the specified chart, including the text, visibility, position and formating of the title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -88,18 +102,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the title of the specified chart, including the text, visibility, position and formating of the title. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/WorkbookChartRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/WorkbookChartRequestBuilder.cs index 53b132d8622..ab14f5094d5 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/WorkbookChartRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/WorkbookChartRequestBuilder.cs @@ -59,14 +59,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -90,18 +94,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -129,18 +143,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index 351c0665387..b646c035fd7 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/Range/RangeRequestBuilder.cs index e04dd40ec95..b0dd2f1d55e 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs index bb454874d5c..c1e94475ca2 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--address", description: "Usage: address={address}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var addressOption = new Option("--address", description: "Usage: address={address}"); + addressOption.IsRequired = true; + command.AddOption(addressOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, address) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - if (!String.IsNullOrEmpty(address)) requestInfo.PathParameters.Add("address", address); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs index 3b2a9a0387f..f33bdcbaac7 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 49371390374..e0efbc16cf5 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/WorksheetRequestBuilder.cs index 81ce56f0fef..7ec98615a8c 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/WorksheetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/WorksheetRequestBuilder.cs @@ -31,14 +31,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The worksheet containing the current chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,18 +56,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The worksheet containing the current chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,18 +96,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The worksheet containing the current chart. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookchart-id", description: "key: id of workbookChart")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbookchart-id", description: "key: id of workbookChart"); + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookChartId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookChartId)) requestInfo.PathParameters.Add("workbookChart_id", workbookChartId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index 335f02470ed..958534b02b2 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ItemWithNameRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ItemWithNameRequestBuilder.cs index 5bb1a451f11..9b4d7930ae5 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ItemWithNameRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ItemWithNameRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function item"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--name", description: "Usage: name={name}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name={name}"); + nameOption.IsRequired = true; + command.AddOption(nameOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, name) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(name)) requestInfo.PathParameters.Add("name", name); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/@Add/AddRequestBuilder.cs index 29f1fd213e6..8dc486a5d43 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/@Add/AddRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs index aa48247bb60..afea17128a9 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action addFormulaLocal"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Range/RangeRequestBuilder.cs index 8a79d1c2743..edb5a4fd4e2 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookNamedItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/WorkbookNamedItemRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/WorkbookNamedItemRequestBuilder.cs index 238980f6f4f..b8d050f09c8 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/WorkbookNamedItemRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/WorkbookNamedItemRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookNamedItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,18 +53,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookNamedItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookNamedItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,18 +93,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index d6b8d2ad7c7..20e2e41778c 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookNamedItemId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/Range/RangeRequestBuilder.cs index 7375f5d0524..b111db71a25 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookNamedItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs index 6016ff093c8..3d6a400e9f1 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--address", description: "Usage: address={address}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var addressOption = new Option("--address", description: "Usage: address={address}"); + addressOption.IsRequired = true; + command.AddOption(addressOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookNamedItemId, address) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - if (!String.IsNullOrEmpty(address)) requestInfo.PathParameters.Add("address", address); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs index 283b5eb36a6..c6ec65a5cf1 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookNamedItemId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index f35c5b199d7..f01fb0c4f09 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookNamedItemId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/WorksheetRequestBuilder.cs index af6c01fd6ae..aee72b57954 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/WorksheetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/WorksheetRequestBuilder.cs @@ -31,14 +31,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookNamedItemId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,18 +56,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookNamedItemId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookNamedItemId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,18 +96,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbooknameditem-id", description: "key: id of workbookNamedItem"); + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookNamedItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookNamedItemId)) requestInfo.PathParameters.Add("workbookNamedItem_id", workbookNamedItemId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/NamesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/NamesRequestBuilder.cs index 0eb8cda1b4a..d85836d5029 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/NamesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Names/NamesRequestBuilder.cs @@ -51,16 +51,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,28 +84,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Refresh/RefreshRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Refresh/RefreshRequestBuilder.cs index d54c5676c0c..e39385d68a1 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Refresh/RefreshRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Refresh/RefreshRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action refresh"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookPivotTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/WorkbookPivotTableRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/WorkbookPivotTableRequestBuilder.cs index 1713f68aa1f..94692fde9a3 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/WorkbookPivotTableRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/WorkbookPivotTableRequestBuilder.cs @@ -28,14 +28,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookPivotTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -49,18 +53,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookPivotTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookPivotTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -79,18 +93,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookPivotTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index 58209ef8afb..5a5eb926487 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookPivotTableId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/Range/RangeRequestBuilder.cs index 793f146223f..aee9e2facf9 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookPivotTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs index 97063317e91..02657bab9f7 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--address", description: "Usage: address={address}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var addressOption = new Option("--address", description: "Usage: address={address}"); + addressOption.IsRequired = true; + command.AddOption(addressOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookPivotTableId, address) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - if (!String.IsNullOrEmpty(address)) requestInfo.PathParameters.Add("address", address); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs index 85942bf51e2..326746b35f4 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookPivotTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index bbdbc9ff519..613dfc4d573 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookPivotTableId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs index 0fb32ced31e..13158d9cb9c 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs @@ -31,14 +31,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The worksheet containing the current PivotTable. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookPivotTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,18 +56,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The worksheet containing the current PivotTable. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookPivotTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookPivotTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,18 +96,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The worksheet containing the current PivotTable. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbookpivottable-id", description: "key: id of workbookPivotTable"); + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookPivotTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookPivotTableId)) requestInfo.PathParameters.Add("workbookPivotTable_id", workbookPivotTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/PivotTablesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/PivotTablesRequestBuilder.cs index 12c438d30bc..ea89d4ffb3e 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/PivotTablesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/PivotTablesRequestBuilder.cs @@ -39,16 +39,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -67,28 +72,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of PivotTables that are part of the worksheet."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs index 869ddc5017f..f24bde1a418 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action refreshAll"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Protection/Protect/ProtectRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Protection/Protect/ProtectRequestBuilder.cs index 747c9ce8ab4..0f054922eec 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Protection/Protect/ProtectRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Protection/Protect/ProtectRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action protect"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Protection/ProtectionRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Protection/ProtectionRequestBuilder.cs index 53f77df2954..02a59d55226 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Protection/ProtectionRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Protection/ProtectionRequestBuilder.cs @@ -28,12 +28,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Returns sheet protection object for a worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -47,16 +50,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Returns sheet protection object for a worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,16 +87,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Returns sheet protection object for a worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Protection/Unprotect/UnprotectRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Protection/Unprotect/UnprotectRequestBuilder.cs index d1f63e9ff39..74521c49ba0 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Protection/Unprotect/UnprotectRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Protection/Unprotect/UnprotectRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action unprotect"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Range/RangeRequestBuilder.cs index e13a25f5269..bc5dbe9b187 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Range/RangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/RangeWithAddress/RangeWithAddressRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/RangeWithAddress/RangeWithAddressRequestBuilder.cs index 7cca00a14cb..3b70b137a45 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/RangeWithAddress/RangeWithAddressRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/RangeWithAddress/RangeWithAddressRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--address", description: "Usage: address={address}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var addressOption = new Option("--address", description: "Usage: address={address}"); + addressOption.IsRequired = true; + command.AddOption(addressOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, address) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(address)) requestInfo.PathParameters.Add("address", address); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/@Add/AddRequestBuilder.cs index 17a15a98b34..a71128cf0e4 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/@Add/AddRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Count/CountRequestBuilder.cs index 281c6f911d0..346745118e8 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Count/CountRequestBuilder.cs @@ -25,12 +25,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs index 4d2fddbcc2b..47a12a1ec6b 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clearFilters"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/@Add/AddRequestBuilder.cs index 0033cf8fe45..ec765d454cd 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/@Add/AddRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ColumnsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ColumnsRequestBuilder.cs index 99fb3a626ee..db8a81adc19 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ColumnsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ColumnsRequestBuilder.cs @@ -46,18 +46,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -76,30 +82,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Count/CountRequestBuilder.cs index 5cacf70ddd7..f140c783f23 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Count/CountRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs index 17ed6f3d0e7..d1d8a8dc166 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function dataBodyRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs index 43425be430d..0f9da8b7baa 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action apply"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs index d027da0621c..1bf939608a5 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyBottomItemsFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs index 5abd62d9a49..a36d2414a8b 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyBottomPercentFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs index 05307838d8c..3d29b61040f 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyCellColorFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs index a203114cb9c..9b11c81f821 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyCustomFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs index 37145437221..29fd6601bba 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyDynamicFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs index c157e8e8a20..a80132c2a97 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyFontColorFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs index 0d282263cee..b39c0300ff3 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyIconFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs index 2e474aa31bb..e542924100d 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyTopItemsFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs index f9592cb64a2..60bc9b24494 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyTopPercentFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs index a0ba1f63ad6..163f0fbefe5 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs @@ -25,20 +25,27 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action applyValuesFilter"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs index 7e87d3534b5..c9d7659b4d3 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs @@ -25,16 +25,21 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs index 4baa2ed7d9a..5598fa615d4 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs @@ -110,16 +110,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Retrieve the filter applied to the column. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -133,20 +138,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Retrieve the filter applied to the column. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -165,20 +181,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Retrieve the filter applied to the column. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs index b091c63f60d..b6051b2ef8b 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function headerRowRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Range/RangeRequestBuilder.cs index ea4b4e5a275..7b4571c668f 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Range/RangeRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs index 0f3fa126e1b..bc6ebc0efe1 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function totalRowRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/WorkbookTableColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/WorkbookTableColumnRequestBuilder.cs index eb44e68ce38..4decae3860a 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/WorkbookTableColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/WorkbookTableColumnRequestBuilder.cs @@ -31,16 +31,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -74,20 +79,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -106,20 +122,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents a collection of all the columns in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbooktablecolumn-id", description: "key: id of workbookTableColumn"); + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableColumnId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableColumnId)) requestInfo.PathParameters.Add("workbookTableColumn_id", workbookTableColumnId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index bac5ee06ddb..9e9f01a29b8 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs index ad727c6195e..9300e2f32d0 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action convertToRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs index 161f25707b2..a2d960fd31d 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function dataBodyRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs index e3b16071c1a..e6ea5baea44 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function headerRowRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Range/RangeRequestBuilder.cs index 13669b2cf6f..ffacfa6643f 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs index ec2d893bba4..2a9bd048257 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reapplyFilters"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/@Add/AddRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/@Add/AddRequestBuilder.cs index 6723c1e9c84..a0a50641c15 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/@Add/AddRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/@Add/AddRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action add"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Count/CountRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Count/CountRequestBuilder.cs index 5ae81732e1a..aa9eb5ec8e3 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Count/CountRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Count/CountRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function count"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendPrimitiveAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Item/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Item/Range/RangeRequestBuilder.cs index d33b6bee90c..262fee513e4 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Item/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Item/Range/RangeRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablerow-id", description: "key: id of workbookTableRow")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbooktablerow-id", description: "key: id of workbookTableRow"); + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableRowId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableRowId)) requestInfo.PathParameters.Add("workbookTableRow_id", workbookTableRowId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Item/WorkbookTableRowRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Item/WorkbookTableRowRequestBuilder.cs index 23cd362c10c..416bc2174d0 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Item/WorkbookTableRowRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Item/WorkbookTableRowRequestBuilder.cs @@ -27,16 +27,21 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablerow-id", description: "key: id of workbookTableRow")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbooktablerow-id", description: "key: id of workbookTableRow"); + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableRowId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableRowId)) requestInfo.PathParameters.Add("workbookTableRow_id", workbookTableRowId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -50,20 +55,31 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablerow-id", description: "key: id of workbookTableRow")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableRowId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableRowId)) requestInfo.PathParameters.Add("workbookTableRow_id", workbookTableRowId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbooktablerow-id", description: "key: id of workbookTableRow"); + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableRowId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,20 +98,27 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--workbooktablerow-id", description: "key: id of workbookTableRow")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbooktablerow-id", description: "key: id of workbookTableRow"); + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, workbookTableRowId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(workbookTableRowId)) requestInfo.PathParameters.Add("workbookTableRow_id", workbookTableRowId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index 424e19d3a20..b941b2b2267 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/RowsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/RowsRequestBuilder.cs index 1bc197cf243..48c53f2ae70 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/RowsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Rows/RowsRequestBuilder.cs @@ -45,18 +45,24 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -75,30 +81,53 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents a collection of all the rows in the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs index a97d78d0777..48b79a13949 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs @@ -25,18 +25,24 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action apply"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Clear/ClearRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Clear/ClearRequestBuilder.cs index 7179a9ce6c6..774400df79b 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Clear/ClearRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Clear/ClearRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action clear"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs index ce993f9c9a9..3f98cd124b1 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs @@ -25,14 +25,18 @@ public Command BuildPostCommand() { var command = new Command("post"); command.Description = "Invoke action reapply"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreatePostRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePostRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/SortRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/SortRequestBuilder.cs index 7bda0e2f8b4..be02b17a35c 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/SortRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Sort/SortRequestBuilder.cs @@ -41,14 +41,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents the sorting for the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -62,18 +66,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents the sorting for the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -92,18 +106,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents the sorting for the table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs index 3879ae60c85..60b9567437f 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function totalRowRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/WorkbookTableRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/WorkbookTableRequestBuilder.cs index 137277d2b4b..0a064b2e6e6 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/WorkbookTableRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/WorkbookTableRequestBuilder.cs @@ -57,14 +57,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -78,18 +82,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -108,18 +122,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs index cb6f39360cb..f76653eb3b2 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -26,18 +26,24 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function cell"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--row", description: "Usage: row={row}")); - command.AddOption(new Option("--column", description: "Usage: column={column}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}"); + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}"); + columnOption.IsRequired = true; + command.AddOption(columnOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, row, column) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.PathParameters.Add("row", row); - requestInfo.PathParameters.Add("column", column); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/Range/RangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/Range/RangeRequestBuilder.cs index c1aa3aaaf8a..80e008279f8 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/Range/RangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/Range/RangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs index 8b71ca9b0df..fa205c0df04 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/RangeWithAddress/RangeWithAddressRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function range"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--address", description: "Usage: address={address}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var addressOption = new Option("--address", description: "Usage: address={address}"); + addressOption.IsRequired = true; + command.AddOption(addressOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, address) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - if (!String.IsNullOrEmpty(address)) requestInfo.PathParameters.Add("address", address); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs index 1ee86ddf378..aff952c4e5f 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/UsedRange/UsedRangeRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 45fbce06330..1c4e61e5c8c 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,16 +26,21 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/WorksheetRequestBuilder.cs index 5c63b55f9bf..41fe481a3cc 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/WorksheetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/WorksheetRequestBuilder.cs @@ -31,14 +31,18 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "The worksheet containing the current table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -52,18 +56,28 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "The worksheet containing the current table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -82,18 +96,24 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "The worksheet containing the current table. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--workbooktable-id", description: "key: id of workbookTable")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbooktable-id", description: "key: id of workbookTable"); + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, workbookTableId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - if (!String.IsNullOrEmpty(workbookTableId)) requestInfo.PathParameters.Add("workbookTable_id", workbookTableId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs index 63a571b0e56..5d6dae63f95 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function itemAt"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--index", description: "Usage: index={index}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}"); + indexOption.IsRequired = true; + command.AddOption(indexOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, index) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - requestInfo.PathParameters.Add("index", index); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/TablesRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/TablesRequestBuilder.cs index c1ef89cc852..3dfd630c2a1 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/TablesRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/Tables/TablesRequestBuilder.cs @@ -52,16 +52,21 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,28 +85,50 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Collection of tables that are part of the worksheet. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/UsedRange/UsedRangeRequestBuilder.cs index 7dec9c75043..e0fad0de3d1 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/UsedRange/UsedRangeRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/UsedRange/UsedRangeRequestBuilder.cs @@ -26,12 +26,15 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs index 2f4e5ccb608..088a85d3424 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -26,14 +26,18 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usedRange"; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var valuesOnlyOption = new Option("--valuesonly", description: "Usage: valuesOnly={valuesOnly}"); + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, valuesOnly) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var requestInfo = CreateGetRequestInformation(q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/WorkbookWorksheetRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/WorkbookWorksheetRequestBuilder.cs index 289d6cffade..841d4eec966 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/Item/WorkbookWorksheetRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/Item/WorkbookWorksheetRequestBuilder.cs @@ -44,12 +44,15 @@ public Command BuildDeleteCommand() { var command = new Command("delete"); command.Description = "Represents a collection of worksheets associated with the workbook. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId) => { - var requestInfo = CreateDeleteRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreateDeleteRequestInformation(q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); @@ -63,16 +66,25 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Represents a collection of worksheets associated with the workbook. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -100,16 +112,21 @@ public Command BuildPatchCommand() { var command = new Command("patch"); command.Description = "Represents a collection of worksheets associated with the workbook. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbookworksheet-id", description: "key: id of workbookWorksheet"); + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, workbookWorksheetId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePatchRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - if (!String.IsNullOrEmpty(workbookWorksheetId)) requestInfo.PathParameters.Add("workbookWorksheet_id", workbookWorksheetId); + var requestInfo = CreatePatchRequestInformation(model, q => { + }); await RequestAdapter.SendNoContentAsync(requestInfo); // Print request output. What if the request has no return? Console.WriteLine("Success"); diff --git a/src/generated/Workbooks/Item/Workbook/Worksheets/WorksheetsRequestBuilder.cs b/src/generated/Workbooks/Item/Workbook/Worksheets/WorksheetsRequestBuilder.cs index b9fb0342820..094d1668b8f 100644 --- a/src/generated/Workbooks/Item/Workbook/Worksheets/WorksheetsRequestBuilder.cs +++ b/src/generated/Workbooks/Item/Workbook/Worksheets/WorksheetsRequestBuilder.cs @@ -48,14 +48,18 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Represents a collection of worksheets associated with the workbook. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--body")); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (driveItemId, body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -74,26 +78,47 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Represents a collection of worksheets associated with the workbook. Read-only."; // Create options for all the parameters - command.AddOption(new Option("--driveitem-id", description: "key: id of driveItem")); - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - if (!String.IsNullOrEmpty(driveItemId)) requestInfo.PathParameters.Add("driveItem_id", driveItemId); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var driveItemIdOption = new Option("--driveitem-id", description: "key: id of driveItem"); + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (driveItemId, top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); diff --git a/src/generated/Workbooks/WorkbooksRequestBuilder.cs b/src/generated/Workbooks/WorkbooksRequestBuilder.cs index db7794b9897..4341aa84aa5 100644 --- a/src/generated/Workbooks/WorkbooksRequestBuilder.cs +++ b/src/generated/Workbooks/WorkbooksRequestBuilder.cs @@ -56,12 +56,15 @@ public Command BuildCreateCommand() { var command = new Command("create"); command.Description = "Add new entity to workbooks"; // Create options for all the parameters - command.AddOption(new Option("--body")); + var bodyOption = new Option("--body"); + bodyOption.IsRequired = true; + command.AddOption(bodyOption); command.Handler = CommandHandler.Create(async (body) => { using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); var model = parseNode.GetObjectValue(); - var requestInfo = CreatePostRequestInformation(model); + var requestInfo = CreatePostRequestInformation(model, q => { + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json"); @@ -80,24 +83,44 @@ public Command BuildListCommand() { var command = new Command("list"); command.Description = "Get entities from workbooks"; // Create options for all the parameters - command.AddOption(new Option("--top", description: "Show only the first n items")); - command.AddOption(new Option("--skip", description: "Skip the first n items")); - command.AddOption(new Option("--search", description: "Search items by search phrases")); - command.AddOption(new Option("--filter", description: "Filter items by property values")); - command.AddOption(new Option("--count", description: "Include count of items")); - command.AddOption(new Option("--orderby", description: "Order items by property values")); - command.AddOption(new Option("--select", description: "Select properties to be returned")); - command.AddOption(new Option("--expand", description: "Expand related entities")); - command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { - var requestInfo = CreateGetRequestInformation(); - requestInfo.QueryParameters.Add("top", top); - requestInfo.QueryParameters.Add("skip", skip); - if (!String.IsNullOrEmpty(search)) requestInfo.QueryParameters.Add("search", search); - if (!String.IsNullOrEmpty(filter)) requestInfo.QueryParameters.Add("filter", filter); - requestInfo.QueryParameters.Add("count", count); - requestInfo.QueryParameters.Add("orderby", orderby); - requestInfo.QueryParameters.Add("select", select); - requestInfo.QueryParameters.Add("expand", expand); + var topOption = new Option("--top", description: "Show only the first n items"); + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items"); + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases"); + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values"); + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items"); + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values"); + orderbyOption.IsRequired = false; + orderbyOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned"); + selectOption.IsRequired = false; + selectOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities"); + expandOption.IsRequired = false; + expandOption.Arity = ArgumentArity.ZeroOrMore; + command.AddOption(expandOption); + command.Handler = CommandHandler.Create(async (top, skip, search, filter, count, orderby, select, expand) => { + var requestInfo = CreateGetRequestInformation(q => { + q.Top = top; + q.Skip = skip; + if (!String.IsNullOrEmpty(search)) q.Search = search; + if (!String.IsNullOrEmpty(filter)) q.Filter = filter; + q.Count = count; + q.Orderby = orderby; + q.Select = select; + q.Expand = expand; + }); var result = await RequestAdapter.SendAsync(requestInfo); // Print request output. What if the request has no return? using var serializer = RequestAdapter.SerializationWriterFactory.GetSerializationWriter("application/json");